Loading ...
Sorry, an error occurred while loading the content.

Get SOAP::Lite to stop inserting namesp1

Expand Messages
  • Rich T_
    Have a server running SOAP::Lite (0.711) to manage soap requests and return results as an apache service/handler. It s working close to perfect except for this
    Message 1 of 1 , Mar 8, 2012
    View Source
    • 0 Attachment
      Have a server running SOAP::Lite (0.711) to manage soap requests and return results as an apache service/handler. It's working close to perfect except for this one nagging problem. The SOAP::Lite library keeps creating a namesp1 pointing to soaplite.com and assuming all my new types are part of that namespace.

      For example, this request:

      <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:util="http://util.com/API/SOAP/Utils">
      <soapenv:Header/>
      <soapenv:Body>
      <util:getSLAs>
      <util:sla_ids>100</util:sla_ids>
      </util:getSLAs>
      </soapenv:Body>
      </soapenv:Envelope>

      Gives this response:

      <soap:Envelope
      soap:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
      xmlns:namesp1="http://namespaces.soaplite.com/perl"
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
      xmlns:xsd="http://www.w3.org/2001/XMLSchema"
      xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
      <soap:Body>
      <getSLASResponse xmlns="http://util.com/API/SOAP/Utils">
      <sla_list soapenc:arrayType="namesp1:SLAObject[1]" xsi:type="soapenc:Array">
      <SLAObject xsi:type="namesp1:SLAObject" xmlns="">
      <sla_id xsi:type="xsd:int">100</sla_id>
      <sla_name xsi:type="xsd:string">sample sla</sla_name>
      <active xsi:type="xsd:boolean">true</active>
      </SLAObject>
      </sla_list>
      </getSLASResponse>
      </soap:Body>
      </soap:Envelope>

      Which would be great except for this extraneous namesp1 which SOAP::Lite keeps putting in there.

      It's obviously smart enough to use the original request namespace for the response object. If it didn't prefix the complex types with namesp1, it would be fine, but nothing I try will get rid of that. I can add a ->type("foo:Object") to the SOAP::Data call creating the object, which removes namesp1, but then I don't have a "foo" namespace in the Response which causes the opposite problem. Using ->prefix('') or ->uri('') doesn't remove it either.

      I can get the effect I want by modifying the SOAP::Lite library to autotype(0) when generating the response, but I can't do that in production. I can't find another place to use that hook.

      Any help here?
    Your message has been successfully submitted and would be delivered to recipients shortly.