none
Error in connecting SAP PI Service "The authentication header received from the server was 'Basic realm="XISOAPApps" RRS feed

  • Question

  • We are getting the below error in connection to SAP PI Services.

    The HTTP request is unauthorized with client authentication scheme 'Anonymous'.
    The authentication header received from the server was 'Basic realm="XISOAPApps"

    The following is the Config :

    <?xml version="1.0" encoding="utf-8" ?>
    <configuration>
        <system.serviceModel>
            <bindings>
                <basicHttpBinding>
                    <binding name="MeterJobEnquiry_Sync_OutBinding" closeTimeout="00:01:00"
                        openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00"
                        allowCookies="false" bypassProxyOnLocal="false" hostNameComparisonMode="StrongWildcard"
                        maxBufferSize="65536" maxBufferPoolSize="524288" maxReceivedMessageSize="65536"
                        messageEncoding="Text" textEncoding="utf-8" transferMode="Buffered"
                        useDefaultWebProxy="true">
                        <readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384"
                            maxBytesPerRead="4096" maxNameTableCharCount="16384" />
                        <security mode="TransportCredentialOnly">
                            <transport clientCredentialType="None" proxyCredentialType="None"
                                realm="" />
                            <message clientCredentialType="UserName" algorithmSuite="Default" />
                        </security>
                    </binding>
                  
                </basicHttpBinding>
            </bindings>
            <client>
                <endpoint address="http://tptyicv.xx.abcedlc.com:50000/XISOAPAdapter/MessageServlet?senderParty=&amp;senderService=SRMTEFORM&amp;receiverParty=&amp;receiverService=&amp;interface=JobEnquiry_Sync_Out&amp;interfaceNamespace=urn%3XYZs.co.uk%3AERP%3JobEnquiry"
                    binding="basicHttpBinding" bindingConfiguration="MeterJobEnquiry_Sync_OutBinding"
                    contract="ServiceReference1.MeterJobEnquiry_Sync_Out" name="HTTP_Port" />
             
            </client>
        </system.serviceModel>
    </configuration>

    Proxy Code:-

    static void Main(string[] args)
            {
                try
                {
                    MeterJobEnquiry_Sync_OutClient objProxy = new MeterJobEnquiry_Sync_OutClient();
                    objProxy.ClientCredentials.UserName.UserName = "xyzUser";
                    objProxy.ClientCredentials.UserName.Password = "xyzPassword";
                    MeterJobEnquiryRequest Objrequest = new MeterJobEnquiryRequest();
                    Objrequest.Request = new MeterJobEnquiryRequestRequest();
                    Objrequest.Request.Sector = "M";
                    Objrequest.Request.TargetSystem = "XYZ";
                    MeterJobEnquiryResponse response = new MeterJobEnquiryResponse();
                    response = objProxy.MeterJobEnquiry_Sync_Out(Objrequest);
                }
                catch (Exception ex)
                {
                    Console.WriteLine(ex.Message);

                }
                Console.ReadLine();
            }

    Any idea ?


    ilikemicrosoft



    • Edited by surendiran Tuesday, February 25, 2014 10:46 AM
    Tuesday, February 25, 2014 10:13 AM

Answers

  • Hi,

    From your description, I saw that you have set the following in your config file:

    <security mode="TransportCredentialOnly">
                             <transport clientCredentialType="None" proxyCredentialType="None"
                                 realm="" />
                             <message clientCredentialType="UserName" algorithmSuite="Default" />
                         </security>

    But it looks like your service requires basic authentication on the transport level, so please try to configure the following:

    <securitymode="Transport">
       <transportclientCredentialType="Basic" proxyCredentialType="None" realm="" /> 
    </security>

    Note: not sure if your proxy requires authentication. If it requires, you need to modify proxyCredentialType as well.

    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.

    Wednesday, February 26, 2014 1:47 AM
    Moderator