2011-12-14 14 views
0

は、私が遭遇した出力です:iPhoneおよびSOAP 1.2(.NET WCF)

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)、送信者{

    //Variables used 
    NSMutableData *webData; 
    NSString *soapMessage = NSString stringWithFormat: 
    
    @"<?xml version=\"1.0\" encoding=\"utf-8\"?>\n" 
    "<soap12:Envelope \n" 
    "xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" \n" 
    "xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" \n" 
    "xmlns:soap12=\"http://www.w3.org/2003/05/soap-envelope\"> \n" 
    "<soap12:Body> \n" 
    "<MobileLogOn xmlns=\"http://tempuri.org/\"> \n" 
    "<userID>test</userID><PWD>test</PWD></MobileLogOn> \n" 
    "</soap12:Body> \n" 
    "</soap12:Envelope>"]; 
    
    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"];  
    [theRequest addValue: @"http://tempuri.org/iUserLogOnServ/MobileLogOn" forHTTPHeaderField:@"Soapaction"]; 
    [theRequest addValue: msgLength forHTTPHeaderField:@"Content-Length"]; 
    [theRequest setHTTPMethod:@"POST"];  
    [theRequest setHTTPBody: [soapMessage dataUsingEncoding:NSUTF8StringEncoding]]; 
    NSURLConnection *theConnection = [[NSURLConnection alloc] initWithRequest:theRequest delegate:self]; 
    
    if(theConnection) { 
        NSLog(@"test"); 
        webData = [[NSMutableData data] retain]; 
    } 
    else { 
        NSLog(@"theConnection is NULL"); 
    } 
    

}

-Web構成 -

<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> 

私は逃したどの部分か分からないが、私はサービスの一部を呼び出すことができますが、私はすべてのデータを受信して​​いないのに、私は、私はいくつかのポイントを逃したかなり確信しています。

種類おかげで、 Selの

+0

好奇心から離れて、http://sudzc.com/でSOAPクライアントを自動的に作成しようとしましたか? – Mat

+0

私はsudzc.comを試しましたが、私は生成できません。私のローカルサービスファイルに接続できないようなサイトがあります。 –

+0

WSDLファイルをディスクに保存してSudzC Webサイトにロードすることができます。 – mrd3650

答えて

0

BasicHttpBindingあるべき結合のiOS、WCFから消費します。あなたの場合はwsHttpBindingです。それが理由かもしれません。

+0

返信いただきありがとうございますが、wcf session partのwsHttpBindingが必要です... wcf sessionでオプションが不足しています。 セッションを実装できる.net Webサービス(SOAP 1.1,1.2)でiPhoneプロジェクトを実装する方法はありますか? –

+0

私はBasicHttpBindingだけがiPhoneからアクセスできると思います。私は他の方法を知らない。 –

関連する問題