"We recently implemented the webservice interface from our vendors," Eric writes, "they're a large and generally well-respected software service firm."
"Their webservice returns SOAP messages — which is just fine — but instead of returning a useful XML string, it returns this."
<!-- ED: soap envelope omitted for readability --> <string xmlns="urn:Initech.Global.Services"> <CompanyGetConnector> <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"> <xs:element name="InitechGetConnector"> <xs:complexType> <xs:choice maxOccurs="unbounded"> <xs:element name="employees"> <xs:complexType> <xs:sequence> <xs:element name="EmployerName" type="xs:string" minOccurs="0"/> <xs:element name="Employee" type="xs:string" minOccurs="0"/> <xs:element name="Firstname" type="xs:string" minOccurs="0"/> <xs:element name="Prefix" type="xs:string" minOccurs="0"/> <xs:element name="Lastname" type="xs:string" minOccurs="0"/> <xs:element name="Org._unit" type="xs:string" minOccurs="0"/> <xs:element name="Function" type="xs:string" minOccurs="0"/> <xs:element name="E-mail_work" type="xs:string" minOccurs="0"/> <xs:element name="Telephone_work" type="xs:string" minOccurs="0"/> <xs:element name="Mobile_work" type="xs:string" minOccurs="0"/> <xs:element name="Birthdate" type="xs:date" minOccurs="0"/> <xs:element name="Hired_since__irt._yearsemployed_" type="xs:date" minOccurs="0"/> <xs:element name="Image" type="xs:base64Binary" minOccurs="0"/> </xs:sequence> </xs:complexType> </xs:element> </xs:choice> </xs:complexType> </xs:element> </xs:schema> <employees> <EmployerName> My Client </EmployerName> <Employee> 100001 </Employee> [cut rest of employee info] <Image> Nx4U8fSs+0lLRRNjORrUg/495x23NWHYf6j8T/OqW7QnsndLp74jJ5p64q6XycDrWZYk4PPc [cut rather large blob] </Image> </employees> </CompanyGetConnector> </string>
Eric continues, "while we can obviously write the code to extract the XML-encoded XML, decode it to XML, and then parse it as XML, we figured it'd be easier if they could just return XML in the first place. The vendor's response: it's actually better this way for future compatibility and, regardless, several customers already use it tihs way."