KSOAP parameter problem - GlobalWeather service
"Leos Urban" <[email protected]> Wed, 10 Dec 2003 09:53:54 +0100
| Newsgroups | gmane.comp.java.enhydra.ksoap |
|---|---|
| Message-ID | <000501c3befb$289ef280$0100a8c0@acer> |
Hello,
please help me. I am new to KSOAP community, I do not have many experiences
with SOAP at all.
Now I test some SOAP services, many of them succesfully, but this one fail
with "expects parameter'@CountryName".
I mean that I send parameter correctly.
The WSDL is at http://www.webservicex.net/globalweather.asmx?WSDL .
Thank you very much.
Leos
Code:
public void readWeather(String country, String city)
{
HttpTransportSE transport = null;
try
{
SoapObject rpc = new SoapObject
("http://www.webservicex.net/globalweather.asmx", "GetWeather");
rpc.addProperty( "CountryName", country);
rpc.addProperty( "CityName", city);
transport = new
HttpTransportSE("http://www.webservicex.net/globalweather.asmx",
"http://www.webserviceX.NET/GetWeather");
transport.debug = true;
SoapObject result = (SoapObject) transport.call (rpc);
for (int i=0; i< result.getPropertyCount(); i++)
t.append( result.getProperty(i).toString() +"\n" );
}
catch (Exception e)
{
t.append( transport.requestDump);
t.append( transport.responseDump);
//e.printStackTrace ();
t.append(e.toString ());
}
}
Sent:
<SOAP-ENV:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
<SOAP-ENV:Body
SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<GetWeather xmlns="http://www.webservicex.net/globalweather.asmx" id="o0"
SOAP-ENC:root="1">
<CountryName xmlns="" xsi:type="xsd:string">Czech Republic</CountryName>
<CityName xmlns="" xsi:type="xsd:string">Prague</CityName>
</GetWeather>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
Received:
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body>
<soap:Fault>
<faultcode>soap:Server</faultcode>
<faultstring>Server was unable to process request. --> Procedure
'getWeather' expects parameter '@CountryName', which was not
supplied.</faultstring>
<detail />
</soap:Fault>
</soap:Body>
</soap:Envelope>
Exception:
SoapFault - faultcode: 'soap:Server' faultstring: 'Server was unable to
process request. --> Procedure 'getWeather' expects parameter
'@CountryName', which was not supplied.' faultactor: 'null' detail: [EndTag
</detail>]