soap webservice with ASIHTTPREQUEST
I am trying to implement my soap web services with ASIHTTPREQUEST and i am facing some error.
Here is my code.
[request addRequestHeader:@"Content-Type" value:@"application/xml; charset=utf-8"];
[request addRequestHeader:@"SOAPAction" value:[xmlnsString stringByAppendingString:@"GetDetail"]];
[request addRequestHeader:开发者_如何转开发@"Content-Length" value:msgLength];
[request setRequestMethod:@"POST"];
[request appendPostData: [yourPOSTstring dataUsingEncoding:NSUTF8StringEncoding]];
[request setDefaultResponseEncoding:NSUTF8StringEncoding];
and i am facing this error
The server cannot service the request because the media type is unsupported.
i have done some googling on this and found that there is some problem with "Content-Type". i am not sure about that.
i tried this and many other option but its gives me "Bad Request" as a response string.
[request addRequestHeader:@"Content-Type" value:@"text/xml; charset=utf-8"];
let me know if you have nay solution for this.
Try this:
[request addRequestHeader:@"Content-Type" value:@"application/soap+xml; charset=utf-8"];
Hope it works!
精彩评论