FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » Imported messages » comp.lang.php » PHP SoapClient?
Show: Today's Messages :: Polls :: Message Navigator
Switch to threaded view of this topic Create a new topic Submit Reply
PHP SoapClient? [message #185418] Sun, 30 March 2014 02:40 Go to next message
Kevin Burton is currently offline  Kevin Burton
Messages: 9
Registered: March 2014
Karma: 0
Junior Member
I pass the following options to the SoapClient (attempting to establish an SSL connection):

$ssl_opts = array('local_cert' => $certinfo,
'verify_peer' => true);

Then merge them in with the other SoapClient parameters like 'typemap' and 'classmap'. This gives me the error that the WSDL cannot be loaded from the path. If I take this same path and feed it to a Chrome browser I get a WSDL, so the file is getting served. Also when I supply a non SSL URL (http://.. . . . . rather than https://. . . . .) to the SoapClient constructor without the SSL options everything works fine. Any ideas what will work to connect to an SSL site?

I am using PHP 5.5.10 with SOAP and OpenSSL extensions enabled.

Thank you for any help you may be able to offer.
Re: PHP SoapClient? [message #185419 is a reply to message #185418] Sun, 30 March 2014 07:41 Go to previous messageGo to next message
J.O. Aho is currently offline  J.O. Aho
Messages: 194
Registered: September 2010
Karma: 0
Senior Member
On 30/03/14 04:40, Kevin Burton wrote:
> I pass the following options to the SoapClient (attempting to establish an SSL connection):
>
> $ssl_opts = array('local_cert' => $certinfo,
> 'verify_peer' => true);
>
> Then merge them in with the other SoapClient parameters like 'typemap' and 'classmap'.
> This gives me the error that the WSDL cannot be loaded from the path.
> If I take this same path and feed it to a Chrome browser I get a
WSDL, so the file is getting served.
> Also when I supply a non SSL URL (http://. . . . . rather than https://. . . . .) to the SoapClient
> constructor without the SSL options everything works fine. Any ideas what will work to connect to an SSL site?

This looks like issues to verify the certificate. It's easier if you
would check the error message to really see what is wrong, at least add
something like in the examples in:

http://www.php.net/manual/en/function.is-soap-fault.php

but things to start with:

Is the certificate self signed?

Then you need to set the allow_self_signed

also, do you cafile set?

You may need to download one. http://curl.haxx.se/ca/cacert.pem could
work (seen some people use it, but can't say if it's up to date).


--

//Aho
Re: PHP SoapClient? [message #185421 is a reply to message #185418] Sun, 30 March 2014 13:35 Go to previous messageGo to next message
Kevin Burton is currently offline  Kevin Burton
Messages: 9
Registered: March 2014
Karma: 0
Junior Member
On Saturday, March 29, 2014 9:40:53 PM UTC-5, Kevin Burton wrote:
> I pass the following options to the SoapClient (attempting to establish an SSL connection):
>
>
>
> $ssl_opts = array('local_cert' => $certinfo,
>
> 'verify_peer' => true);
>
>
>
> Then merge them in with the other SoapClient parameters like 'typemap' and 'classmap'. This gives me the error that the WSDL cannot be loaded from the path. If I take this same path and feed it to a Chrome browser I get a WSDL, so the file is getting served. Also when I supply a non SSL URL (http://. . . . . rather than https://. . . . .) to the SoapClient constructor without the SSL options everything works fine. Any ideas what will work to connect to an SSL site?
>
>
>
> I am using PHP 5.5.10 with SOAP and OpenSSL extensions enabled.
>
>
>
> Thank you for any help you may be able to offer.

Thank you for your help. I added the allow_self_signed => true because it is a self-signed certificate. But I get the same exception:

Exception - SOAP-ERROR: Parsing WSDL: Couldn't load from '(url)?WSDL' : failed to load external entity "(url)?WSDL"

I am catching the exception thrown which as I read the documentation is essentially the same as is_soap_fault.

If I don't pass any SSL arguments I get a SOAP Fault that I have passed invalid SOAP arguments. I am just trying to connect to an SSL endpoint. This seems to work when I use curl but these options don't seem to work using SoapClient.

Thanks again.
Re: PHP SoapClient? [message #186003 is a reply to message #185418] Wed, 28 May 2014 15:48 Go to previous message
white.joseph78 is currently offline  white.joseph78
Messages: 1
Registered: May 2014
Karma: 0
Junior Member
I ran into a similar problem and here is how I fixed it.
$soapclient_options['local_cert'] = PEM_LOCATION;
$soapclient_options['passphrase'] = PEM_PASS;

I never included the PEM passphrase in my initial calls. once I did that it worked like a charm.
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Add compiler to Page
Next Topic: Re: mysqli fetch_assoc() straight to array (-> comp.lang.php)
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Sat Nov 30 17:16:53 GMT 2024

Total time taken to generate the page: 0.01999 seconds