I don't do much Cocoa programming, so I'm probably missing something obvious, so please excuse the basic question.
I have a SOAP method that expects a complex type as a paramater. Here's some WSDL:
<s:element name="SaveTestResult">
<s:complexType>
<s:sequence>
<s:element minOccurs="0" maxOccurs="1" name="result" type="tns:TestItemResponse" />
</s:sequence>
</s:complexType>
</s:element>
Here's the definition of the complex type "TestItemResponse":
<s:complexType name="TestItemResponse">
<s:sequence>
<s:element minOccurs="1" maxOccurs="1" name="TestItemRequestId" type="s:int" />
<s:element minOccurs="1" maxOccurs="1" name="ExternalId" type="s:int" />
<s:element minOccurs="0" maxOccurs="1" name="ApiId" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="InboxGuid" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="SpamResult" type="tns:SpamResult" />
<s:element minOccurs="0" maxOccurs="1" name="ResultImageSet" type="tns:ResultImageSet" />
<s:element minOccurs="1" maxOccurs="1" name="ExclusiveUseMailAccountId" type="s:int" />
<s:element minOccurs="1" maxOccurs="1" name="State" type="tns:TestItemResponseState" />
<s:element minOccurs="0" maxOccurs="1" name="ErrorShortDescription" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="ErrorFullDescription" type="s:string" />
</s:sequence>
</s:complexType>
I've been using Web Services Core to call a SOAP API method that requires a simple string param, that works great. That same method returns a complex type which WSC converted into nested NSDictionaries, so no problems there. So I assumed I'd be able to convert my local TestItemResponse class into an NSDictionary and then use that as the complex type param. It almost worked, but unfortunately WSC set the object's type as "Dictionary", instead of "TestItemResponse", and the server complained.
<TestItemResponse xsi:type=\"SOAP-ENC:Dictionary\">
<ErrorFullDescription xsi:type=\"xsd:string\">foo</ErrorFullDescription>
...
I can't seem to find anything that allows you to override the type WSC assigns to the element in the SOAP XML. I've been using code adapted from here, I'm happy to list it, it's just quite long and this is already the longest SO question I've ever posted.