请求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运行起来). 关键如何 ...
随机推荐
- Loadrunner教程读后感-VuGen
一.loadrunner协议分析 协议确定方法 二.提交表单函数的区别 (1)web_sumit_form() (2)web_sumit_data() 三.web_url和web_link 四.VuG ...
- oracle 序列 ,check约束
====================序列 //查询当前用户序列 select * from user_sequences //查询所有序列 select * from all_sequences; ...
- Java程序编译和运行的过程【转】
转自:http://www.360doc.com/content/14/0218/23/9440338_353675002.shtml Java整个编译以及运行的过程相当繁琐,本文通过一个简单的程序来 ...
- UIView完全置顶的方法
一般来说,若需要独立添加一个UIView,使其覆盖于整个应用窗口之上,是这样实现的: AppDelegate *app = (AppDelegate *)[[UIApplication sharedA ...
- How To Set Up vsftpd on CentOS 6
About vsftpd 警告:FTP是天生不安全.如果你必须使用FTP,考虑securing your FTP connection with SSL/TLS.否则,最好use SFTP, a se ...
- POJ 2763:Housewife Wind(树链剖分)
http://poj.org/problem?id=2763 题意:给出 n 个点, n-1 条带权边, 询问是询问 s 到 v 的权值, 修改是修改存储时候的第 i 条边的权值. 思路:树链剖分之修 ...
- uname -r和uname -a了解
1.uname -r :显示操作系统的发行版号2.uname -a :显示系统名.节点名称.操作系统的发行版号.操作系统版本.运行系统的机器 ID 号. #uname -aHP-UX RX1600 B ...
- IOS中两个view的切换
在ios中,rootview为PassWordViewController,secondview为SecondViewController,实现在rootview中听过一个跳转按钮实现跳转到secon ...
- SDUT 2608:Alice and Bob
Alice and Bob Time Limit: 1000ms Memory limit: 65536K 有疑问?点这里^_^ 题目描述 Alice and Bob like playing ...
- CallableAndFuture
Callable和Runnable的区别如下: I Callable定义的方法是call,而Runnable定义的方法是run. II Callable的call方法可以有返回值,而Runn ...