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

trying to provide a WSDL for my web service

Expand Messages
  • Ian Harisay
    I have a very simple test web service. I can call it successfully without using the WSDL. When I try to use the WSDL it throws an error. I m guessing there is
    Message 1 of 2 , Sep 20, 2007
    • 0 Attachment
      I have a very simple test web service. I can call it successfully
      without using the WSDL. When I try to use the WSDL it throws an error.
      I'm guessing there is something wrong with WSDL itself. I sure could
      use some help here. I just don't see what I am doing wrong.

      Thanks.

      -- test service script --
      #!/usr/bin/perl

      use strict;
      use Data::Dumper;
      use SOAP::Lite;
      use IO::File;

      my $proxy = 'http://harisay.com/ws/ews/hello_service.cgi';
      my $uri = 'http://harisay.com/HelloService';

      #-- call to web service without a WSDL
      print SOAP::Lite
      ->uri($uri)
      ->proxy($proxy)
      ->sayHelloWorld()
      ->result;
      print $/;

      #-- call to web service using a WSDL.
      my $service = SOAP::Lite
      ->service('http://harisay.com/wsdl/HelloService.wsdl');

      print ref $service,$/;
      #print Dumper($service);
      print $service->sayHelloWorld();
      print $/;

      exit;
      -- end script --
    • Paul Gallagher
      Hi Ian, I think the problem is that SOAP::Lite assumes an input message (although not required by the spec). Try something like this ... seems to work:
      Message 2 of 2 , Sep 23, 2007
      • 0 Attachment
        Hi Ian,

        I think the problem is that SOAP::Lite assumes an input message
        (although not required by the spec).

        Try something like this ... seems to work:

        <?xml version="1.0" encoding="UTF-8"?>
        <definitions name="HelloService"
        targetNamespace="http://harisay.com/HelloService"
        xmlns="http://schemas.xmlsoap.org/wsdl/"
        xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
        xmlns:tns="http://harisay.com/HelloService"
        xmlns:xsd="http://www.w3.org/2001/XMLSchema">

        <message name="SayHelloWorldRequest"/>

        <message name="SayHelloWorldResponse">
        <part name="greeting" type="xsd:string"/>
        </message>

        <portType name="HelloPortType">
        <operation name="sayHelloWorld" parameterOrder="name">
        <input message="tns:SayHelloWorldRequest"
        name="sayHelloWorldRequest" />
        <output message="tns:SayHelloWorldResponse"
        name="sayHelloWorldResponse" />
        </operation>
        </portType>

        <binding name="HelloBinding" type="tns:HelloPortType">
        <soap:binding style="rpc"
        transport="http://schemas.xmlsoap.org/soap/http"/>
        <operation name="sayHelloWorld">
        <soap:operation
        soapAction="http://harisay.com/HelloService#sayHelloWorld"/>

        <input name="sayHelloWorldRequest">
        <soap:body
        encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
        namespace="http://harisay.com/HelloService"
        use="encoded" />
        </input>

        <output name="sayHelloWorldResponse">
        <soap:body
        encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
        namespace="http://harisay.com/HelloService"
        use="encoded"/>
        </output>
        </operation>
        </binding>

        <service name="Hello_Service">
        <documentation>WSDL File for HelloService</documentation>
        <port binding="tns:HelloBinding" name="HelloPort">
        <soap:address
        location="http://harisay.com/ws/ews/hello_service.cgi"/>
        </port>
        </service>

        </definitions>



        On 9/21/07, Ian Harisay <imharisa@...> wrote:
        > I have a very simple test web service. I can call it successfully
        > without using the WSDL. When I try to use the WSDL it throws an error.
        > I'm guessing there is something wrong with WSDL itself. I sure could
        > use some help here. I just don't see what I am doing wrong.
        >
        > Thanks.
        >
        > -- test service script --
        > #!/usr/bin/perl
        >
        > use strict;
        > use Data::Dumper;
        > use SOAP::Lite;
        > use IO::File;
        >
        > my $proxy = 'http://harisay.com/ws/ews/hello_service.cgi';
        > my $uri = 'http://harisay.com/HelloService';
        >
        > #-- call to web service without a WSDL
        > print SOAP::Lite
        > ->uri($uri)
        > ->proxy($proxy)
        > ->sayHelloWorld()
        > ->result;
        > print $/;
        >
        > #-- call to web service using a WSDL.
        > my $service = SOAP::Lite
        > ->service('http://harisay.com/wsdl/HelloService.wsdl');
        >
        > print ref $service,$/;
        > #print Dumper($service);
        > print $service->sayHelloWorld();
        > print $/;
        >
        > exit;
        > -- end script --
        >
        >
        >
        > Yahoo! Groups Links
        >
        >
        >
        >
      Your message has been successfully submitted and would be delivered to recipients shortly.