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

811Re: [soaplite] SOAP::Lite & WSDL - some questions (long)

Expand Messages
  • Paul Kulchenko
    Sep 10, 2001
    • 0 Attachment
      Hi, Jean-Jack!

      > My thought is the problem must be in WSDL, or in SOAP::Lite's WSDL
      > handling, since a normal SOAP call directly to the server works..
      Yes, there are some differences between parameters you specified in
      direct call and parameters in WSDL.

      First of all, namespace is different. WDSL should have:
      namespace="http://www.ebi.ac.uk/XEMBL"

      Second, soapAction is different. SOAP::Lite uses URI#method as a
      SOAPAction by default, so you need to specify it in WSDL file, or
      change it on server side using on_action handler. Let's do it in
      WSDL:
      soapAction="http://www.ebi.ac.uk/XEMBL#FullSequence" />

      Now <operation> section looks like:

      <operation name="FullSequence">
      <soap:operation
      soapAction="http://www.ebi.ac.uk/XEMBL#FullSequence" />
      <input>
      <soap:body use="encoded"
      namespace="http://www.ebi.ac.uk/XEMBL"

      encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" />
      </input>
      <output>
      <soap:body use="encoded"
      namespace="http://www.ebi.ac.uk/XEMBL"

      encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" />
      </output>
      </operation>

      > # with the use of ->service the result is always empty :(
      > if ($result) {
      > print $result->result();
      > } else
      > print "EMPTY!!!!\n\n";
      > }
      You can always get better diagnostics using $result->faultstring:

      if ($result->fault) { # check for fault
      print $result->faultstring;
      } else {
      print $result->result;
      }

      Hope it helps. Let me know if you still have problem.

      Best wishes, Paul.

      --- "Jean-Jack M. Riethoven" <pow@...> wrote:
      >
      > Greetings,
      >
      > I am trying to set up a SOAP service using the Perl SOAP::Lite
      > modules, and
      > I was up and running in less than 10 minutes (Kudos to the
      > developer of
      > SOAP::Lite!)
      >
      > Everything works fine from my little SOAP client, accessing the
      > server
      > directly. I am now trying to set up access via WSDL, and I am
      > hopelessly
      > lost :)
      >
      > I even slimmed down the server so that basically I give it a string
      > and it
      > should return the same string back. I hope you don't mind dumping
      > you with
      > source code and WSDL, but maybe a thousand people can see what I
      > cannot.
      >
      > When I execute the client with the ->service() call I can see the
      > .wsdl
      > file being downloaded, the SOAP-server.pl being run (with a 500
      > error)...
      > and an undefined result (obviously) returned. Running the client
      > via ->uri
      > and ->proxy works like a charm.
      >
      > My thought is the problem must be in WSDL, or in SOAP::Lite's WSDL
      > handling, since a normal SOAP call directly to the server works..
      > So I'll
      > list the WSDL first:
      >
      >
      >
      > <?xml version = "1.0"?>
      > <definitions name="XEMBL"
      > targetNamespace="http://www.ebi.ac.uk/xembl/XEMBL.wsdl"
      > xmlns:tns="http://www.ebi.ac.uk/xembl/XEMBL.wsdl"
      > xmlns:xsd="http://www.w3.org/2001/XMLSchema"
      > xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
      > xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
      > xmlns="http://schemas.xmlsoap.org/wsdl/">
      > <message name="FullSequenceRequest">
      > <part name="id" type="xsd:string" />
      > </message>
      > <message name="FullSequenceResponse">
      > <part name="result" type="xsd:string" />
      > </message>
      > <portType name="XEMBLPortType">
      > <operation name="FullSequence">
      > <input message="tns:FullSequenceRequest"
      > name="FullSequence"/>
      > <output message="tns:FullSequenceResponse"
      > name="FullSequenceResponse" />
      > </operation>
      > </portType>
      > <binding name="XEMBLServiceBinding" type="tns:XEMBLPortType">
      > <soap:binding style="rpc"
      > transport="http://schemas.xmlsoap.org/soap/http" />
      > <operation name="FullSequence">
      > <soap:operation soapAction="" />
      > <input>
      > <soap:body use="encoded"
      > namespace="http://www.ebi.ac.uk/xembl/XEMBL.wsdl"
      > encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" />
      > </input>
      > <output>
      > <soap:body use="encoded"
      > namespace="http://www.ebi.ac.uk/xembl/XEMBL.wsdl"
      > encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" />
      > </output>
      > </operation>
      > </binding>
      > <service name="XEMBLService">
      > <documentation>Returns full information on EMBL Nucleotide
      > Sequences
      > formatted as Bsml XML or Agave XML</documentation>
      > <port name="XEMBLPort" binding="tns:XEMBLServiceBinding">
      > <soap:address
      > location="http://www.ebi.ac.uk:80/cgi-bin/xembl/SOAP-server.pl" />
      > </port>
      > </service>
      > </definitions>
      >
      >
      > Basically, the server SOAP-server.pl is this:
      >
      > #!/sw/arch/bin/perl -w
      >
      > use SOAP::Transport::HTTP;
      >
      > SOAP::Transport::HTTP::CGI
      > -> dispatch_to('XEMBL')
      > -> handle;
      >
      >
      > package XEMBL;
      >
      > sub FullSequence
      >
      > my ($class, $acc_nr) = @_;
      > my ($result);
      >
      > use LWP::Simple; # Use the LWP::Simple package.
      >
      > $result = $acc_nr;
      >
      > return $result;
      > }
      >
      >
      > 1;
      >
      > The client is as follows:
      >
      > #!/sw/arch/bin/perl
      >
      > # Simple program that connects to the SOAP server to retrieve
      > # sequence information in either Bsml or AGAVE XML format.
      >
      > use SOAP::Lite; # SOAP API
      >
      > # THIS WORKS!
      > # my $soap = SOAP::Lite
      > # -> uri('http://www.ebi.ac.uk/XEMBL')
      > # -> proxy('http://www.ebi.ac.uk/cgi-bin/xembl/SOAP-server.pl');
      >
      > my $soap = SOAP::Lite
      > -> service('http://www.ebi.ac.uk/xembl/XEMBL.wsdl');
      >
      >
      > $result = $soap->FullSequence('HSERPG');
      >
      >
      > # with the use of ->service the result is always empty :(
      > if ($result) {
      > print $result->result();
      > } else
      >
      > print "EMPTY!!!!\n\n";
      > }
      >
      >
      > Thank you very much for your time!
      >
      > With kind regards,
      >
      > --
      > drs. Jean-Jack M. Riethoven
      >
      > EMBL Outstation - Hinxton pow@... ICQ#: 3433929
      > European Bioinformatics Institute Phone: (+44) 1223 494635
      > Wellcome Trust Genome Campus Fax : (+44) 1223 494468
      > Hinxton, Cambridge CB10 1SD URL :
      > http://industry.ebi.ac.uk/
      > UNITED KINGDOM
      >
      > Need to find bioinformatics or molecular biology web sites or
      > resources?
      > Use BioWurld at http://www.ebi.ac.uk/biowurld
      >
      >
      > ------------------------ Yahoo! Groups Sponsor
      >
      > To unsubscribe from this group, send an email to:
      > soaplite-unsubscribe@yahoogroups.com
      >
      >
      >
      > Your use of Yahoo! Groups is subject to
      > http://docs.yahoo.com/info/terms/
      >
      >


      __________________________________________________
      Do You Yahoo!?
      Get email alerts & NEW webcam video instant messaging with Yahoo! Messenger
      http://im.yahoo.com
    • Show all 8 messages in this topic