请求webservice接口的某方法数据
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接口的某方法数据的更多相关文章
- Kettle通过Http post请求webservice接口以及结果解析处理
kettle中有两种方式请求webservice服务,一个是Web服务查询,但是这个有缺陷,无法处理复杂的需求,遇到这种情况就需要用Http post来处理了. 网上也有很多关于Http post请求 ...
- java调用webservice接口 几种方法
webservice的 发布一般都是使用WSDL(web service descriptive language)文件的样式来发布的,在WSDL文件里面,包含这个webservice暴露在外面可供使 ...
- vue 请求完接口后执行方法
getLunbo: function() { var that = this; that.lunbo = []; // api.showProgress({ // title: '加载中' // }) ...
- webservice 接口通过 HTTP 获取数据
using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Ne ...
- Node.js 使用 soap 模块请求 WebService 服务接口
项目开发中需要请求webservice服务,前端主要使用node.js 作为运行环境,因此可以使用soap进行请求. 使用SOAP请求webservice服务的流程如下: 1.进入项目目录,安装 so ...
- webapi+Task并行请求不同接口实例
标题的名称定义不知道是否准确,不过我想表达的意思就是使用Task特性来同时请求多个不同的接口,然后合并数据:我想这种场景的开发对于对接过其他公司接口的人不会陌生,本人也是列属于之内,更多的是使用最原始 ...
- JQuery请求WebService返回数据的几种处理方式
打开自己的博客仔细浏览了一番,发现已经好久没有写博客了,由于最近一直比较忙碌懈怠了好多.默默反省三分钟.......言归正传,现在就对最近在学习webservice的过程中遇到的几种类型的问题中我的理 ...
- Java 常调用的Webservice接口的方法
WebService是基于Web的服务,WebService使用SOAP协议实现跨编程语言和跨操作系统平台,接收和响应外部系统的某种请求,从而实现远程调用.WebService采用HTTP协议传输数据 ...
- ajax跨域请求调用webservice接口
1.WebService 接口编写 步骤:新建web项目=>添加web service=>编写方法接口=>然后发布(本地测试可以直接把这个web service运行起来). 关键如何 ...
随机推荐
- Jquery 插件库
http://www.jq22.com/ 日期: http://laydate.layui.com/
- Index Condition Pushdown Optimization
Index Condition Pushdown (ICP) is an optimization for the case where MySQL retrieves rows from a tab ...
- USB 设备类协议入门【转】
本文转载自:http://www.cnblogs.com/xidongs/archive/2011/09/26/2191616.html 一.应用场合 USB HID类是比较大的一个类,HID类设备属 ...
- 编程之美_1.1 让CPU占用率曲线听你指挥
听到有人说让要写一个程序,让用户来决定Windows任务管理器的CPU占用率. 觉得很好奇.但第一个想法就是写个死循环.哈哈.不知道具体的占用率是多少,但至少能保证在程序运行时,CPU的占用率终会稳定 ...
- 创建sh文件
创建sh文件 #/bin/bash v_file=$ v_type=$ v_desc=$ touch $v_file echo '#================================== ...
- ubunt1204安装配置vsftp
本文将搭建一个最简单的ftp服务,即通过root用户可进行登录.上传.下载,具体步骤如下: 1.安装vsftpd服务 sudo apt-get install vsftpd 2.编辑vsftp配置文件 ...
- Word and MediaElement
function jmc_new_lib(){// Because we still want the script to load but not the styleswp_enqueue_scri ...
- Redis的使用完整版
[Redis基本] 1.redis安装完成后的几个文件: redis-benchmark 性能测试工具(批量写入)./bin/redis-benchmark -n 10000 即可一次性写入100 ...
- Codeforces Round #336 Zuma
D. Zuma time limit per test: 2 seconds memory limit per test: 512 megabytes input: standard input ...
- nginx安装后出现502 Bad Gateway 错误解决办法
1. 打开php-fpm.conf 2.将lisen值修改为 listen = 127.0.0.1:9000 并保存 3.重启服务/etc/init.d/php-fpm restart