user985366
user985366

Reputation: 1699

Modify PHP SoapClient to use https rather than http for getting xsd schema

I'm using SoapClient to connect to a WSDL service, and the schemaLocation in the WSDL is wrongly set with a http:// address which I think should be a https:// address.

SOAP-ERROR: Parsing Schema: can't import schema from 'http://...

I can fetch the schema with curl using https://

I cannot modify the wsdl, so I'm trying to figure out if I can make SoapClient call https:// instead when fetching the schema, to see if this solves the problem.

Any suggestions?

Upvotes: 1

Views: 1094

Answers (1)

Grzegorz Adam Kowalski
Grzegorz Adam Kowalski

Reputation: 5565

This is not uncommon to have to change wrong values in WSDL files (unfortunately). The way to this is by deriving new classes from SoapClient and overloading its methods. In your case make new class and fix WSDL in its constructor: download WSDL file, change http to https in proper places and pass it to base SoapClient constructor.

Upvotes: 1

Related Questions