代码库> 网络> webservice soap问题:未将对象引用设置到对象的实例
webservice soap问题:未将对象引用设置到对象的实例
关注
上传者:蜜蜂 分类:网络(Networking)
查看次数:7535 下载次数:361
上传时间:2012-12-25 大小:24 B


    NSString *soapMessage = [NSString stringWithFormat:
                             @"
"
                             "
"
                             "
"
                             "
"
                             "%@
"
                             "

"
                             "

"
                             "

",@"sh000028"
                             ];
    NSURL *url = [NSURL URLWithString:@"http://www.webxml.com.cn/WebServices/ChinaStockWebService.asmx"];
    NSMutableURLRequest *theRequest = [NSMutableURLRequest requestWithURL:url];
    NSString *msgLength = [NSString stringWithFormat:@"%d", [soapMessage length]];
    [theRequest addValue: @"text/xml; charset=utf-8" forHTTPHeaderField:@"Content-Type"];
    [theRequest addValue: @"http://WebXml.com.cn/getStockInfoByCode" forHTTPHeaderField:@"SOAPAction"];
    
    [theRequest addValue: msgLength forHTTPHeaderField:@"Content-Length"];
    [theRequest setHTTPMethod:@"POST"];
    [theRequest setHTTPBody: [soapMessage dataUsingEncoding:NSUTF8StringEncoding]];

收藏
我来说两句
发表评论
您还没有登录!请登录注册
所有评论(0
提示
sina weixin mail 回到顶部