eslamabdalgwadmohamed / ksoap2-android

Automatically exported from code.google.com/p/ksoap2-android
0 stars 0 forks source link

xmlnullparserexeption #36

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
The code is the following

String url = xxxxxxxxxxxxxxxxxxxxxxxxxx;
String namespace = xxxxxxxxxxxxxxxxxxxx;
String metod = "uploadContentById";
String soap_action = url + metodo;

SoapObject solicitud = new SoapObject(namespace, metodo);
int id =9;
solicitud.addProperty("id",id);
solicitud.addProperty("data",printMe);
SoapSerializationEnvelope envoltorio = new 
SoapSerializationEnvelope(SoapEnvelope.VER12);
envoltorio.dotNet = false;
envoltorio.setOutputSoapObject(solicitud);
HttpTransportSE transportHttp = new HttpTransportSE(url);
try{
transportHttp.call(soap_action, envoltorio);
String cadenaDevuelta = envoltorio.getResponse().toString();
}
catch(Exception e){System.out.println("La excepcion producida es 
"+e.toString());
                    }

What is the expected output? What do you see instead?
The output is supposed to be a boolean true or false in which it is said that 
the content of the file has been uploaded or not successfully.

Instead , I have the following exception :

11-09 15:41:07.957: INFO/System.out(748): La excepcion producida es 
org.xmlpull.v1.XmlPullParserException: expected: START_TAG 
{http://www.w3.org/2001/12/soap-envelope}Envelope (position:START_TAG 
<{http://www.w3.org/2003/05/soap-envelope}env:Envelope>@2:67 in 
java.io.InputStreamReader@435a2df8) 

I have looked for this problem in internet but most of people have the same 
problem . Is this a ksoap2 bug ?
I have tried to debug this code and the xml is well made .
What is the really problem ?
Thanks
GOrka

Original issue reported on code.google.com by gorka...@hotmail.com on 9 Nov 2010 at 5:49

GoogleCodeExporter commented 8 years ago
Without debugging I cant tell. Can you set debug to true on the transport and 
see what bodyIn contains? I believe it might be empty .. which means that your 
server has not yet responded. This sometimes happens on the emulator. Does it 
happen on the device as well? Also what happens if you retry in code 
automatically? 

Original comment by mosa...@gmail.com on 9 Nov 2010 at 7:30

GoogleCodeExporter commented 8 years ago
Hello I have only tried it on the emulator.
File1.txt contains the body of the first post response , after adding these two 
lines to the java program : 
transportHttp.debug=true;

System.out.println("** STRING OBTAINED **" + transportHttp.requestDump );

File2.txt contains other example of a webservice client in which the same 
webservice has been used. In File2.txt there is the code used and the result of 
debugging this code.

Original comment by gorka...@hotmail.com on 10 Nov 2010 at 9:45

Attachments:

GoogleCodeExporter commented 8 years ago
hi,

i have the same problem when i call web service wsdl from blackberry project. 
but when i call ant .net web service it's works fine

Original comment by vodafone...@gmail.com on 10 Nov 2010 at 1:20

GoogleCodeExporter commented 8 years ago
@vodfonebetavine .. I have no idea about blackberry.. 

Original comment by mosa...@gmail.com on 12 Nov 2010 at 4:51

GoogleCodeExporter commented 8 years ago
@gorka_sm .. it seem you are trying to upload a binary file as a property in 
the soap request. I have no idea if this is going to work but would definitely 
be worried about file size and other things like time outs. 

You will have to debug this with the library code I think and see what is 
happening. Have you tried to submit something to the webservice that is just a 
very small payload?

Original comment by mosa...@gmail.com on 12 Nov 2010 at 4:53

GoogleCodeExporter commented 8 years ago

Original comment by mosa...@gmail.com on 23 Mar 2011 at 6:35

GoogleCodeExporter commented 8 years ago
Closing due to inactivity from reporter.

Original comment by mosa...@gmail.com on 18 Nov 2011 at 5:00