Question

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 = "<o:Security s:mus... ../>"; // 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!

Was it helpful?

Solution

/**
* charset encoding for outgoing messages
*
* @var      string
* @access   public
*/
  var $soap_defencoding = 'UTF-8';
 //var $soap_defencoding = 'ISO-8859-1';

OTHER TIPS

You need to set the SOAP client encoding to 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(...);
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top