shiroming / wsdl2objc

Automatically exported from code.google.com/p/wsdl2objc
MIT License
0 stars 0 forks source link

error 415 in ios wsdl #197

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. i can not get response
2. i get all user
3.

What is the expected output?
get all user

What do you see instead?
error unsupported media

What version of the product are you using? On what operating system?
ios 6 xcode 4.5.1

Please provide any additional information below.

Original issue reported on code.google.com by mnvekar...@gmail.com on 1 Feb 2013 at 1:18

Attachments:

GoogleCodeExporter commented 8 years ago
Hi,
any luck with this problem. I am also having same error.
Error Domain=BasicHttpBinding_IABCBindingResponseHTTP Code=415 "unsupported 
media type" UserInfo=0x7362210 {NSLocalizedDescription=unsupported media type}

I tried following the chat conversation from mja and wesso.
http://chat.stackoverflow.com/rooms/3618/discussion-between-mja-and-wesso
But couldnt fix it. 

Any kind of help would be appreciated. 
thanks

Original comment by neokar2...@gmail.com on 21 Feb 2013 at 10:27

GoogleCodeExporter commented 8 years ago
Hi,

For those who might run into this issue in the future. What I had to do was 
change the following URL in the <WebServiceName>.m file 

http://schemas.xmlsoap.org/soap/

To 

http://schemas.xmlsoap.org/soap/envelope/

Which makes it a valid request. THe only way I found this was by running my 
SOAP XML in SoapUI.

Also you need to change Application/Soap+xml to text/XML

The final change I had to make was to remove the if statement that looks like 
the following

if([urlResponse.Mimetype rangeofString:@"application/soap+xml"].length == 0)
{
  .....
}

Remove that entire if statement cause otherwise it says your code is incorrect.

After the above change you should get a 200 response back from the server. Then 
every one is happy.

Hope someone out there finds this usefull.

Original comment by fahad....@gmail.com on 26 Sep 2013 at 5:26

GoogleCodeExporter commented 8 years ago
I'm creating a WCF web service that I eventually run in a windows service (not 
in IIS.) 
I found that the code generated by wsdl2objc was different depending on how my 
service was being hosted at the time the wsdl was parsed. If the service was 
being hosted in the WCF Test Client, the code was generated with content-type 
set to "text/xml". This version of the code worked when I ran it calling the 
actual service. If the service was being hosted in the windows service (via 
ServiceHost,) the code was generated with content-type set to 
"application/soap+xml". This code when then get the 415 errors reported above.

Original comment by gstrob...@gmail.com on 30 Oct 2013 at 12:47