Search code examples
web-servicesperlsoapsoap-clientsoaplite

Getting SOAP::Lite to omit types in queries


I'm trying to get a Perl script using SOAP::Lite to talk to a web service.

I have a WSDL for the service, but some fields have their type defined as a complexType / simpleType without a name specified.

The server validates the typing information that I send with the request, failing it due to the incorrect type being given.

How can I overcome this problem? It seems that the server is happy if I omit the typing information in a manual request, but I'm struggling to get SOAP::Lite to not emit a type (If I don't specify one, it guesses one). Another option would be to supply the type that the server expects, but I haven't been able to figure out what that is. (Supplying raw XML would work as well, but it feels dirty...)

WSDL for such a field:

  <xs:element name="Description">
    <xs:annotation>
      <xs:documentation>Free text field</xs:documentation>
    </xs:annotation>
    <xs:simpleType>
      <xs:restriction base="xs:string">
        <xs:maxLength value="4000"/>
      </xs:restriction>
    </xs:simpleType>
  </xs:element>

I have tried to tag it as xs:string, but that is not accepted either.


Solution

  • From documentation

    autotype()

    Shortcut for serializer->autotype(). This lets you specify whether the serializer will try to make autotyping for you or not. Default setting is true.

    So turn this off.