は、私が遭遇した出力です: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の
好奇心から離れて、http://sudzc.com/でSOAPクライアントを自動的に作成しようとしましたか? – Mat
私はsudzc.comを試しましたが、私は生成できません。私のローカルサービスファイルに接続できないようなサイトがあります。 –
WSDLファイルをディスクに保存してSudzC Webサイトにロードすることができます。 – mrd3650