Developer Forum [ All Topics | New Topic ]

Thread: PHP SOAP web service

Hi,

While i using php soap client to connect to the rapnet site it through the below error.

My code is here.
===============

$soapClient = new SoapClient("https://technet.rapaport.com/WebServices/RetailFeed/RetailFeed.asmx?WSDL");
   
        // Prepare SoapHeader parameters
       $sh_param = array('Username'=>'XXXX','Password'=>'XXXXX');
        $soapClient->__call('Login',$sh_param);

Fatal error: Uncaught SoapFault exception: [soap:Server] Server was unable to process request. ---> Procedure or function 'sp_SUB_GetActiveServicesForLogin' expects parameter '@Username', which was not supplied. Query: sp_SUB_GetActiveServicesForLogin in /opt/lampp/htdocs/rapanet/soap_client.php:11 Stack trace: #0 /opt/lampp/htdocs/rapanet/soap_client.php(11): SoapClient->__call('Login', Array) #1 {main} thrown in /opt/lampp/htdocs/rapanet/soap_client.php on line 11






>> add a comment
Atlanta
02/15/2012 02:14


10 Replies:

Hey,
Are you still getting this error?

Eli


>> add a comment
Eli Sack
2/16/2012 2:30:00 AM
Hi Eli,

   I am still getting these error. Can give the suggestion

Atlanta.

>> add a comment
Atlanta
2/16/2012 5:05:00 AM
I'm having the same error. I've tried this two different ways:

$client = new SoapClient("https://technet.rapaport.com/webservices/prices/rapaportprices.asmx?WSDL");
$function_name = "Login";
$arguments = array('Username'=>"12345", "Password" => "12345");
$client->__soapCall($function_name, $arguments);

(which yields)

Fatal error: Uncaught SoapFault exception: [soap:Server] Server was unable to process request. ---> Procedure or function 'sp_SUB_GetActiveServicesForLogin' expects parameter '@Username', which was not supplied.
Query: sp_SUB_GetActiveServicesForLogin insoaprequest.php:10
Stack trace:
#0 soaprequest.php(10): SoapClient->__soapCall('Login', Array)
#1 {main}
  thrown in soaprequest.php on line 10

and

$client = new SoapClient("https://technet.rapaport.com/webservices/prices/rapaportprices.asmx?WSDL");
$result = $client->Login(array('Username'=>"12345", "Password" => "12345"));
$result2 = $client->GetPrice();

Fatal error: Uncaught SoapFault exception: [soap:Server] Server was unable to process request. ---> You are not authenticated. Please run the Login function first. in soaprequest.php:14
Stack trace:
#0 soaprequest.php(14): SoapClient->__call('GetPrice', Array)
#1 soaprequest.php(14): SoapClient->GetPrice()
#2 {main}
  thrown in soaprequest.php on line 14
I've changed the passwords here but have verified they work and when using the second method posted here if I pass invalid credentials I get an invalid credentials response on the Login call.

Thanks for any help.


>> add a comment
Steven
2/21/2012 4:06:00 PM
Could you post the full PHP code example you are using? There doesn't seem to be alot of documentation on how to connect  to the LinkPlus Web Service with PHP and using the retails feeds (http://technet.rapaport.com/WebServices/RetailFeed/RetailFeed.asmx).

Thanks in advance,
Angel


>> add a comment
Angel
2/26/2012 3:58:00 PM
Update: I've done some research and am trying to connect this way as well and am getting the same errors as the others are.

Any ideas?

>> add a comment
Angel
2/26/2012 4:19:00 PM
For anyone else having the same problem (connecting to the LinkPlus WebService with PHP), I have called tech support and someone is suppose to be looking in to this issue and letting me know something in 24-48 hours.

I will keep things posted as I hear more news.

Thanks,
Angel

>> add a comment
Angel
2/27/2012 2:31:00 PM

Hi,

I looked into this.
The first option you tried,
$client = new SoapClient("https://technet.rapaport.com/webservices/prices/rapaportprices.asmx?WSDL");
$function_name = "Login";
$arguments = array('Username'=>"12345", "Password" => "12345");
$client->__soapCall($function_name, $arguments);
doesn't pass the parameters to our servers, therefore resulting into an error.

The second option, $client = new SoapClient("https://technet.rapaport.com/webservices/prices/rapaportprices.asmx?WSDL");
$result = $client->Login(array('Username'=>"12345", "Password" => "12345"));
$result2 = $client->GetPrice();
Does pass the username and password, to our server, but what you have to do after the login, is to get the SOAP header back from the login function, and pass this to the GetPrice method.

Unfortunately I couldn't get this to work either in PHP. The __setSoapHeaders method doesn't seem to work at all with our server, you will get back to no parameters being provided at all. The same result for using __soapCall. I couldn't figure out why, but I guess it adds some kind of wrapper in the SOAP envelope. But the bottom line is that it doesn't seem to be possible to get this to work with native PHP in this way.

If you want to investigate further, our login method gives back an output header like this:[SoapHeader("AuthTicket", Direction = SoapHeaderDirection.Out)]

and the other methods take this as an input value:
[SoapHeader("AuthTicket", Direction = SoapHeaderDirection.In)]

the idea is that you take the authentication ticket from the login method, and pass this to the other methods.

An alternative approach is to try to use an external library for making the web service call, in the hope that that library would be able to overcome this obstacle.

I hope this gives a good direction on how to try, I am keen to hear back on this, since we have a a lot of people trying to access our web services with PHP.

Regards,

Leo
 



>> add a comment
Leo Muller
2/28/2012 5:21:00 AM
Hi,

I am getting same error AuthenticationTicketHeader, any solution ?

>> add a comment
Rajen
5/13/2016 9:05:00 AM
hi Rajen,
can you post here your code please? I would like to see why you get an error

Inbal 

>> add a comment
inbal
5/17/2016 11:06:00 AM
Array ( [faultcode] => soap:Server [faultstring] => System.Web.Services.Protocols.SoapException: Server was unable to process request. ---> System.Security.SecurityException: You are not authenticated. Please run the Login function first. at DiamondManager.AuthorizeUser(ActiveUser AU) at DiamondManager.UploadLots(UploadLotsParameters Parameters) --- End of inner exception stack trace --- [detail] => )

>> add a comment
si
11/3/2022 7:02:00 AM