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

Re: [soaplite] again: "Transport is not specified" with wsdl file

Expand Messages
  • Byrne Reese
    This sounds like a bug to me that I need to work on - but I think I have a work around. Let me know if this works: #!/usr/local/bin/perl -w use SOAP::Lite; use
    Message 1 of 2 , Oct 21, 2004
      This sounds like a bug to me that I need to work on - but I think I have
      a work around. Let me know if this works:

      #!/usr/local/bin/perl -w
      use SOAP::Lite;

      use SOAP::Lite;
      my $client = SOAP::Lite
      ->on_fault( sub {
      my($soap, $res) = @_;
      die ref "error: " . $res ? $res->faultstring :
      $res->transport->status . "\n";
      });

      $client->service('https://www.prager.ws/sTest.wsdl')
      <https://www.prager.ws/sTest.wsdl%27,>->actionLog("bernd", "4711");

      If it does I think I may have an answer...

      Bernd Prager wrote:

      >
      > I found an old message from somebody who seemed to have the same
      > problem and Byrne suggested that a "location" was not specified in the
      > wsdl file but this doesn't seem the case here with me.
      > I set up a simple server:
      >
      > - snip -------------
      > #!/usr/local/bin/perl -w
      > use strict;
      > use SOAP::Transport::HTTP;
      >
      > SOAP::Transport::HTTP::CGI
      > -> dispatch_to('Test')
      > -> handle;
      >
      > package Test;
      >
      > sub actionLog {
      > my ($class, $user, $action) = @_;
      > open(LOG, ">>test.log") || die "Unable to open logfile:$!\n";
      > print LOG $user . ", " . $ENV{'REMOTE_ADDR'} . ", " . $action .
      > "\n";
      > close LOG;
      > return;
      > }
      > - snip -------------
      >
      > I can access the server with uri and proxy definition.
      > But when I use the service definition I get the error message:
      > "Transport is not specified (using proxy() method or service
      > description)"
      > Here's the wsdl file:
      >
      > - snip -------------
      > <?xml version="1.0" encoding="UTF-8"?>
      > <definitions xmlns:tns="http://www.prager.ws/sTest.wsdl"
      > xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
      > xmlns:http="http://schemas.xmlsoap.org/wsdl/http/"
      > xmlns:xsd="http://www.w3.org/2001/XMLSchema"
      > xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
      > xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/"
      > xmlns="http://schemas.xmlsoap.org/wsdl/"
      > targetNamespace="http://www.prager.ws/sTest.wsdl" name="Test">
      > <types>
      > <xsd:schema/>
      > </types>
      > <message name="logMessage">
      > <part name="user" type="xsd:string"/>
      > <part name="action" type="xsd:string"/>
      > </message>
      > <portType name="TestPortType">
      > <operation name="actionLog">
      > <input message="tns:logMessage"/>
      > </operation>
      > </portType>
      > <binding name="TestBinding" type="tns:TestPortType">
      > <soap:binding style="rpc"
      > transport="http://schemas.xmlsoap.org/soap/http"/>
      > <operation name="actionLog">
      > <soap:operation soapAction="urn:Test#actionLog"/>
      > <input>
      > <soap:body use="literal" namespace="urn:Test"/>
      > </input>
      > </operation>
      > </binding>
      > <service name="Test">
      > <port name="TestSoap" binding="tns:TestBinding">
      > <soap:address
      > location="https://www.prager.ws/cgi-bin/test.cgi"/>
      > </port>
      > </service>
      > </definitions>
      > - snip -------------
      >
      > This is my test program:
      >
      > - snip -------------
      > #!/usr/local/bin/perl -w
      > use SOAP::Lite;
      >
      > use SOAP::Lite
      > service => 'https://www.prager.ws/sTest.wsdl',
      > <https://www.prager.ws/sTest.wsdl%27,>
      > on_fault => sub {
      > my($soap, $res) = @_;
      > die ref "error: " . $res ? $res->faultstring :
      > $res->transport->status . "\n";
      > }
      > ;
      >
      > actionLog("bernd", "4711");
      > - snip -------------
      >
      > Is my wsdl file broken or do I define the service in the client
      > incorrect? Can somebody please tell me what I miss here?
      > Thanks for any help.
      > -- Bernd
    Your message has been successfully submitted and would be delivered to recipients shortly.