views:

703

answers:

8

I have been approached to create a website using Sabre Web Services to power the reservations system. All documentation I have seen refers to .NET or Java solutions, I was in doubt whether PHP can be used as access is performed using SOAP. I have found no further information about this, I assume the answer is yes, but wonder why there is not a single reference to this being possible - all solutions seem to be .NET

Any suggestions?

Thanks!

A: 

Hi Peter,

Yes, PHP can be be used to connect to SOAP web services - take a look at NuSOAP. It allows a nice & easy object oriented way to consume web services.

John McCollum
+2  A: 

SOAP is language independent, which means that any language can communicate with the web service if it can generate SOAP requests and handle responses.

PHP's SOAP documentation can be found in the php manual

David Caunt
+1  A: 

PHP can be used to call SOAP pretty effectively.

There's a very good tutorial on devzone on how you can use SOAP well.

Ólafur Waage
A: 

Were you able to find a solution for this? The only solution I found was to make raw socket requests because you can't manipulate the content-type header in PHP Soap

Moazzam
A: 

I am embarking on a similar project - consume sabres soap objects. My research tells me that nusoap wont work - I see it recommended here however does some one have a working example with sabres wsdl?

carey
A: 

Check here for a solution : http://moazzam-khan.com/

Moazzam
A: 

Has anyone found solution for php + sabre webservice ?

Milan Prajapati
A: 

I've just done a little digging around and it looks like you can use stream_context_create() to create a custom HTTP stream context. This would include the HTTP content type header you need. The resource returned from this function call can then be passed to the SoapClient constructor to be used in SOAP calls. Have a look at http://ca.php.net/stream_context_create and the PHP manual page for the SoapClient constructor (sorry, I can only post one link as a new user) for more information.

Jeremy