1

I have an SSL certificate on my site. It was installed by my hosting provider and I have tested that it was installed properly. I'm trying to consume a SOAP web service from mindbodyonline.com/api and I'm getting this message in the response

This method must be accessed via SSL (HTTPS).

I'm using Zend Framework's Soap Client and it has been working for most of the services but this particular one contains credit card information and that's probably why it needs the secure connection. I have been unable to find any information on how to send my SOAP request securely. I am creating the client using the code below.

$client = new Zend_Soap_Client('https://api.mindbodyonline.com/0_5/ClientService.asmx?WSDL', array("soap_version"=>SOAP_1_1));

anybody able to help?

Devin Crossman
  • 7,454
  • 11
  • 64
  • 102
  • If you create a phpinfo file with `` in it, does it show that you have `https` available under `Registered PHP Streams` and/or `ssl/tls` under `Registered Stream Socket Transports`. I wonder if it is falling back to use http because you don't have openssl built into PHP. – drew010 Jun 12 '12 at 18:39
  • Yes I see https, ssl and tls there – Devin Crossman Jun 12 '12 at 18:42
  • Ok, it appears I don't have the SOAP extension installed on my machine, going to add it now and then I can check to see if I get the same error. – drew010 Jun 12 '12 at 18:52
  • thanks! I've been sifting through google results all day – Devin Crossman Jun 12 '12 at 18:58
  • Ok got soap set up; when I made a request, it failed but the failure was on the remote server side so I guess I didn't run into the same issue. Can you post more specific code I can try? I did: `$client = new Zend_Soap_Client('https://api.mindbodyonline.com/0_5/ClientService.asmx?WSDL', array("soap_version"=>SOAP_1_1)); $client->GetClients();` and the result was `Server was unable to process request. ---> System.NullReferenceException: at mb.API._0_5.ClientService.GetClients() in \ClientService.asmx.cs:line 837`. Probably I pass bad data. – drew010 Jun 12 '12 at 19:16
  • yeah you have to pass in some credentials to get it to work.. Do you have mindbody account? otherwise it won't work. – Devin Crossman Jun 12 '12 at 19:19
  • let us [continue this discussion in chat](http://chat.stackoverflow.com/rooms/12456/discussion-between-devin-crossman-and-drew010) – Devin Crossman Jun 12 '12 at 19:19
  • I don't have an account. I just tried the same request using HTTP for the WSDL address and I get the same error so I wonder if the error you are getting was returned by ZF/PHP or by their remote server. I went into the chat room btw, I'll stick around a while. – drew010 Jun 12 '12 at 20:59

1 Answers1

0

The WSDL specifies all endpoints as http not https. So I had to change the endpoint in the Zend_Soap_Client constructor. The Zend_Soap_Client Docs http://framework.zend.com/manual/en/zend.soap.client.html say that the location option doesn't work in WSDL mode but they're wrong. Adding the location option overrides the endpoint specified in the WSDL. I got it to work using this code

$client = new Zend_Soap_Client('https://api.mindbodyonline.com/0_5/ClientService.asmx?WSDL', array("soap_version"=>SOAP_1_1,'location'=>'https://api.mindbodyonline.com/0_5/ClientService.asmx'));

Thanks to drew010 for his help!

Devin Crossman
  • 7,454
  • 11
  • 64
  • 102