Search code examples
phpsoapwsdl

Namespace in SOAP / WSDL header?


I think my question is fairly simple but can't really find the answer or even a simple real-life example.

In PHP (or just in SOAP) the class SoapHeader requires the first parameter to be a namespace. But what namespace? What should I put here? As I said - can't find a real-world example.

In this comment: http://www.php.net/manual/en/soapclient.setsoapheaders.php#93460 the person uses a diffirent namespace from the url. Where did he get it from?

I would be grateful for a simple, human-readable explanation.


Solution

  • Open your wsdl by putting "?wsdl" at the end of your webservice url. example: http://wwww.example?wsdl

    Search for targetNamespace or xsd:tns attribute under definitions tag. That will be your namespace.