使用SOAP头从ASP.NET向Peoplesoft web服务传递凭据
我在网上到处找,找不到解决这个问题的办法。我正在开发一个需要使用PeopleSoft web服务的ASP.NET应用程序。在他们对服务进行安全保护之前,它一直工作正常。它不是.NET服务,因此我无法以典型的.NET方式usnig System.NET.NetworkCredential传入凭据。PS开发人员告诉我必须在SOAP头中传递凭据。我在任何地方都看不到这样做的具体方法。以下是PeopleSoft WSDL的片段:使用SOAP头从ASP.NET向Peoplesoft web服务传递凭据,asp.net,web-services,peoplesoft,Asp.net,Web Services,Peoplesoft,我在网上到处找,找不到解决这个问题的办法。我正在开发一个需要使用PeopleSoft web服务的ASP.NET应用程序。在他们对服务进行安全保护之前,它一直工作正常。它不是.NET服务,因此我无法以典型的.NET方式usnig System.NET.NetworkCredential传入凭据。PS开发人员告诉我必须在SOAP头中传递凭据。我在任何地方都看不到这样做的具体方法。以下是PeopleSoft WSDL的片段: <wsdl:binding name="PROCESSREQUEST
<wsdl:binding name="PROCESSREQUEST_Binding" type="tns:PROCESSREQUEST_PortType">
<soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http" />
- <wsdl:operation name="PRCS_FINDREQUESTS">
<soap:operation soapAction="PRQ_FINDREQUESTS.v1" style="document" />
- <wsp:Policy wsu:Id="UsernameTokenSecurityPolicyPasswordRequired" xmlns:wsu="http://docs.oasis- open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">
- <wsp:ExactlyOne>
- <wsp:All>
- <wsse:SecurityToken wsp:Usage="wsp:Required" xmlns:wsse="http://docs.oasis- open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd">
<wsse:TokenType>wsse:UserNameToken</wsse:TokenType>
- <Claims>
<SubjectName MatchType="wsse:Exact" />
<UsePassword wsp:Usage="wsp:Required" />
</Claims>
</wsse:SecurityToken>
</wsp:All>
</wsp:ExactlyOne>
</wsp:Policy>
-
-
-
-
-
wsse:UserNameToken
-
如何使用C#?传递凭据这是我在测试使用jMeter激活用户名安全性的web服务时使用的soap头:
<soapenv:Header xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
<wsse:Security xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd" soap:mustUnderstand="1">
<wsse:UsernameToken>
<wsse:Username>myUserName</wsse:Username>
<wsse:Password>myPassWord</wsse:Password>
</wsse:UsernameToken>
</wsse:Security>
</soapenv:Header>
我的用户名
我的密码
它应该在C#中完成这项工作。下面是我在测试使用jMeter激活用户名安全性的web服务时使用的soap头:
<soapenv:Header xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
<wsse:Security xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd" soap:mustUnderstand="1">
<wsse:UsernameToken>
<wsse:Username>myUserName</wsse:Username>
<wsse:Password>myPassWord</wsse:Password>
</wsse:UsernameToken>
</wsse:Security>
</soapenv:Header>
我的用户名
我的密码
它应该用C#做这项工作