Lately I've been interacting with a handful of SOAP APIs from different enterprise systems and I'm somewhat puzzled that oftentimes the WSDLs seem to indicate that they should be receiving XML data as a "string". For example a WSDL indicate the service expects data conforming to the following snippet of XSD for some operation:
...
<s:element name="PostSomeData">
<s:complexType>
<s:sequence>
<s:element minOccurs="0" maxOccurs="1" name="Data" type="s:string"/>
</s:sequence>
</s:complexType>
</s:element>
...
<wsdl:message name="PostNewhireRecordSoapIn">
<wsdl:part name="parameters" element="tns:PostSomeData"/>
</wsdl:message>
...
When in fact the contents of the Data tag itself must contain some XML, usually escaped or as Character Data(<![CDATA[<SomeStructuredData>...</SomeStructuredData>]]>
) that adheres to some schema that may or may not be provided.
What gives? Why is there a proclivity for APIs to be designed such that SOAP webservices expect xsd:string? It seems like. if I'm going to use SOAP, I should be describing the structure of the XML expected rather than just define the webservice as expecting a string of XML.