Saturday, March 24, 2012

PHP SOAP client to consume JAX-WS

For couple of days I was googling and researching for a descent solution to my problem to access and consume the services exposed over a JAX-WS from my php application. Actually, I have to write a client so that I can save data from my php application (A subscriber application info management system for the telco company I am working for) to IN database where I have to do so over a JAX-WS interface.
Usually, I woud've followed my previous post. But it din work in this case- the problem and a basic setup is I got from the following location:
But that either din resolve my problem entirely; as my JAX-WS needs a BASIC HTTP AUTHENTICATION to access it. So, following was my solution :

From php manual I must quote that you must set uri and location directives while invoking webservice with wsdl.I mean when you create the SoapClient object.

Now, that is how I retrieved data from the web service. Next, I will try to save the data and will share how I do it.

  1. php manual for soap client. A must read with care of the all the options.
  2. soapUI. A must have tool while working with soap - to easy analyze things.
  3. wsf/php. A framework for php to easily play with enterprise level web services. I will write my experience with it some other time.