rafi73 / ksoap2-android

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

Content-Type in SOAP 1.2 #84

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Trying to call a SOAP 1.2 host
2.
3.

What is the expected output? What do you see instead?
I want to get an OK response but instead I get this: HTTP/1.1 415 Cannot 
process the message because the content type 'text/xml' was not the expected 
type 'application/soap+xml; charset=utf-8'.\\r\\n

What version of the product are you using? On what operating system?
2.5.7, Windows 7

Please provide any additional information below.
I've investigated the code and the Content-Type field is set to 'text/xml', 
even though it should be set to 'application/soap+xml' when using SOAP 1.2. 

Proposed fix:
Line 133 in HttpTransportSE: 
connection.setRequestProperty("Content-Type", "text/xml");

This should instead be:

if (envelope.version == SoapSerializationEnvelope.VER12) {
connection.setRequestProperty("Content-Type", "application/soap+xml");
}
else {
connection.setRequestProperty("Content-Type", "text/xml");
}

Original issue reported on code.google.com by elias.ny...@gmail.com on 22 Sep 2011 at 2:19

GoogleCodeExporter commented 9 years ago
Try the latest snapshot in github. If it works for you I can cut a 2.5.9 
release or so.

Original comment by mosa...@gmail.com on 26 Sep 2011 at 7:17

GoogleCodeExporter commented 9 years ago
It works. :)

Original comment by elias.ny...@gmail.com on 27 Sep 2011 at 7:01

GoogleCodeExporter commented 9 years ago
I think I have the same problem in my Android application. Is there a jar file 
available that contains this fix?

Original comment by bartvand...@gmail.com on 17 Nov 2011 at 3:07

GoogleCodeExporter commented 9 years ago
No... but I can cut a release later today if you can wait.

Original comment by mosa...@gmail.com on 17 Nov 2011 at 5:06

GoogleCodeExporter commented 9 years ago
Thanks, that would be great.

Original comment by bartvand...@gmail.com on 17 Nov 2011 at 5:59

GoogleCodeExporter commented 9 years ago
Will go out with the 2.5.9 release.

Original comment by mosa...@gmail.com on 18 Nov 2011 at 4:32