NSURL *url = [NSURL URLWithString:@"http://xxx.xxx.com/xxx/xxxxWS?wsdl"];
NSString *soapMsg=[NSString stringWithFormat:
@"<?xml version=\"1.0\" encoding=\"utf-8\"?>"
"<soap:Envelope xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" xmlns:soap=\"http://schemas.xmlsoap.org/soap/envelope/\" xmlns:ns1=\"空间\">"
"<soap:Body>"
"<ns1:某方法>"
"<strUsername>%@</strUsername>"
"<strPassword>%@</strPassword>"
"<strAGName>%@</strAGName>"
"<OperatorName>%@</OperatorName>"
"<OperatorPwd>%@</OperatorPwd>"
"</ns1:某方法>"
"</soap:Body>"
"</soap:Envelope>", @"", @"", @"", @"", @""
]; NSString *space=@"空间";
NSString *methodname=@"某方法";
NSMutableURLRequest *request=[NSMutableURLRequest requestWithURL:url];
NSString *msgLength = [NSString stringWithFormat:@"%lu", (unsigned long)[soapMsg length]];
NSString *soapAction=[NSString stringWithFormat:@"%@%@",space,methodname];
//头部设置
NSDictionary *headField=[NSDictionary dictionaryWithObjectsAndKeys:[url host],@"Host",
@"text/xml; charset=utf-8",@"Content-Type",
msgLength,@"Content-Length",
soapAction,@"SOAPAction",nil];
[request setAllHTTPHeaderFields:headField];
//超时设置
[request setTimeoutInterval: ];
//访问方式
[request setHTTPMethod:@"POST"];
//body内容
[request setHTTPBody:[soapMsg dataUsingEncoding:NSUTF8StringEncoding]];

请求webservice接口的某方法数据的更多相关文章

  1. Kettle通过Http post请求webservice接口以及结果解析处理

    kettle中有两种方式请求webservice服务,一个是Web服务查询,但是这个有缺陷,无法处理复杂的需求,遇到这种情况就需要用Http post来处理了. 网上也有很多关于Http post请求 ...

  2. java调用webservice接口 几种方法

    webservice的 发布一般都是使用WSDL(web service descriptive language)文件的样式来发布的,在WSDL文件里面,包含这个webservice暴露在外面可供使 ...

  3. vue 请求完接口后执行方法

    getLunbo: function() { var that = this; that.lunbo = []; // api.showProgress({ // title: '加载中' // }) ...

  4. webservice 接口通过 HTTP 获取数据

    using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Ne ...

  5. Node.js 使用 soap 模块请求 WebService 服务接口

    项目开发中需要请求webservice服务,前端主要使用node.js 作为运行环境,因此可以使用soap进行请求. 使用SOAP请求webservice服务的流程如下: 1.进入项目目录,安装 so ...

  6. webapi+Task并行请求不同接口实例

    标题的名称定义不知道是否准确,不过我想表达的意思就是使用Task特性来同时请求多个不同的接口,然后合并数据:我想这种场景的开发对于对接过其他公司接口的人不会陌生,本人也是列属于之内,更多的是使用最原始 ...

  7. JQuery请求WebService返回数据的几种处理方式

    打开自己的博客仔细浏览了一番,发现已经好久没有写博客了,由于最近一直比较忙碌懈怠了好多.默默反省三分钟.......言归正传,现在就对最近在学习webservice的过程中遇到的几种类型的问题中我的理 ...

  8. Java 常调用的Webservice接口的方法

    WebService是基于Web的服务,WebService使用SOAP协议实现跨编程语言和跨操作系统平台,接收和响应外部系统的某种请求,从而实现远程调用.WebService采用HTTP协议传输数据 ...

  9. ajax跨域请求调用webservice接口

    1.WebService 接口编写 步骤:新建web项目=>添加web service=>编写方法接口=>然后发布(本地测试可以直接把这个web service运行起来). 关键如何 ...

随机推荐

  1. 网卡ifcfg-eth0配置

    ifcfg-ethx网卡配置 文件路径 [root@localhost ~]# vi /etc/sysconfig/network-scripts/ifcfg-eth0 DEVICE=eth0     ...

  2. scala 隐式转换

    先参考这篇文章:http://www.jianshu.com/p/a344914de895 package com.test.scalaw.test /** * scala隐式转换 */ object ...

  3. tr DEMO

    测试数据: [weblogic@etp-mall-dev7][/tmp]$ cat msn.txt aaa bbb bbb ccc ccc ddd bbb eee aaa ccc bbb sss 转换 ...

  4. Hibernate,JPA注解@Embeddable

    JPA嵌入式对象(又名组件) 在实体中可以定义一个嵌入式组件(embedded component), 甚至覆盖该实体中原有的列映射. 组件类必须在类一级定义@Embeddable注解. 在特定的实体 ...

  5. AVAudioplayer时error解决 创建失败 ERror creating player: Error Domain=NSOSStatusErrorDomain Code=2003334207 "(null)"

    AVAudioplayer 有两个初始化方法: 1.[[AVAudioPlayer alloc] initWithData:musicData error&e]; 2.[[AVAudioPla ...

  6. svn down代码的时候提示“由于目标计算机积极拒绝,无法连接”

    如上图所示: 原因1:svn没有启动成功 原因2:防火墙没有svn的端口号3690 解决方法: 1.启动svn服务 svnserve -d -r svn路径   例如:svnserve -d -r / ...

  7. smb.conf

    [home]comment = All Printerspath = /homevalid users = yorkwriteable=yespublic=yesbrowseable = yescre ...

  8. java初学。加载图片

    public class GameFrame extends Frame{ private static final int WIDTH=900; private static final int H ...

  9. c#sqlhelper之用法

    MySqlParameter[] a=new MySqlParameter[]{new MySqlParameter("@stu_id",stu_id)}; 参数使用

  10. In Action(SPFA+01背包)

    In Action Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others) Total Sub ...