tags:

views:

168

answers:

1

Hello!

I'd like a little bit of assistance here.

I am trying to send a request to a .NET SOAP server from PHP with Zend.

I have the WSDL file but it does not contain any header information. Though I have tried to add a custom header this does not seem to work and the worst is that the WSDL file itself does not seem to be "right".....

Here is the link: http://www.speedex.gr/getvoutrans/getvoutrans.asmx The WSDL can be found in the same link by adding ?WSDL

My request is: GetVouTrans

Thanx in advance!

A: 

The http://www.speedex.gr/getvoutrans/getvoutrans.asmx?op=GetVouTrans url shows the expected request.

If you'll overwrite the SoapClient::__doRequest function, you can check what you're sending.
(don't forget to call the parent::__doRequest())

You can even change the xml to make .net specific changes.

To bad SOAP doesn't always work out of the box between different language.
I've had problems with php 5.2.0 (debian) and a java soap-server, the problem disappeared in thin air when i upgraded to php version 5.2.8

A comment on the __doRequest manpage suggests:

class MSSoapClient extends SoapClient {

  function __doRequest($request, $location, $action, $version) {
    $namespace = "http://tempuri.com";

    $request = preg_replace('/<ns1:(\w+)/', '<$1 xmlns="'.$namespace.'"', $request, 1);
    $request = preg_replace('/<ns1:(\w+)/', '<$1', $request);
    $request = str_replace(array('/ns1:', 'xmlns:ns1="'.$namespace.'"'), array('/', ''), $request);

    // parent call
    return parent::__doRequest($request, $location, $action, $version);
  }
}

$client = new MSSoapClient(...);

But this comment is from 2007, so your mileage may vary.

Bob Fanger