带有 ASIHTTPREQUEST 的 SOAP Web 服务
我正在尝试使用 ASIHTTPREQUEST 实现我的肥皂网络服务,但遇到一些错误。
这是我的代码。
[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];
我面临这个错误,
The server cannot service the request because the media type is unsupported.
我对此进行了一些谷歌搜索,发现“Content-Type”存在一些问题。我对此不太确定。
我尝试了这个和许多其他选项,但它给了我“错误请求”作为响应字符串。
[request addRequestHeader:@"Content-Type" value:@"text/xml; charset=utf-8"];
如果您对此有任何解决方案,请告诉我。
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.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
试试这个:
希望它有效!
Try this:
Hope it works!