简体   繁体   English

需要“具有WSSE身份验证的SOAP客户端”...... Visual Studio是否符合此需求?

[英]Need a “SOAP Client with WSSE authentication” … does Visual Studio fit this need?

The Web Service I need to connect to has the requirement above. 我需要连接的Web服务具有上述要求。 I can consume this web service in VS 2008 but cannot use it because I don't know how to authenticate. 我可以在VS 2008中使用此Web服务但不能使用它,因为我不知道如何进行身份验证。 I need to specify credentails, however there is no "header" method exposed. 我需要指定credentails,但是没有公开“header”方法。 I have tried something like the following: 我尝试过以下内容:

UltraDNSWebReference.UltraWebServiceService clientProxy = 
    new UltraDNSWebReference.UltraWebServiceService();

clientProxy.Credentials = new System.Net.NetworkCredential(
    "MyUserName", "MYPassword");

but I still get an authentication error. 但我仍然收到身份验证错误。 I CAN connect successfully using the SOAPUI testing platform, so I know it is not incorrect credentials or blocked IP. 我可以使用SOAPUI测试平台成功连接,因此我知道它不是不正确的凭据或阻止的IP。

This WebService API states: 此WebService API指出:

The Neustar Ultra Services API authenticates a user and requests with a WSSE UserName token in a SOAP header. Neustar Ultra Services API使用SOAP标头中的WSSE UserName标记对用户和请求进行身份验证。

Is it possible for me to use this webservice within Visual Studio??? 我是否可以在Visual Studio中使用此Web服务???

I have tried Add Service Reference. 我尝试过添加服务参考。 I can successfully consume the WSDL and create an object but have no idea how to provide the authentication. 我可以成功使用WSDL并创建一个对象,但不知道如何提供身份验证。 For instance I have tried the following: 例如,我尝试过以下方法:

//Create client object  
  ServiceReference1.UltraDNSClient client = new ServiceReference1.UltraDNSClient();
  client.ClientCredentials.UserName.UserName = "myUserName";
  client.ClientCredentials.UserName.Password = "myPassword";

So, above I have my client object, and this object has all access to all the methods in the API. 所以,上面我有我的客户端对象,这个对象可以访问API中的所有方法。 However, I can NOT use any methods because I have not authenticated correctly. 但是,我不能使用任何方法,因为我没有正确验证。 The API does not provide any sort of "header()" type method. API不提供任何类型的“header()”类型方法。 For instance, for another webservice I use (and yes, this used Add Web Reference but the concept stays the same): 例如,对于我使用的另一个Web服务(是的,这使用了Add Web Reference,但概念保持不变):

//Use the Web Reference to create the header object
StockLogoWebService.Header headerObject = new StockLogoWebService.Header();

//Assign the username (Username is all Xignite requires for authentication)
headerObject.Username = "janedoe@yahoo.com";

//Assign this header to the proxy object
xLogogsTest.HeaderValue = headerObject;

//Use any exposed methods
xLogosTest.anyMethod()

Above I have used the header() method to specify my credentials. 上面我使用了header()方法来指定我的凭据。 If a WSDL does not provide a header method, and just states the credentials must be supplied in the SOAP header, how does one accomplish this in Visual Studio? 如果WSDL没有提供头方法,并且只是声明必须在SOAP头中提供凭据,那么在Visual Studio中如何实现呢?

The WSDL can be found at: WSDL可以在以下位置找到:

http://ultra-api.ultradns.com:8008/UltraDNS_WS?wsdl http://ultra-api.ultradns.com:8008/UltraDNS_WS?wsdl

You can add WSSE security headers to your service endpoint in the web / app config: 您可以在Web / app配置中将WSSE安全标头添加到服务端点:

 <system.serviceModel>
    <bindings>
        <customBinding>
          <! -- your binding details -->
        </customBinding>
    </bindings>
    <client>
      <endpoint <your endpoint details>>
        <headers>
          <wsse:Security xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd" mustUnderstand="1">
            <wsse:UsernameToken xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" wsu:Id="UsernameToken-1">
              <wsse:Username></wsse:Username>
              <wsse:Password Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordText"></wsse:Password>
            </wsse:UsernameToken>
          </wsse:Security>
        </headers>
      </endpoint>
    </client>
</system.serviceModel>

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 客户端在WCF中是否需要用于用户名身份验证的证书 - Does the client need a certificate for username authentication in WCF 在soap消息中使用wsse安全标头(Visual Studio 2015,.Net Framework 4.5) - Use wsse security header in soap message (Visual Studio 2015, .Net Framework 4.5) 使用C#,WCF SOAP使用者使用WSSE纯文本身份验证? - With C#, WCF SOAP consumer that uses WSSE plain text authentication? SOAP xml客户端 - 使用Visual Studio 2010 c# - 如何? - SOAP xml client - using Visual Studio 2010 c# - how? Visual Studio Online是否支持SOAP WorkItem更改通知? - Does Visual Studio Online support SOAP WorkItem change notification? 寻求创建用于客户端身份验证的Web服务并需要一些建议 - Looking to create a webservice for client authentication and need some advice 需要有关连接到WCF Rest设置的Android客户端身份验证的建议 - Need advice on authentication for android client connecting to the WCF Rest setup 在发送请求之前,需要帮助在我的WCF客户端中操作SOAP标头 - Need help with manipulating SOAP header in my WCF client before sending request 什么时候WCF NetTcpBinding需要完全信任客户端? - When does WCF NetTcpBinding need full trust on the client? 每个经过身份验证的WCF客户端连接是否需要CAL? - Does each authenticated WCF client connection need a CAL?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM