SOAP
来源:互联网 发布:人工智能机器人玩具 编辑:程序博客网 时间:2024/06/11 19:09
NSString *msgLength = [NSString stringWithFormat:@"%ld", [soapMsg length]];
NSString *soapAction=[NSString stringWithFormat:@"%@%@",space,methodname];
NSURL *url = [NSURL URLWithString:@"http://msp30.coocare.com"];
AFHTTPClient *httpClient = [[AFHTTPClient alloc] initWithBaseURL:url];
NSMutableURLRequest *request = [httpClient requestWithMethod:@"GET" path:wsUrlparameters:nil];//这里的parameters:参数就是你的第二个问题如何设置参数
NSDictionary *headField=[NSDictionary dictionaryWithObjectsAndKeys:[urlhost],@"Host",
@"text/xml; charset=utf-8",@"Content-Type",
msgLength,@"Content-Length",
soapAction,@"SOAPAction",nil];
[request setAllHTTPHeaderFields:headField];
//超时设置
[request setTimeoutInterval: 30 ];
//访问方式
[request setHTTPMethod:@"POST"];
//body内容
[request setHTTPBody:[soapMsg dataUsingEncoding:NSUTF8StringEncoding]];
AFHTTPRequestOperation *operation = [httpClientHTTPRequestOperationWithRequest:request success:^(AFHTTPRequestOperation *operation, idresponseObject) {
//NSData *html = operation.responseData;
NSLog(@"返回的字符串~~~~~~~:%@",operation.responseString);
}
failure:^(AFHTTPRequestOperation *operation, NSError *error) {
NSLog(@"请求失败=%@",error);
NSString *html = operation.responseString;
NSLog(@"请求失败返回的字符串~~~~~~~:%@",html);
}
];
[httpClient enqueueHTTPRequestOperation:operation];
- SOAP
- SOAP
- SOAP
- SOAP
- SOAP
- soap
- SOAP
- SOAP
- SOAP
- SOAP
- SOAP
- SOAP
- SOAP
- SOAP
- SOAP
- SOAP
- SOAP
- SOAP
- 你不知道的JAVA
- linux_centos_问题
- 【微信:hatybeijing】京女编程老师寻IT牛人建i8lei.com"爱芭蕾"论坛(如:Discuz)和搭建微信的发帖阅读帖子功能
- php mac环境配置
- Mac常用快捷键
- SOAP
- 解决NFS:clnt_create: RPC: Port mapper failure - Unable to receive: errno 113 (No route to host)
- 【JavaWeb Structs2学习】 用Action接受参数
- hadoop伪分布式搭建
- 如何在ViewController里调用app delegate里自己写的的方法或者系统的方法
- Spring学习笔记---2.1-IOC容器解析Bean配置信息
- Struts2配置详解_配置Action
- android用于打开各种文件的intent
- nyoj VF 269 (DP)求数字和的个数