Jump to content

SOAP Server - Multiple functions


philaj

Recommended Posts

've create a SOAP Server using the PHP Soap functions. It has 3 functions in it and is initialised as follows;

// Initialise the SOAP Server 
$opts = Array();
$opts['compression'] = SOAP_COMPRESSION_ACCEPT | SOAP_COMPRESSION_GZIP;
$server = new SoapServer('SOTBWSDL.wsdl', $opts);
$server->addFunction('getAvailability');
$server->addFunction('putReservation');
$server->addFunction('putCancelBooking');
$server->handle();

There are then 3 Functions as defined with the code in for each .

I have created a test client which makes the call as;

$client = new SoapClient('http://xxxxxxxxx/SOTBWSDL.wsdl',array('trace'=>1,'exceptions=>1'));
$res   = $client->getAvailability($xmlparams);

This works and returns data as expected.

However - if I try the call as

$res   = $client->putReservation($xmlparams);   (To another function) 

it is the first function (get Availability) that is executed.


Question 1: Are separate Functions ok to use - -or do they need to be in a Class?

Question 2: No Errors are thrown regarding the WSDL so I presume this must be ok ....

What reasons could cause this? Any help greatfully received.

Phil

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.