SOAP::Lite and .wsdl files

Ask a Question related to PERL Modules, Design and Development.

  1. #1

    Default SOAP::Lite and .wsdl files

    Hi,

    I'm struggling with SOAP::Lite and using .wsdl files. Given the
    configuration shown below, what should be in these sections of the .wsdl
    file?

    <operation name="testWsdl">
    <soap:operation soapAction="??????????????????????????????????"/>
    <soap:address location="http://my.host.com/soap"/>

    Are there other aspects of Test.wsdl that aren't properly configured?

    I've tried many variations for the above and whatever I use I always get
    "Unrecognized method 'testWsdl'. List of available method(s):"
    with no list of available methods. I've also used +trace on SOAP::Lite
    and don't really get anything meaningful, at least to me.

    The only reason it's important to me to use the .wsdl files is that the
    service is intended for a .NET client.

    Thanks

    Dennis
    d underscore roesler at agilent dot com

    /home/droesler/client.pl
    -----------------------------------------------------------
    #!/bin/perl

    use strict;
    use warnings;
    use SOAP::Lite;

    my $var = $ARGV[0];

    # This works
    my $soap = SOAP::Lite
    -> proxy('http://my.host.com/soap/TestWsdl.cgi')
    -> uri('/MyPkgs/TestPkg');
    my $result = $soap->testWsdl($var);

    # This doesn't
    #my $result = SOAP::Lite
    # -> service('http://my.host.com/wsdl/Test.wsdl')
    # -> testWsdl('Hello World');

    unless ($result->fault) {
    print $result->result();
    } else {
    print join ', ',
    $result->faultcode,
    $result->faultstring;
    }

    __END__

    /opt/sdo/soap/MyPkgs/TestPkg.pm
    -------------------------------------------------------
    package MyPkgs::TestPkg;

    use strict;
    use warnings;
    require Exporter;
    our @ISA = qw(Exporter);
    our @EXPORT = qw(testWsdl);

    sub testWsdl {
    my ($class, $var) = @_;

    return SOAP::Data->name('Test')
    ->type('string')
    ->value("Test Passed: $var");
    }

    1;


    /opt/sdo/soap/TestWsdl.cgi
    ------------------------------------------------------
    #!/bin/perl

    use strict;
    use warnings;
    use SOAP::Transport::HTTP;
    use lib '/opt/sdo/soap';
    use MyPkgs::TestPkg;

    SOAP::Transport::HTTP::CGI
    -> dispatch_to('/opt/sdo/soap', 'MyPkgs::TestPkg')
    -> handle;


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

    <message name="TestRequest">
    <part name="var" type="xsd:string"/>
    </message>

    <message name="TestResponse">
    <part name="result" type="xsd:string"/>
    </message>

    <portType name="TestPortType">
    <operation name="testWsdl">
    <input message="tns:TestRequest"/>
    <output message="tns:TestResponse"/>
    </operation>
    </portType>

    <binding name="TestBinding" type="tns:TestPortType">
    <binding style="rpc"
    transport="http://schemas.xmlsoap.org/soap/http"/>
    <operation name="testWsdl">
    <soap:operation
    soapAction="??????????????????????????????????"/>
    <input>
    <soap:body use="literal"/>
    </input>
    <output>
    <soap:body use="literal"/>
    </output>
    </operation>
    </binding>

    <service name="testWsdl">
    <documentation>Testing Web Services with wsdl</documentation>
    <port name="TestPortType" binding="tns:TestBinding">
    <soap:address location="http://my.host.com/soap"/>
    </port>
    </service>
    </definitions>
    Dennis Roesler Guest

  2. Similar Questions and Discussions

    1. Using SOAP::Lite and .NET
      Hello, i have to access to informations in a PC and they are avaliable via a webservice in .NET. I do not know webservices but i thought they are...
    2. SOAP::Lite and WSDL namespace - please help
      Hi, I've been trying to send a request to a public SOAP server with SOAP::Lite with no success. Here's the WSDL specifications ->...
    3. Writing a HTML/ASP SOAP client for a SOAP::Lite destination
      How would I go about writing a SOAP client in either HTML or classic asp? The SOAP "listener" was written in Perl with SOAP::Lite in Unix and I am...
    4. SOAP::Lite
      Hi, I have been playing with SOAP::Lite for a while, and generally find that it is really very useful. So the other day I came across a problem...
    5. SOAP::Lite : Problem of # sign added by SOAP::Lite in the sent SOAPActionstring
      Hello, I have a problem with a SOAP client written in Perl (source at the end). I've tried both ways (by commenting TRIAL ONE or SECOND TRIAL),...
  3. #2

    Default Re: SOAP::Lite and .wsdl files

    Hi Dennis,

    I also face this problem. If you have the solution, plese share.
    Thanks.


    Quote Originally Posted by Dennis Roesler View Post
    Hi,

    I'm struggling with SOAP::Lite and using .wsdl files. Given the
    configuration shown below, what should be in these sections of the .wsdl
    file?

    <operation name="testWsdl">
    <soap:operation soapAction="??????????????????????????????????"/>
    <soap:address location="http://my.host.com/soap"/>

    Are there other aspects of Test.wsdl that aren't properly configured?

    I've tried many variations for the above and whatever I use I always get
    "Unrecognized method 'testWsdl'. List of available method(s):"
    with no list of available methods. I've also used +trace on SOAP::Lite
    and don't really get anything meaningful, at least to me.

    The only reason it's important to me to use the .wsdl files is that the
    service is intended for a .NET client.

    Thanks

    Dennis
    d underscore roesler at agilent dot com

    /home/droesler/client.pl
    -----------------------------------------------------------
    #!/bin/perl

    use strict;
    use warnings;
    use SOAP::Lite;

    my $var = $ARGV[0];

    # This works
    my $soap = SOAP::Lite
    -> proxy('http://my.host.com/soap/TestWsdl.cgi')
    -> uri('/MyPkgs/TestPkg');
    my $result = $soap->testWsdl($var);

    # This doesn't
    #my $result = SOAP::Lite
    # -> service('http://my.host.com/wsdl/Test.wsdl')
    # -> testWsdl('Hello World');

    unless ($result->fault) {
    print $result->result();
    } else {
    print join ', ',
    $result->faultcode,
    $result->faultstring;
    }

    __END__

    /opt/sdo/soap/MyPkgs/TestPkg.pm
    -------------------------------------------------------
    package MyPkgs::TestPkg;

    use strict;
    use warnings;
    require Exporter;
    our @ISA = qw(Exporter);
    our @EXPORT = qw(testWsdl);

    sub testWsdl {
    my ($class, $var) = @_;

    return SOAP::Data->name('Test')
    ->type('string')
    ->value("Test Passed: $var");
    }

    1;


    /opt/sdo/soap/TestWsdl.cgi
    ------------------------------------------------------
    #!/bin/perl

    use strict;
    use warnings;
    use SOAP::Transport::HTTP;
    use lib '/opt/sdo/soap';
    use MyPkgs::TestPkg;

    SOAP::Transport::HTTP::CGI
    -> dispatch_to('/opt/sdo/soap', 'MyPkgs::TestPkg')
    -> handle;


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

    <message name="TestRequest">
    <part name="var" type="xsd:string"/>
    </message>

    <message name="TestResponse">
    <part name="result" type="xsd:string"/>
    </message>

    <portType name="TestPortType">
    <operation name="testWsdl">
    <input message="tns:TestRequest"/>
    <output message="tns:TestResponse"/>
    </operation>
    </portType>

    <binding name="TestBinding" type="tns:TestPortType">
    <binding style="rpc"
    transport="http://schemas.xmlsoap.org/soap/http"/>
    <operation name="testWsdl">
    <soap:operation
    soapAction="??????????????????????????????????"/>
    <input>
    <soap:body use="literal"/>
    </input>
    <output>
    <soap:body use="literal"/>
    </output>
    </operation>
    </binding>

    <service name="testWsdl">
    <documentation>Testing Web Services with wsdl</documentation>
    <port name="TestPortType" binding="tns:TestBinding">
    <soap:address location="http://my.host.com/soap"/>
    </port>
    </service>
    </definitions>
    Unregistered Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139