iPhone アプリケーションが WCF サービスと通信できるようにしようとしています。私のアプリケーションは Web サービスに正常に接続/検索しますが、エラー以外の応答が返されないようです。Visual Studios wcf tester を使用すると、正常に動作します。
XML 形式:<mAccess><user></user><pwd></pwd></mAccess>
頭/体の構造に何か問題がありますか?
NSMutableURLRequest *request = [[NSMutableURLRequest alloc] initWithURL:[NSURL URLWithString:website]];
[request setHTTPMethod:@"POST"];
[request setValue:@"text/xml; charset=utf-8" forHTTPHeaderField:@"Content-type"];
NSString *soapMessage = [[NSString alloc] initWithFormat:@"<SOAP-ENV:Envelope
xmlns:SOAP-ENV=\"http://schemas.xmlsoap.org/soap/envelope/\"><SOAP-ENV:Body>
<MobileAccess xmlns=\"http://tempuri.org/\"><mAccess><user>user</user><pwd>pwd</pwd><custID>0</custID></mAccess>
</MobileAccess></SOAP-ENV:Body></SOAP-ENV:Envelope>"];
[request setValue:[NSString stringWithFormat:@"%d",[soapMessage length]] forHTTPHeaderField:@"Content-length"];
[request addValue:@"http://tempuri.org/IProviderDataService/MobileAccess" forHTTPHeaderField:@"Soapaction"];
[request setHTTPBody:[soapMessage dataUsingEncoding:NSUTF8StringEncoding]];