调用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. Orale介绍

    Oracle数据库: 是甲骨文公司的一款关系数据库管理系统 具有网格计算的框架 数据量大,并发操作比较多,实时性要求高,采取ORACLE数据库 Oracle数据库的体系结构包括物理存储结构和逻辑存储结 ...

  2. 关于UGUI Image Sliced模式的一个BUG。

    Unity4.6.2f1 在Android/IOS平台下,Image选择Sliced模式,并且对Sprite设置好Border后,会发现并没有按照预计的 情况进行拉伸. 搜了一下是因为Sprite的G ...

  3. 点击某个按钮弹出 photoswip

    var openPhotoSwipe = function() { var pswpElement = document.querySelectorAll('.pswp')[0]; // build ...

  4. 用Scala实现集合中相邻元素间的差值

    欢迎转载,转载请注明出处,徽沪一郎. 概要 代码这东西,不写肯定不行,新学Scala不久,将实际遇到的一些问题记录下来,日后也好查找. 今天讲的是如何计算同一集合中元素两两之间的差值,即求开始集合(a ...

  5. ThinkPHP 3.2.3 关联模型的使用

    关于关联模型 ThinkPHP 3.2.3 的关联模型(手册地址)一般处理关联数据表的 CURD 操作,例如关联读取.关联写入.关联删除等. 实例 博客管理模块关于博客有 4 张数据表:博客表 crm ...

  6. 预防 Session 劫持与 Session 固定攻击

    一.预防 Session 劫持 要求: ① 只允许通过 Cookie 来传递 SessionID ② 生成一个由 URL 传递的唯一标识作为 Session 的标记(token) 当请求同时包含有效的 ...

  7. javascript大神修炼记(7)——OOP思想(多态)

    读者朋友们大家好,今天我们就接着前面的内容讲,前面我们已经讲到了继承,今天我们就来讲OOP目前最后一个体现,那就是多态,因为javascript语言的灵活性,所以我们是没有办法使用接口的,所以这也给j ...

  8. 使用TarOutputStream出现 request to write '1024' bytes exceeds size in header错误的解决方法

    因为测试流程中,所测客户端会根据服务器A返回的response决定发送给服务器B的请求里各参数的值,所以现在需要模拟服务器的响应.而这个项目服务器A的响应式返回一个流,一个GZIP压缩格式流,压缩的是 ...

  9. 加载UI

    weak情况 1 2 3 4 @property (weak,nonatomic) UILabel *nameLabel;   UILabel *nameLabel = [[UILabel alloc ...

  10. [BS-28] iOS中分页的几种算法

    iOS中分页的几种算法 总记录数:totalRecord 每页最大记录数:maxResult 算法一: totalPage = totalRecord % maxResult == 0 ? total ...