Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.php > #13289 > unrolled thread

PHP SoapClient?

Started byKevin Burton <ronald.kevin.burton@gmail.com>
First post2014-03-29 19:40 -0700
Last post2014-05-28 08:48 -0700
Articles 4 — 3 participants

Back to article view | Back to comp.lang.php


Contents

  PHP SoapClient? Kevin Burton <ronald.kevin.burton@gmail.com> - 2014-03-29 19:40 -0700
    Re: PHP SoapClient? "J.O. Aho" <user@example.net> - 2014-03-30 09:41 +0200
    Re: PHP SoapClient? Kevin Burton <ronald.kevin.burton@gmail.com> - 2014-03-30 06:35 -0700
    Re: PHP SoapClient? white.joseph78@gmail.com - 2014-05-28 08:48 -0700

#13289 — PHP SoapClient?

FromKevin Burton <ronald.kevin.burton@gmail.com>
Date2014-03-29 19:40 -0700
SubjectPHP SoapClient?
Message-ID<b9355355-34ac-4b0d-8b35-5b6c6a84cba2@googlegroups.com>
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.

[toc] | [next] | [standalone]


#13290

From"J.O. Aho" <user@example.net>
Date2014-03-30 09:41 +0200
Message-ID<bpq065Fjh0nU1@mid.individual.net>
In reply to#13289
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

[toc] | [prev] | [next] | [standalone]


#13291

FromKevin Burton <ronald.kevin.burton@gmail.com>
Date2014-03-30 06:35 -0700
Message-ID<f1a386b3-d4dc-442d-beb0-352df012dfea@googlegroups.com>
In reply to#13289
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.

[toc] | [prev] | [next] | [standalone]


#13762

Fromwhite.joseph78@gmail.com
Date2014-05-28 08:48 -0700
Message-ID<13f1ef7b-eb80-4cc5-b4f5-eaf308897234@googlegroups.com>
In reply to#13289
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.

[toc] | [prev] | [standalone]


Back to top | Article view | comp.lang.php


csiph-web