Skip to Content
avatar image
Former Member

sapcontrol wdsl - how to pass username and password?

Hi, I'm currently querying via PHP some system details via the wdsl page of the sapcontrol process. (URL: http://servername:5<instance number>13/?wsdl)

For certain operations, no password is required. For example this works fine:

$client = new SoapClient($URL, $params);
$DBdetails = $client->GetProcessList();

Now, for an operation that requires a userid and password, like this:

$DBdetails = $client->ABAPCheckRFCDestinations();

I get the following error:

SoapFault exception: [SOAP-ENV:Client] HTTP Error: 'Unauthorized' in C:\Use...: SoapClient->__call('ABAPCheckRFCDes...', Array)

How can I pass the userid and password to get a result?

Kind regards,


Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • Jul 13, 2017 at 01:47 PM

    In the WSDL you have mentioned there is a XML node called documentation.

    The SAPControl webservice can be used to control and monitor a single SAP instance. Some methods may fail with HTTP error 401 without user authentication. Use HTTP basic authentication (UTF8 encoded) to provide OS user credentials. By default the service uses port 5$(SAPSYSTEM)13 for HTTP and 5$(SAPSYSTEM)14 for HTTPS (if SSL is configured for the instance), this might be overridden in etc/service by specifying sapctrl$(SAPSYSTEM) and sapctrls$(SAPSYSTEM).

    So it's the HTTP basic authentication.

    And here is how to implement :)

    Best regards


    Add comment
    10|10000 characters needed characters exceeded