Skip to Content
0

sapcontrol wdsl - how to pass username and password?

Jul 12, 2017 at 04:09 PM

183

avatar image
Former Member

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,

Gregory

soap | wsdl | php
10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

1 Answer

Bartosz Jarkowski Jul 13, 2017 at 01:47 PM
1

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

<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).
</documentation>

So it's the HTTP basic authentication.

And here is how to implement :)

https://stackoverflow.com/questions/10219463/wsdl-to-php-with-basic-auth

Best regards

Bartosz

Share
10 |10000 characters needed characters left characters exceeded