Problem consuming Java JAX-WS web service from Zend_Soap_Client

1 message Options
Embed this post
Permalink
barretBSE

Problem consuming Java JAX-WS web service from Zend_Soap_Client

Reply Threaded More More options
Print post
Permalink

Hi! I have a problem consuming a Java JAX-WS web service from Zend_Soap_Client.

I wrote a simple Java JAX-WS web service using Netbeans' wizard. It contains two operations: method_1 and method_2. method_1 returns the string "hello world", method_2 returns x+1 where x is an input parameter.

I got an exception error Unsupported Media Type when I tried to consume the service with the following code:

$client = new Zend_Soap_Client('http://localhost:8084/MyApplication/MyService?wsdl');
$functions = $client->getFunctions(); // works!!!
$result = $client->method_2(array('x' => 10)); //fails

If I use SoapClient instead of Zend_Soap_Client I have no problems:

$client = new SoapClient('http://localhost:8084/MyApplication/MyService?wsdl');
$result = $client->method_2(array('x' => 10)); //$result is an object (stdClass)
echo $result->return; // prints 11

The question is: why I got that error using Zend_Soap_Client and how could I make it works? Any help will be really appreciated. Thanks ;)

Sincerely,
Federico