TAGS :Viewed: 21 - Published at: a few seconds ago

[ pysimplesoap - RuntimeError: No scheme given for url ]

My first attempt at using pysimplesoap (and my first attempt at soap) code

from pysimplesoap.client import SoapClient

j_location = 'http://api.jasperwireless.com/ws/schema'
j_xsd = 'http://api.jasperwireless.com/ws/schema/JasperAPI.xsd'
j_echo_wsdl = 'http://api.jasperwireless.com/ws/schema/Echo.wsdl'
j_billing_wsdl = 'http://api.jasperwireless.com/ws/schema/Billing.wsdl'

print 'Creating client'
myclient = SoapClient(wsdl=j_echo_wsdl)
print 'Target Namespace', myclient.namespace

The error RuntimeError: No scheme given for url: JasperAPI.xsd

I'm not sure how I am supposed to resolve this error.

Answer 1


I guess the problem is because "JasperAPI.xsd" is referenced as a local file in the WSDL:

<xs:import namespace="http://api.jasperwireless.com/ws/schema" schemaLocation="JasperAPI.xsd"/>

I'm not entirely sure how schemaLocation is supposed to work. At least some software automatically transforms

schemaLocation="JasperAPI.xsd"

into

schemaLocation="http://api.jasperwireless.com/ws/schema/JasperAPI.xsd"

but at least libxml2 - which is used by most (all?) Python SOAP implementations - does not do this.

As a one-time quick fix you could try putting JasperAPI.xsd in your local working directory.