Skip to Content
author's profile photo Former Member
Former Member

Set credentials in Web Service

Hello Community i have a problem when I call a Web Service, the reason is that always when I call the service always request me to set credentials.

I want to know if someone know how to set credentials since the code.

For example in PHP when I call a web service I do something like this:

$wsdl="http://localhost/wservice/ZWS_CALC.XML?WSDL";

$client=new nusoap_client($wsdl,'wsdl');

$client->setCredentials('Usr', 'Pass', 'basic');

$param=array('INum1'=>'80', 'INum2' => '19', 'IOpci' => 'M');

$resultado = $client->call('ZwsEjecWsdl', $param);

I need to know which could the reemplece of this piece of code in ABAP:

$client->setCredentials('Usr', 'Pass', 'basic');

Thanks in advance.

Regards.

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

2 Answers

  • Best Answer
    Posted on Jul 22, 2016 at 11:32 AM

    Hi Ricardo,

    depends on how you call the Web Service.

    • If you use a WebService Consumer, you can set the credentials directly in the Consumer (transaction SOAMANAGER, tab Consumer-Security).
    • If you use a destination of type 'G' (CL_HTTP_CLIENT->CREATE_BY_DESTINATION), you can set the credentials in the destination (transaction SM59).
    • If you use a "direct" HTTP client (CL_HTTP_CLIENT->CREATE_BY_URL), you can set the credentials via method IF_HTTP_CLIENT->AUTHENTICATE.

    Best Regards, Ulrich

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jul 22, 2016 at 01:11 PM

    Thanks a lot for your quick and correct answer, you're a master.

    I'll do the required configuration to do that. But this is the solution.

    Thank's again.

    Best Regards. Ricardo.

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.