locked
Passing security credentials to PeopleSoft web service with custom SOAP header using C# RRS feed

  • Question

  • User-1267064689 posted

    I have looked all over the web and cannot find the solution to this.  I am developing an ASP.NET application (C#) that needs to consume a PeopleSoft web service.  It was working fine until they applied security to the service.  It's not a .NET service, so I cannot pass in credentials in the typical .NET way using System.Net.NetworkCredential.  The PS developers told me I have to pass the credentials in the SOAP header.  I see no specific way to do that anywhere.  Here's the snippet from the PeopleSoft WSDL:

    <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>

    I really don't want to resort to passing the full XML payload as an HTTP Request.  I already have everything else working in the normal manner by adding the web reference using the web service WSDL and coding against the proxy class VS2010 created for me.  But I see no way to pass data to the SOAP header of the target web service using this method.  Remember the target web service is NOT a .NET web service, so using System.Net.NetworkCredential is not applicable.  Any guidance is greatly appreciated...I'm stumped.

    Thanks

    Thursday, June 6, 2013 1:26 PM

Answers

  • User220959680 posted

    <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>

    Note that the technology i.e., Peoplesoft or Java or .Net does not matter for Web services. Web services are platform independent that exchange data in xml format.

    In order to pass credentials in SOAP header, refer below article

    http://social.msdn.microsoft.com/Forums/en-US/wcf/thread/46cb2eb4-17ed-4b9a-ae53-224eb21fd0ab

    Building a Client that Processes SOAP Headers (Refer the section 'Building a client that processes SOAP Headers)

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Saturday, June 8, 2013 5:42 PM