Re: RES: RES: [SOAP] SOAP-ERROR: Couldn't Load from external entity(Whereendpoint resolves to another location)
[email protected] (fruitmixer) Tue, 02 Jul 2013 10:43:32 +1000
| Newsgroups | php.soap |
|---|---|
| Message-ID | <[email protected]> |
Hi Gerson,
Yeahp, I'm using SOAP with https but I've omitted the certificates for
brevity.
There is no issue with authentication, because passing the following URL
(the resolved address) works:
https://provider.web-service.domain/path/ServiceName/another/diff/path/prefix_ServiceName.wsdl
That is, it doesn't have path issues because the import file is in the
same dir:
https://provider.web-service.domain/path/ServiceName/another/diff/path/ServiceName.wsdl
Again, this doesn't work:
https://provider.web-service.domain/path/ServiceName?wsdl
- superspace
On 01/07/13 21:39, Gerson Czelusniak Junior wrote:
> Hi,
>
> I saw that you are using SOAP with https, this mean you need SSL enabled.
> Your server that have the WebService need authenticate?
> Port in firewall is enable?
> You will need to have OpenSSL enabled in PHP to be able to retrieve content over https.
> Look for the openssl section in your phpinfo().
>
> "OpenSSL support => enabled
> OpenSSL Library Version => OpenSSL 0.9.8k 25 Mar 2009
> OpenSSL Header Version => OpenSSL 0.9.8k 25 Mar 2009"
>
> -----Mensagem original-----
> De: fruitmixer [mailto:[email protected]]
> Enviada em: domingo, 30 de junho de 2013 22:31
> Para: [email protected]
> Assunto: Re: RES: [SOAP] SOAP-ERROR: Couldn't Load from external entity (Whereendpoint resolves to another location)
>
> Sorry that does not help.
>
> To iterate, when instantiating the client:
>
> $wsdl = 'https://provider.web-service.domain/path/ServiceName?wsdl';
> $client = new SoapClient($wsdl);
>
> I get the following error:
>
> PHP Fatal error: SOAP-ERROR: Parsing WSDL: Couldn't load from 'https://provider.web-service.domain/path/ServiceName.wsdl' :failed to load external entity "https://provider.web-service.domain/path/ServiceName.wsdl"
>
>
> - superspace
>
>
>
> On 28/06/13 21:35, Gerson Czelusniak Junior wrote:
>> Hi,
>>
>> When i call SOAP WebService created with .NET APP using SoapClient PHP the code stay like this:
>>
>> ini_set('display_errors', true);
>> ini_set("soap.wsdl_cache_enabled", "0");
>> error_reporting(E_ALL);
>> $url = "servidor/WebService.asmx?WSDL";
>> $soap = new soapClient($url, array('encoding'=>'UTF-8'));
>> $param = $_POST['param'];
>> $return = $soap->MethodFromWebService(array("param" => $param));
>> Maybe that can help you.
>>
>> -----Mensagem original-----
>> De: superpspace [mailto:[email protected]] Enviada em:
>> quinta-feira, 27 de junho de 2013 21:57
>> Para: [email protected]
>> Assunto: RES: [SOAP] SOAP-ERROR: Couldn't Load from external entity
>> (Where endpoint resolves to another location)
>>
>> 1. I believe the webservice is a .NET APP.
>> 2. When requesting the WSDL from the browser I can see the XML.
>> But since the XML is not trying to import the secondary WSDL, there is no errors/issues.
>>
>> "Gerson Czelusniak Junior" wrote in message news:80940D84E43C0C45AA2C4A9B432B675A19D03520@SN2PRD0202MB120.namprd02.prod.outlook.com...
>>
>> Good Morning,
>>
>> Your webservice is in .NET APP or in PHP?
>> When you call the WSDL from Browser you can see the xml?
>>
>>
>> -----Mensagem original-----
>> De: superpspace [mailto:[email protected]] Enviada em:
>> terça-feira, 25 de junho de 2013 22:23
>> Para: [email protected]
>> Assunto: [SOAP] SOAP-ERROR: Couldn't Load from external entity (Where
>> endpoint resolves to another location)
>>
>> Hello everyone,
>>
>> I have a WSDL in the following URL format (obscured):
>>
>> https://provider.web-service.domain/path/ServiceName?wsdl
>>
>> that resolves to:
>>
>>
>> https://provider.web-service.domain/path/ServiceName/another/diff/path
>> /prefix_ServiceName.wsdl
>>
>> The WSDL has a line like this:
>>
>> <wsdl:import namespace="http://name/space/service/"
>> location="ServiceName.wsdl"></wsdl:import>
>>
>> When loading the former URL into SoapClient, it complains like so:
>>
>> PHP Fatal error: SOAP-ERROR: Parsing WSDL:
>> Couldn't load from
>> 'https://provider.web-service.domain/path/ServiceName.wsdl' :
>> failed to load external entity
>> "https://provider.web-service.domain/path/ServiceName.wsdl"
>>
>> The reason i believe this happens is because it's trying to look for
>> ServiceName.wsdl at the original location,
>>
>> ie. It is looking here:
>>
>> https://provider.web-service.domain/path/ServiceName.wsdl
>>
>> instead of the final resolved location, here:
>>
>>
>> https://provider.web-service.domain/path/ServiceName/another/diff/path
>> /ServiceName.wsdl
>>
>> As expected, if i pass the resolved URL into SoapClient, it works.
>>
>> This is not ideal because the resolved address can potentially change at any time.
>>
>> Is this a problem with SoapClient that can *and* need to be resolved?
>>
>> Your thoughts. Thanks
>>
>> superspace
>>
>>
>>
>> The question on stackoverflow is here:
>>
>>
>> http://stackoverflow.com/questions/17226451/php-soapclient-couldnt-loa
>> d-from-external-entity-where-endpoint-resolves-to-a
>>
>> --
>> PHP Soap Mailing List (http://www.php.net/) To unsubscribe, visit:
>> http://www.php.net/unsub.php
>>
>>
>>
>> --
>> PHP Soap Mailing List (http://www.php.net/) To unsubscribe, visit:
>> http://www.php.net/unsub.php
>>
>>
>>
>
> --
> PHP Soap Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
>
>
>