1

I am trying to connect to a Soap server, but there are some issues with the WSDL URI (it's corrupted). Someone has suggested to use the WSDL as a string instead of the URI.

I am developing my Soap Client with PHP. I can't find any documentation explaining how to pass such a string WSDL to SoapClient. How should I proceed? Is it even feasible?

Remark: I have solved my issue with a file URI (which is slightly different than the suggested duplicate question, but we can close it)

Jérôme Verstrynge
  • 57,710
  • 92
  • 283
  • 453
  • What do you mean its corrupted, what error message do you have ? Can you access the wsdl through your browser ? – Elbarto Mar 27 '17 at 14:39
  • 3
    Possible duplicate of [Any workaround to use PHP SoapClient with a local WSDL file (NON-URI)?](http://stackoverflow.com/questions/22157000/any-workaround-to-use-php-soapclient-with-a-local-wsdl-file-non-uri) – Alex Blex Mar 27 '17 at 14:39
  • 1
    I think the suggestion was to use a WSDL stored in a local file (instead of an URI) and not to pass the content of the WSDL to the SOAP client as string. There is nothing special about it, just pass the local path of the WSDL file instead of the remote URL as the first argument to [`SoapClient::__construct()`](http://php.net/manual/en/soapclient.soapclient.php). You must have a valid WSDL in the file (you said the remote one is broken). – axiac Mar 27 '17 at 14:43
  • @Elbarto: It contains a URL with a domain name that is unknown by DNS servers. I was advised to use ?singlewsdl instead of ?wsdl. It returns a WSDL indeed. – Jérôme Verstrynge Mar 27 '17 at 14:45
  • @axiac: I could try that. – Jérôme Verstrynge Mar 27 '17 at 14:46

1 Answers1

1

I have used a file URI similar to:

file://path/my.wsdl 
Jérôme Verstrynge
  • 57,710
  • 92
  • 283
  • 453