调用WCF服务时,出这样的异常“415 Unsupported Media Type”,

Because the WCF soap is v1.1, the http header should be text/xml.

binding.logXMLInOut = YES; can help to debug.

you should modify the file

[request setValue:@"application/soap+xml; charset=utf-8" forHTTPHeaderField:@"Content-Type"];

-------->

[request setValue:@"text/xml; charset=utf-8" forHTTPHeaderField:@"Content-Type"];

if ([urlResponse.MIMEType rangeOfString:@"application/soap+xml"].length == 0)

----------->

if ([urlResponse.MIMEType rangeOfString:@"text/xml"].length == 0)

xmlNsPtr soapEnvelopeNs = xmlNewNs(root, (const xmlChar*)"http://www.w3.org/2003/05/soap-envelope", (const xmlChar*)"soap");

------------->

xmlNsPtr soapEnvelopeNs = xmlNewNs(root, (constxmlChar*)"http://schemas.xmlsoap.org/soap/envelope/", (constxmlChar*)"soap");

WSDL2ObjC Unsupported Media Type的更多相关文章

  1. angularjs - 415 (Unsupported Media Type)

    angularJs+springMVC angular表单提交一个user实体时,报 angularjs - 415 (Unsupported Media Type)错误!! 原因是$http({ u ...

  2. System.Net.WebException : The remote server returned an error: (415) UNSUPPORTED MEDIA TYPE

    I am having problems with a bit of code that accesses a restful web service. Running this code, it e ...

  3. SpringMVC 中HttpMessageConverter简介和Http请求415 Unsupported Media Type的问题

    一.概述: 本文介绍且记录如何解决在SpringMVC 中遇到415 Unsupported Media Type 的问题,并且顺便介绍Spring MVC的HTTP请求信息转换器HttpMessag ...

  4. HTTP请求415错误 – 不支持的媒体类型(Unsupported media type)

    HTTP请求415错误 – 不支持的媒体类型(Unsupported media type) 通常有以下情况: 1:检查你的 http 请求头信息,比如 因为 User-Agent 被服务器设置 拒绝 ...

  5. request 报错The remote server returned an error: (415) Unsupported Media Type.

    开发时遇到个问题,程序访问数据库数据,给服务器发送请求时,老是报错,返回的错误页面是: HTTP Status 415 - Unsupported Media Type type Status rep ...

  6. Unsupported Media Type 415问题解决办法(Ajax)

    场景:Ajax传一个json对象到服务器,让参数自动封装至与json对象匹配的java对象中. 错误类型 错误类型1: "status":415 "error" ...

  7. $.ajax通路RESTful Web Service一个错误:Unsupported Media Type

    最近项目,使用头版jquery ajax访问背景CXF发布时间rest维修,结果遇到了错误"Unsupported Media Type". 公布的服务java代码例如以下: im ...

  8. RestTemplate远程调用POST请求:HTTP 415 Unsupported Media Type

    这是本项目的接口 称为client @POST @Path("/{urlcode}") @Consumes(MediaTypes.JSON_UTF_8) @Produces(Med ...

  9. http请求415错误Unsupported Media Type

    王子乔 每一个认真生活的人,都值得被认真对待 http请求415错误Unsupported Media Type 之前用了封装的ajax,因为请求出了点问题,我试了下jQuery的$.ajax,报出了 ...

随机推荐

  1. struts2--convention-plugin--零配置

    <?xml version="1.0" encoding="UTF-8" ?> <!DOCTYPE struts PUBLIC "- ...

  2. 学Python后到底能干什么?

    Python是一种什么语言? Python是一种计算机程序设计语言.你可能已经听说过很多种流行的编程语言,比如非常难学的C语言,非常流行的Java语言,适合初学者的Basic语言,适合网页编程的Jav ...

  3. 通过Queue的构造函数的可选参数maxsize来设定队列长度

    创建一个"队列"对象 import Queuemyqueue = Queue.Queue(maxsize = 10) Queue.Queue类即是一个队列的同步实现.队列长度可为无 ...

  4. openfire配置MSSQL说明(数据库设置)

    1.进入“SQL Server 配置管理器(SQL Server Configuration Manager)”,在左边窗口选择“SQL Server 2005网络配置”下面的分支“MSSQLServ ...

  5. NULL-safe equal

    http://dev.mysql.com/doc/refman/5.7/en/comparison-operators.html#operator_equal-to ,=NULL,NULL=NULL; ...

  6. IIS不能对网站添加默认文档(由于权限不足而无法写入配置文件)

    IIS7以上版本配置网站时需要手动配置网站目录的文件夹权限 增加"IIS_IUSER"用户的修改权限 但增加后仍然提示“ 由于权限不足无法写入配置文件” 通常是Web.config ...

  7. J-LINK V8固件烧录指导

    1 J-LINK V8固件烧录指导 J-LINK 是使用过程中,如果内部固件意外损坏或丢失,请参考下面操作步骤说明,重新烧录JLINK固件. 1.1 安装固件烧录软件 请ATMEL官方网址下载AT91 ...

  8. C语言 ---- 数组 iOS学习-----细碎知识点总结

    #pragma mark - 数组:用来存放同一数据类型的数据 // 数组的定义:类型说明符 数组名[常量表达式] = {值1, 值2, 值3...};    // 定义一个float类型的数组,用来 ...

  9. tomcat的maxThreads、acceptCount(最大线程数、最大排队数)

    转载:http://blog.sina.com.cn/s/blog_605f5b4f01012ljj.html tomcat 的Connector配置如下 <Connector port=&qu ...

  10. 动画 CABasicAnimation animationWithKeyPath 一些规定的值

    CABasicAnimation animationWithKeyPath Types When using the ‘CABasicAnimation’ from the QuartzCore Fr ...