Open GoogleCodeExporter opened 9 years ago
can you provide your code that you send a xml string to webservice ??
My code is send xml string to web service success , nothing problem .
Original comment by tauit.d...@gmail.com
on 2 Nov 2011 at 10:07
Yes sure.
SoapObject Request = new SoapObject(NAMESPACE, METHOD_NAME);
PropertyInfo RequestProp = new PropertyInfo();
RequestProp.setName("RequestXml");
String requestContent = "<request type=\""+this.getRequestTypeToString()+"\"
xmlns=\"\">"+this.RequestContent+"</request>";
RequestProp.setValue(requestContent);
Request.addProperty(RequestProp);
SoapSerializationEnvelope envelope = new
SoapSerializationEnvelope(SoapEnvelope.VER11);
envelope.dotNet = true;
envelope.setAddAdornments(false);
envelope.setOutputSoapObject(Request);
HttpTransportSE androidHttpTransport = new HttpTransportSE(URL);
androidHttpTransport.debug = true;
androidHttpTransport.setXmlVersionTag("<?xml version=\"1.0\"
encoding=\"utf-8\"?>");
try {
androidHttpTransport.call(SOAP_ACTION, envelope);
Log.e("Soap error, request ",androidHttpTransport.requestDump);
Log.e("Soap error, response ",androidHttpTransport.responseDump);
} catch (Exception e) {
e.printStackTrace();
Log.e("SoapError",e.getLocalizedMessage());
}
The requestDump writes out ">request type=\"start\" xmlns=\"\"><display
height=\"800\" width=\"480\" ppi=\"240\" /></request>" which is correct, but
the webservice returns with an error. If I send a self gererated soap message
to the server and avoid the html encoding it works fine. If I use the encoding
it fails.
Hope you can help.
Original comment by mortenah...@gmail.com
on 2 Nov 2011 at 10:16
The error from responseDump is:
System.Web.Services.Protocols.SoapException: Server was unable to read request.
---> System.InvalidOperationException: There is an error in XML document (1,
475). ---> System.InvalidOperationException: The specified node cannot be
inserted as the valid child of this node, because the specified node is the
wrong type.
Original comment by mortenah...@gmail.com
on 2 Nov 2011 at 11:38
I test with my webservice , it's correctly.
are you sure that you pass agrument for RequestXml method is correct?
P/S: Mywwebservice in php , so that, it may be diffirent from your.
Original comment by tauit.d...@gmail.com
on 2 Nov 2011 at 12:11
The problem is that my webservice expects an xmldocument, and a html encoded
string is apparently not recognized as such. It works if i change the method to
receive a string and convert the string into an xml document in the method.
However, my iPhone equivalent sends it as an xmldocument, and does not allow me
to specify the type to send to be a string. So it is recognized as a
xmldocument by the service, and a string does not work.
Original comment by mortenah...@gmail.com
on 2 Nov 2011 at 12:23
[deleted comment]
RequestXML receive a agrument as XmlDocument , but you send a html encode
string--> error
You can change RequestXml have prototype like this : RequestXml ( string s)
You can read xml Document to string, and send it to wwebservice
Original comment by tauit.d...@gmail.com
on 2 Nov 2011 at 1:05
So is this actually an issue and you could provide a fix or is this just a
problem with your implementation then?
Original comment by mosa...@gmail.com
on 8 Dec 2011 at 5:30
Is it solved? I have the same problem. I've debuged code and i think that
problem is in a method createRequestData.
byte[] requestData = createRequestData(envelope);
After calling createRequestData, byte[] contains encoded html.
Original comment by rumaczy...@gmail.com
on 25 Jul 2012 at 9:35
Ping.. is this actually still an issue with 3.0.0-RC.4
Original comment by mosa...@gmail.com
on 12 Nov 2012 at 6:31
Hi, I've just tested and this problem happens on 3.0.0-RC.4.
Do you think there's a workaround or some quick fix to it?
Debugging I've reach the same point as mentioned in previously message, after
byte[] requestData = createRequestData(envelope);
the xml content of any parameter is html enconded.
Thanks
Original comment by marcelo....@gmail.com
on 22 Nov 2012 at 7:11
[deleted comment]
Anybody knows if this was fixed on the new 3.1.1?
Any other workaround?
Thanks
Original comment by omiate...@gmail.com
on 15 Jan 2014 at 7:57
Maybe this helps:
http://stackoverflow.com/questions/27164419/passing-xmldataset-as-parameter-ksoa
p2-android
Original comment by kewl...@gmail.com
on 22 Jan 2015 at 2:34
Original issue reported on code.google.com by
mortenah...@gmail.com
on 2 Nov 2011 at 8:24