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 12:45 PM
      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


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

      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:

      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"?>
            <input xsi:type="s:string">%FIRST%</input>
            <srchCriteria xsi:type="s:string">3</srchCriteria>

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

      diff trypost.soaplitedefault trypost.works
      <    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)...


      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.


      Protocol analyzer Ssl protocol Protocol converter
      Sip protocol Protocol analysis Protocol


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