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

How to Generate WSDL file for SOAP::Lite Server

Expand Messages
  • sheikmohamed7
    Hi Guys, I am new to this group.I am facing problem of generating wsdl for SOAP Server using SOAP::Lite.and where to put this WSDL file ,and how to access
    Message 1 of 1 , Nov 11, 2004
    • 0 Attachment
      Hi Guys,
      I am new to this group.I am facing problem of generating wsdl
      for SOAP Server using SOAP::Lite.and where to put this WSDL file ,and
      how to access this WSDL file.
      I have generated simple SOAP Server for sayHello ,hello.cgi ,I have
      stored that in my Apache server /var/www/cgi-bin/sheik/hello.cgi,
      I can access this by my perl client

      use SOAP::Lite(+trace=>all);
      my $name = shift;
      print "\n\nCalling the SOAP Server to say hello\n\n";
      print "The SOAP Server says: ";
      print SOAP::Lite
      -> uri('urn:Hello')
      -> proxy('http://192.10.10.4/cgi-bin/sheik/hello.cgi')
      ->sayHello()->result;

      Which displays the results.

      My SOAP Server is

      Hello.pm
      --------
      #!/usr/bin/perl -w

      package Hello;

      sub sayHello {
      return "Hello";
      }
      1;
      hello.cgi
      ---------
      #!/usr/bin/perl

      #hello.cgi - Hello SOAP handler

      use SOAP::Transport::HTTP;
      use Hello;
      SOAP::Transport::HTTP::CGI->dispatch_to('Hello')->handle;


      Here my wsdl i dont know which is right or not
      HelloAgain.wsdl
      ---------------
      I stored this in /var/www/html/HelloAgain.wsdl
      <?xml version="1.0" encoding="UTF-8"?>

      <definitions name="http://192.10.10.4"
      targetNamespace="http://192.10.10.4/"
      xmlns:tns="http://192.10.10.4/HelloAgain.wsdl"
      xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
      xmlns:xsd="http://www.w3.org/2001/XMLSchema"
      xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
      xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
      xmlns="http://schemas.xmlsoap.org/wsdl/">

      <message name="GetWordsResponse">
      <part name="symbol" type="xsd:string"/>
      </message>

      <portType name="HelloAgainPortType">
      <operation name="sayHello">
      <output message="tns:GetWordsResponse"/>
      </operation>
      </portType>

      <binding name="HelloAgainBinding" type="tns:HelloAgainPortType">
      <soap:binding style="rpc"
      transport="http://schemas.xmlsoap.org/soap/http"/>
      <operation name="sayHello">
      <soap:operation soapAction="http://102.10.10.4"/>
      <output><soap:body use="encoded"
      namespace="http://192.10.10.4/"
      encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/></output>
      </operation>
      </binding>
      <service name="HelloAgain">
      <documentation>ApniUrdu.com Translation
      Service</documentation>
      <port name="HelloAgainPort"
      binding="tns:HelloAgainBinding">
      <soap:address
      location="http://192.10.10.4:80/cgi-bin/sheik/hello.cgi"/>
      </port>
      </service>
      </definitions>

      I am accessing this thru perl Client


      clientHelloWsdl.pl
      ------------------
      #!/usr/bin/perl -w
      #client.pl - Hello client
      use SOAP::Lite(+trace=>all);
      my $name = shift;
      print "\n\nCalling the SOAP Server to say hello\n\n";
      print "The SOAP Server says: ";
      $soap=SOAP::Lite->uri('http://192.10.10.4/HelloAgain.wsdl')
      ->proxy('http://192.10.10.4/HelloAgain.wsdl');

      print $soap->sayHello()->result();

      I am getting error like this

      <HTML><HEAD>
      <TITLE>405 Method Not Allowed</TITLE>
      </HEAD><BODY>
      <H1>Method Not Allowed</H1>
      The requested method POST is not allowed for the URL /HelloAgain.wsdl.<P>
      <HR>
      <ADDRESS>Apache/1.3.23 Server at vaigai.ceruleaninfotech.com Port
      80</ADDRESS>
      </BODY></HTML>

      Really I am weak in WSDL generation .You guys are strong in this subject.
      I need to know ,Where to put wsdl files in Apache server.
      Is there any tool available for wsdl file generation.
      If we are using wsdl file then ,we need additional configuration in
      apache server .

      Please help me to overcome this issue.

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