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

Help need to make WSDL work

Expand Messages
  • ssriram_us
    Hi !. I have a soap client and server and am able to make the call to the soap service and get the results back. I am now trying to develop a wsdl doc that I
    Message 1 of 1 , Nov 28, 2005
    • 0 Attachment
      Hi !. I have a soap client and server and am able to make the call to
      the soap service and get the results back. I am now trying to develop
      a wsdl doc that I can give to the java and .net developers so that
      they can use the service.
      I tried creating a wsdl and a client in perl to access the wsdl doc
      and execute the method. I get this error message:
      <?xml version="1.0" encoding="UTF-8"?><SOAP-ENV:Envelope
      xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
      SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
      xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
      xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance"
      xmlns:xsd="http://www.w3.org/1999/XMLSchema"><SOAP-ENV:Body><SOAP-ENV:Fault><faultcode>SOAP-ENV:Client</faultcode><faultstring>Failed
      to locate method (capitalize) in class (Caps) at
      /ots/perl-5.6.1/lib/site_perl/SOAP/Lite.pm line 2337.
      </faultstring></SOAP-ENV:Fault></SOAP-ENV:Body></SOAP-ENV:Envelope>.

      For location on the wsdl doc I have the url to the soap_server.cgi
      file that does the dispatch to the method.

      My soap server looks like this:
      #!/usr/bin/perl -w

      use strict;

      use diagnostics;
      use SOAP::Transport::HTTP;
      use utf8;

      my $userid = $ENV{'REMOTE_USER'};
      SOAP::Transport::HTTP::CGI ->
      dispatch_to('/opt/dart/interface/') -> handle ;

      my soap client looks like this:

      #!/usr/bin/perl -w
      #

      use strict;
      use diagnostics;
      use SOAP::Lite;
      use SOAP::WSDL;
      #use SOAP::Header;

      my $result = 'xxxxx';
      SOAP::Lite->on_debug (sub{print STDERR @_});
      my $service= SOAP::Lite
      ->service ('http://epos.ca.com/dartinterface/Caps.wsdl');
      print $service->capitalize("Hello");

      WSDL looks like this:
      <?xml version="1.0"?>
      <definitions name="CapsService"
      targetNamespace="http://epos.ca.com/dartinterface/Caps.wsdl"
      xmlns:tns="http://epos.ca.com/dartinterface/Caps.wsdl"
      xmlns:xsd="http://www.w3.org/2001/XMLSchema"
      xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
      xmlns="http://schemas.xmlsoap.org/wsdl/">

      <message name="capitalizeRequest">
      <part name="word" type="xsd:string"/>
      </message>

      <message name="capitalizeResponse">
      <part name="return" type="xsd:string"/>
      </message>

      <portType name="CapsPortType">
      <operation name="Caps">
      <input message="tns:capitalizeRequest"/>
      <output message="tns:capitalizeResponse"/>
      </operation>
      </portType>

      <binding name="CapsBinding" type="tns:CapsPortType">
      <soap:binding style="rpc"
      transport="http://schemas.xmlsoap.org/soap/http"/>
      <operation name="capitalize">
      <soap:operation soapAction=""/>
      <input>
      <soap:body use="encoded" namespace="urn:Caps"
      encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
      </input>
      <output>
      <soap:body use="encoded" namespace="urn:Caps"
      encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
      </output>
      </operation>
      </binding>
      <service name="CapsService">
      <port name="CapsPort" binding="tns:CapsBinding">
      <soap:address
      location="http://epos.ca.com/dartinterface/example_server.cgi"/>
      </port>
      </service>
      </definitions>

      Has anyone got their perl web service working with wsdl?
      Any help/pointers would be greatly appreciated. I am kind of new to
      perl/WSDL/SOAP etc.,

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