Good morning,
I have an error when intent connect from my Sony Ericsson w300i to an .Net 2005 (asp.net 2.0) webservice:
expected: START_TAG {http://schemas.xmlsoap.org/soap/envelope/} Envelope(positions:START_TAG<h1>@1:4 in java.IO.InputStreamReader@23456
The ws receive a
String and return a String.
My application use Ksoap2 (core) library. I
test the same application in the wireless toolkit 2.5.1
emulator, in a Nokia 6131 and in a Motorola rockr W5, working properly in all. The code I use to connect is:
SoapObject request = new SoapObject(NAMESPACE, "getResultados");
SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11);
envelope.dotNet = true;
envelope.setOutputSoapObject(request);
request.addProperty("pregunta","unapreguntacualquiera");
HttpTransport ht = new HttpTransport(URL);
try
{
ht.call(NAMESPACE + "getResultados", envelope);
SoapObject result = (SoapObject) envelope.bodyIn;
String respuesta = result.getProperty(0).toString();
...
Also I tried with some extra lines:
envelope.encodingStyle = SoapSerializationEnvelope.ENC;
or with:
ht.setXmlVersionTag("<?xml version=\"1.0\" encoding=\"UTF-8\"?>");
but not change the result.
Also I monitored the network trafic (when use the emulator) obtaining:
Output (from emulator to ws):
<v:Envelope xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns:d="http://www.w3.org/2001/XMLSchema" xmlns:c="http://schemas.xmlsoap.org/soap/encoding/" xmlns:v="http://schemas.xmlsoap.org/soap/envelope/">
<v:Header />
<v:Body>
<getResultados xmlns="http://unaempresa.com/" id="o0" c:root="1">
<pregunta i:type="d:string">unapreguntacualquiera</pregunta>
</getResultados>
</v:Body>
</v:Envelope>
Response (from ws to emulator):
HTTP/1.1 200 OK..Server: Microsoft-IIS/5.1..Date: Wed, 19 Aug 2009 13:42:03 GMT..X-Powered-By: ASP.NET..X-AspNet-Version: 2.0.50727..Cache-Control: private, max-age=0..Content-Type: text/xml; charset=utf-8..Content-Length: 442....<?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>
<getResultadosResponse xmlns="http://unaempresa.com/">
<getResultadosResult>unarespuestacualquiera</getResultadosResult>
</getResultadosResponse>
</soap:Body>
</soap:Envelope>
I see all ok... and in the other devices func. Ok...
Thank you for your time!
regards.
excuse me for my poor english.