views:

190

answers:

1

I'm trying to connect to the next webservice:

https://grab.beta.agiv.be/Tools/CRABTools.svc?wsdl

I also have to add a header element which I have already created

Can i call it just using php soapclient or zend_soap_client? Or do I have to use nusoap_client? I try something like:

$soapclient = new nusoap_client($wsdl); $header = ""; // including my password and username

$soapclient->call("FindGemeentenResult", array("houseNumberId" => 2306852), "https://grab.beta.agiv.be/Tools/CRABTools.svc", "http://ws.agiv.be/crabtools/ICRABTools/FindGemeentenResult", $header);

but now I get Error: HTTP Error: Unsupported HTTP response status 415 Cannot process the message because the content type 'text/xml; charset=ISO-8859-1' was not the expected type 'text/xml; charset=utf-8'. (soapclient->response has contents of the response)

I'm pretty new to this, any help would be welcome !

+1  A: 

You need to set the SOAP client encoding to be utf-8 rather than the default ISO-8859-1 before you call the method on the server.

e.g.

$soapclient = new nusoap_client(...);

$soapclient->soap_defencoding = 'UTF-8';

$soapclient->call(...);

IanD