I am trying to connect to an example soap server at http://www.webservicex.net/ using the following MATLAB code:
% createSoapMessage(NAMESPACE,METHOD,VALUES,NAMES,TYPES,STYLE) creates a SOAP message.
% VALUES, NAMES, and TYPES are cell arrays.
m = createSoapMessage('http://www.webserviceX.NET', 'GetCitiesByCountry', ...
{'Australia'}, {'CountryName'}, { '{http://www.w3.org/2001/XMLSchema}string' }, 'rpc')
% callSoapService(ENDPOINT,SOAPACTION,MESSAGE) sends the MESSAGE,
% a Java DOM, to the SOAPACTION service at the ENDPOINT.
response = callSoapService('http://www.webservicex.net/globalweather.asmx?WSDL', ...
'http://www.webserviceX.NET/GetCitiesByCountry', m);
I get the following response (with line endings inserted for viewing):
val =
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope
xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<soap:Body>
<soap:Fault>
<faultcode>soap:Server</faultcode>
<faultstring>System.Web.Services.Protocols.SoapException:
Server was unable to process request.
---> System.Data.SqlClient.SqlException:
Procedure or function 'getWCity' expects parameter '@CountryName',
which was not supplied.
at WebServicex.GlobalWeather.GetCitiesByCountry(String CountryName)
--- End of inner exception stack trace ---
</faultstring><detail />
</soap:Fault>
</soap:Body>
</soap:Envelope>
I know that the server is responding. I can interrogate it with Python and suds like this:
from suds.client import Client
url = 'http://www.webservicex.net/globalweather.asmx?WSDL'
client = Client(url)
result = client.service.GetCitiesByCountry('Australia')
My simple question is what am I doing wrong?
I would also like to know how to view the DOM object that createSoapMessage creates and how to view the xml that MATLAB sends and receives.