We have a .NET WCF Service talking to an iPhone app. I'm using wsdl2objc to generate the objc code required for all the SOAP magic. SoapUI is able to add this service's wsdl and send requests correctly. But the request generated by wsdl2objc complains about this:
<s:Envelope xmlns:s="http://www.w3.org/2003/05/soap-envelope">
<s:Body>
<s:Fault>
<s:Code>
<s:Value>s:Sender</s:Value>
<s:Subcode>
<s:Value xmlns:a="http://schemas.microsoft.com/ws/2005/05/addressing/none">a:ActionNotSupported</s:Value>
</s:Subcode>
</s:Code>
<s:Reason>
<s:Text xml:lang="en-US">The message with Action '' cannot be processed at the receiver, due to a ContractFilter mismatch at the EndpointDispatcher. This may be because of either a contract mismatch (mismatched Actions between sender and receiver) or a binding/security mismatch between the sender and the receiver. Check that sender and receiver have the same contract and the same binding (including security requirements, e.g. Message, Transport, None).
</s:Text>
</s:Reason>
</s:Fault>
</s:Body>
</s:Envelope>
However, If I use the same s:Envelope
with SoapUI, the request works correctly. The only difference between the two requests as far as I can see is the header section where wsdl2objc generates this:
SOAPAction:http://xx/AuthenticateDevice
but soapUI generates:
Content-Type: application/soap+xml;charset=UTF-8;action="http://xx/AuthenticateDevice"
I tried to change the code that wsdl2objc generated and replaced this:
[request setValue:soapAction forHTTPHeaderField:@"SOAPAction"];
NSString *contentType = [NSString stringWithFormat:@"application/soap+xml; charset=utf-8;"];
[request setValue:contentType forHTTPHeaderField:@"Content-Type"];
with this:
[request setValue:soapAction forHTTPHeaderField:@"action"];
NSString *contentType = [NSString stringWithFormat:@"application/soap+xml; charset=utf-8;"];
[request setValue:contentType forHTTPHeaderField:@"Content-Type"];
But, I just get a 400 error now. Any help is much appreciated!
Thanks,
Teja.