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

Re: [soaplite] SOAP::Lite to Weblogic err

Expand Messages
  • Kevin Stone
    I ve found the source of the problem and a workaround. In WebLogic s WSDL they define xmlns:soap= http://schemas.xmlsoap.org/ wsdl/soap/ . Lite.pm requires
    Message 1 of 2 , Jun 2, 2006
    View Source
    • 0 Attachment
      I've found the source of the problem and a workaround.

      In WebLogic's WSDL they define xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/".
      Lite.pm requires this URI be used in WSDL, however it gets confused because the prefix is
      'soap' and it simply replicates the namespace declaration into the stub.

      After attempting to override various things (perhaps easy to do when not using WSDL, but
      difficult with WSDL as the generated stub specifies so many things, not to mention the
      occasional "my $self = shift->new" in Lite.pm), the best solution seems to be changing
      the incoming WSDL so that a different namespace prefix (other than "soap") is used to

      i.e.

      cat weblogic.wsdl | sed -e s/soap:/shizzle:/g | sed -e s/xmlns:soap=/xmlns:shizzle=/g >
      weblogic-willwork.wsdl

      You can use whatever replacement prefix you want, however "shizzle" is funnier.

      On May 25, 2006, at 4:32 PM, Kevin Stone wrote:

      Sample code for call:

      #!/usr/bin/perl
      use Data::Dumper;
      use SOAP::Lite +trace;

      #my.wsdl was generated by weblogic server
      my $client = SOAP::Lite->service("file:///my.wsdl");
      my $ret = $client->getCustomerInfo('%FIRST%', "3");
      print Dumper $ret;

      Causes Weblogic server to produce fault with error message:

      Could not resolve method with element 'http://schemas.xmlsoap.org/wsdl
      soap/:Envelope' as top element

      Using tcpdump I captured the errant SOAP request--

      <?xml version="1.0" encoding="UTF-8"?>
      <soap:Envelope
         xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/"
         xmlns:conv="http://www.openuri.org/2002/04/soap/conversation/"
         soap:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
         xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
         xmlns:s="http://www.w3.org/2001/XMLSchema"
         xmlns:cw="http://www.openuri.org/2002/04/wsdl/conversation/"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
         xmlns:http="http://schemas.xmlsoap.org/wsdl/http/"
         xmlns:jms="http://www.openuri.org/2002/04/wsdl/jms/"
         xmlns:s0="http://www.openuri.org/">
        <soap:Body>
          <s0:getCustomerInfo>
            <input xsi:type="s:string">%FIRST%</input>
            <srchCriteria xsi:type="s:string">3</srchCriteria>
          </s0:getCustomerInfo>
        </soap:Body>
      </soap:Envelope>

      I was able to modify the xml so that it would work directly with a POST:

      diff trypost.soaplitedefault trypost.works
      6c6
      <    xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
      ---
      >    xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"

      However-- it seems that there's not a way to modify this namespace.  By setting cache_dir
      I can look at the stub generated and I see the following line in the "sub _call" (in the
      generated stub)...

      $self->serializer->register_ns("http://schemas.xmlsoap.org/wsdl/soap/","soap");

      So *that's* where it gets set-- right before the call is actually made-- any that must be
      why I can't seem to override it with my own calls to register_ns.

      I'm trying to override the serializer-- presumably if I can capture the register_ns call made
      in the stub I can just ignore it when $prefix="soap".  I haven't found any examples of how
      to override the serializer, but I have gotten it to work to some extent.  (It captures the
      register_ns but then dies somewhere else.)   I'm not sure how to
      initialize the superclass as I have a 'bless' in my 'new' and it has a 'bless' in its 'new'.....

      Any examples out there of overriding SOAP::Lite::Serializer?  Other approaches or advice? 

      BTW- This is SOAP::Lite 0.67 - I seemed to have same/similar behavior under .65_3 but
      upgraded before digging deeper.

      Thanks!!!





      SPONSORED LINKS
      Protocol analyzer Ssl protocol Protocol converter
      Sip protocol Protocol analysis Protocol


      YAHOO! GROUPS LINKS





    Your message has been successfully submitted and would be delivered to recipients shortly.