首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >iPhone和SOAP1.2 (.net WCF)

iPhone和SOAP1.2 (.net WCF)
EN

Stack Overflow用户
提问于 2011-12-14 09:38:27
回答 1查看 568关注 0票数 0

我谦卑地请求你在这个问题上的帮助,因为我总是得到0字节。

这些是我遇到的产出:

代码语言:javascript
复制
TestWCFCalls[94830:f803] didReceiveResponse
2011-12-14 17:11:37.054 TestWCFCalls[94830:f803] connectionDidFinishLoading
2011-1214 17:11:37.055 TestWCFCalls[94830:f803] DONE. Received Bytes: 0

  • (IBAction)buttonClicked:(id)sender {

//变量使用NSMutableData *webData;NSString *soapMessage = NSString stringWithFormat:@"\n“http://www.w3.org/2001/XMLSchema-instance\“xmlns:xsd=\”http://www.w3.org/2001/XMLSchema\ \n“xmlns:soap12=\"">http://www.w3.org/2003/05/soap-envelope\"> \n” \n“">http://tempuri.org/\"> \n”"testtest \n“” \n“”“;NSLog(soapMessage);NSURL *url = NSURL URLWithString:@"http://10.10.10.75:8731/Design_Time_Addresses/MobileWCFService.WCFServices/UserLogOnServ/";NSMutableURLRequest *theRequest = NSMutableURLRequest requestWithURL:url;NSString *msgLength = [NSString stringWithFormat:@"%d",soapMessage length];theRequest addValue:@"text/xml;charset=utf-8“forHTTPHeaderField:@"Content-Type";@"http://tempuri.org/iUserLogOnServ/MobileLogOn“theRequest addValue: theRequest addValue: msgLength forHTTPHeaderField:@"Soapaction";theRequest addValue:msgLength forHTTPHeaderField:@”Content“;theRequest setHTTPMethod:@"POST";[theRequest setHTTPBody: soapMessage dataUsingEncoding:NSUTF8StringEncoding];NSURLConnection *theConnection = [NSURLConnection alloc initWithRequest:theRequest委托:self];if(theConnection) { NSLog(@"test");webData = [NSMutableData数据保留];}NSLog{ NSLog(@"theConnection is”);}NSLog

}

-Web配置-

代码语言:javascript
复制
<service behaviorConfiguration="MobileWCFService.WCFServices.MobileUserLogOnServBehavior"
        name="MobileWCFService.WCFServices.MobileUserLogOnServ">
        <endpoint address="" binding="wsHttpBinding" bindingName="MobileLogOnBinding"
          contract="MobileWCFService.WCFServices.IMobileUserLogOnServ">
          <identity>
            <dns value="localhost" />
          </identity>
        </endpoint>
        <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />
        <host>
          <baseAddresses>
            <add baseAddress="http://10.10.10.75:8731/Design_Time_Addresses/MobileWCFService.WCFServices/MobileUserLogOnServ/" />
          </baseAddresses>
        </host>
      </service>

我不知道我错过了什么部分,但我很确定我错过了一点,虽然我可以打电话给服务部分,但我没有收到任何数据。

谢谢你,塞尔

EN

回答 1

Stack Overflow用户

发布于 2011-12-14 12:20:28

对于从iOS消费,WCF绑定应该是BasicHttpBinding。在你的例子中,它是wsHttpBinding。这可能就是原因。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/8502256

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档