none
WCF Headache with HTTP auth for User Name and Password trying to access PeopleSoft CI RRS feed

  • Question

  • All,

    I am trying to make a .net WCF call that I think should be simple but has proved incredibly difficult. I could really use some help and in full disclosure I am a WCF newbie. Here's the scenario:

    1. I am trying to call a PeopleSoft CI web service, from C#, that is secured with a user name and password on the PeopleSoft side.
    2. The core problem is that the security headers, such as username and password, are not being sent correctly to the PeopleSoft web service.
    3. I have done a lot of research and made a lot of attempts over the last several days and made some progress but the bottom line is that I can not get this to work.
    4. The items presented below are my original starting blocks and I will not cloud the thread with all of the options I have tried.
    5. The original WSDL pointed to a standard HTTP site. I have tried this with HTTPS as well thinking this would solve the problem. No luck
    6. The web service schema is the following:

       <HEADER>
          <USERID>myID</USERID>
          <PASSWORD>????</PASSWORD>
          <LANGUAGE_CD>ENG</LANGUAGE_CD>
        </HEADER>
        <that>Ithid</that>
        <Strcurrent_action>target</Strcurrent_action>
        <Strnew_action>action</Strnew_action>
        <StractionConfirm>action</StrpasswordConfirm>
      </MyAction__This__Stuff_SELF>
      • I generated the C# class and config file from svcutil. The app.config appears as such:

        <system.serviceModel>
            <bindings>
                <basicHttpBinding>
                    <binding name="MyStuff_Binding" />
                </basicHttpBinding>
            </bindings>
      • I make the call with the following code:

        MyStuff_PortTypeClient client = new MyStuff_PortTypeClient("MyStuff_Port"); client.ClientCredentials.UserName.UserName = "MyLogon"; client.ClientCredentials.UserName.Password = "MyPassword";
        MyAction__CompIntfc__USER_PROFILETypeShape actionShape = new MyAction__CompIntfc__USER_PROFILETypeShape(); UserIDTypeShape targetUser = new UserIDTypeShape(); try {client.MyStuff_MyAction(actionShape); //Make the call}

      • As I mentioned I have tried this numerous ways including changing the security, message and transport options in basicHttpBinding, trying this with wsHttpBinding,custom headers etc...and no joy.

      • I would really appreciate any assistance and successful examples of how to call a PeopleSoft web service secured with a user name and password over http or https.

    Thanks


    If this post has been useful please click the green arrow to the left or click Propose as answer

    Thursday, July 3, 2014 1:40 PM

Answers

  • The following article appears to hold the solution.

    Thanks,

    Scott


    If this post has been useful please click the green arrow to the left or click Propose as answer

    Sunday, July 6, 2014 4:45 PM

All replies

  • I generated the C# class and config file from svcutil. The app.config appears as such:

    <system.serviceModel>
        <bindings>
            <basicHttpBinding>
                <binding name="MyStuff_Binding" />
            </basicHttpBinding>
        </bindings>

    Hi,

    I see that your client config looks like below, but since you want to use the username and password authentication, then you service and client config should be as following:

    <bindings>
        <basicHttpBinding>
            <binding name="basicBinding">
                <security mode="Message">
                    <message clientCredentialType="UserName"/>
                </security>
            </binding>
        </basicHttpBinding>
    </bindings>
    
    Also please do not forget to apply the above binding configuration to the endpoint as below:
    <endpoint address="" binding="basicHttpBinding"    
                  bindingConfiguration="basicBinding"
                  contract="YourServiceContract" />
    

    For more information, please try to refer to:
    #WCF Service with custom username password authentication:
    http://www.codeproject.com/Articles/96028/WCF-Service-with-custom-username-password-authenti .

    Best Regards,
    Amy Peng


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Friday, July 4, 2014 2:41 AM
    Moderator
  • The following article appears to hold the solution.

    Thanks,

    Scott


    If this post has been useful please click the green arrow to the left or click Propose as answer

    Sunday, July 6, 2014 4:45 PM