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

SOAPAction shall match 'uri#method' if present

Expand Messages
  • Bernd Prager
    I have a small server sript that I try to acces via wsdl service: - snip ------------ #!/usr/local/bin/perl -w use strict; use SOAP::Transport::HTTP;
    Message 1 of 2 , Oct 25, 2004
    • 0 Attachment
      I have a small server sript that I try to acces via wsdl service:
      - snip ------------
      #!/usr/local/bin/perl -w
      use strict;
      use SOAP::Transport::HTTP;

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

      package MyTest;

      sub actionLog {
      my ($class, $user, $action) = @_;
      my ($sec, $min, $hour, $mday, $mon, $year, $wday, $yday, $isday) =
      localtime(time);
      my $time = sprintf("%02d-%02d-%02d %02d:%02d:%02d", ($year%100),
      $mon + 1, $mday, $hour, $min, $sec);
      open(LOG, ">>MyTest.log") || die "Unable to open logfile:$!\n";
      print LOG $time . ": " . $user . ", " . $ENV{'REMOTE_ADDR'} . ", " .
      $action . "\n";
      close LOG;
      return;
      }
      - snip ------------
      The wsdl file looks like that:
      - snip ------------
      <?xml version="1.0" encoding="UTF-8"?>
      <definitions xmlns="http://schemas.xmlsoap.org/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:y="urn:MyTest" targetNamespace="urn:MyTest">
      <types>
      <xsd:schema/>
      </types>
      <message name="logMessage">
      <part name="user" type="xsd:string"/>
      <part name="action" type="xsd:string"/>
      </message>
      <portType name="MyTestPort">
      <operation name="actionLog">
      <input message="y:logMessage"/>
      </operation>
      </portType>
      <binding name="MyTestBinding" type="y:MyTestPort">
      <soap:binding style="rpc"
      transport="http://schemas.xmlsoap.org/soap/http"/>
      <operation name="actionLog">
      <soap:operation
      soapAction="urn:MyTest#actionLog"/>
      <input>
      <soap:body use="literal"/>
      </input>
      </operation>
      </binding>
      <service name="MyTest">
      <port name="MyTestSoap" binding="y:MyTestBinding">
      <soap:address
      location="http://www.prager.ws/cgi-bin/myTest.cgi"/>
      </port>
      </service>
      </definitions>
      - snip ------------
      When I try to acces this service with following client
      - snip ------------
      #!/usr/bin/perl -w
      use SOAP::Lite +debug;
      use strict;


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

      $client
      ->service('http://www.prager.ws/MyTest.wsdl')
      ->actionLog("bernd", "4711");
      ~
      - snip ------------
      1) I don't get a normal error message.
      2) When I turn on debug I get following snippet:
      - snip ------------
      SOAPAction: "urn:MyTest#actionLog"

      <?xml version="1.0" encoding="UTF-8"?><soap:Envelope
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
      xmlns:xsd="http://www.w3.org/2001/XMLSchema"
      soap:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
      xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"><soap:Body><actionLog
      xmlns=""><user xsi:type="xsd:string">bernd</user><action
      xsi:type="xsd:string">4711</action></actionLog></soap:Body></soap:Envelope>
      SOAP::Transport::HTTP::Client::send_receive:
      HTTP::Response=HASH(0x8601370)
      SOAP::Transport::HTTP::Client::send_receive: HTTP/1.1 500 Internal
      Server Error
      Connection: close
      Date: Mon, 25 Oct 2004 16:44:04 GMT
      Server: Apache/2.0.52 (Debian GNU/Linux) mod_ssl/2.0.52 OpenSSL/0.9.7d
      Content-Length: 551
      Content-Type: text/xml; charset=utf-8
      Client-Date: Mon, 25 Oct 2004 16:44:04 GMT
      Client-Peer: 127.0.0.1:80
      Client-Response-Num: 1
      SOAPServer: SOAP::Lite/Perl/0.65

      <?xml version="1.0" encoding="UTF-8"?><soap:Envelope
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
      xmlns:xsd="http://www.w3.org/2001/XMLSchema"
      soap:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
      xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"><soap:Body><soap:Fault><faultcode>soap:Client</faultcode><faultstring>SOAPAction
      shall match 'uri#method' if present (got 'urn:MyTest#actionLog',
      expected '#actionLog'
      </faultstring></soap:Fault></soap:Body></soap:Envelope>
      - snip ------------

      But I've been told that the "soapAction" attribute should contain the
      Perl package module. Is this a bug or do I have to add the Package
      somewhere else in my wsdl file?

      Thanks for any help guys,
      -- Bernd
    • Byrne Reese
      You have two options: a) change the soapAction to MyTest#actionLog in the wsdl/client b) change dispatch_to in your server class to: - dispatch_with({
      Message 2 of 2 , Nov 14, 2004
      • 0 Attachment
        You have two options:

        a) change the soapAction to MyTest#actionLog in the wsdl/client
        b) change dispatch_to in your server class to:

        ->dispatch_with({ 'urn:MyTest' => 'MyTest' })

        Bernd Prager wrote:

        > I have a small server sript that I try to acces via wsdl service:
        > - snip ------------
        > #!/usr/local/bin/perl -w
        > use strict;
        > use SOAP::Transport::HTTP;
        >
        > SOAP::Transport::HTTP::CGI
        > -> dispatch_to('MyTest')
        > -> handle;
        >
        > package MyTest;
        >
        > sub actionLog {
        > my ($class, $user, $action) = @_;
        > my ($sec, $min, $hour, $mday, $mon, $year, $wday, $yday, $isday) =
        > localtime(time);
        > my $time = sprintf("%02d-%02d-%02d %02d:%02d:%02d", ($year%100),
        > $mon + 1, $mday, $hour, $min, $sec);
        > open(LOG, ">>MyTest.log") || die "Unable to open logfile:$!\n";
        > print LOG $time . ": " . $user . ", " . $ENV{'REMOTE_ADDR'} . ", " .
        > $action . "\n";
        > close LOG;
        > return;
        > }
        > - snip ------------
        > The wsdl file looks like that:
        > - snip ------------
        > <?xml version="1.0" encoding="UTF-8"?>
        > <definitions xmlns="http://schemas.xmlsoap.org/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:y="urn:MyTest" targetNamespace="urn:MyTest">
        > <types>
        > <xsd:schema/>
        > </types>
        > <message name="logMessage">
        > <part name="user" type="xsd:string"/>
        > <part name="action" type="xsd:string"/>
        > </message>
        > <portType name="MyTestPort">
        > <operation name="actionLog">
        > <input message="y:logMessage"/>
        > </operation>
        > </portType>
        > <binding name="MyTestBinding" type="y:MyTestPort">
        > <soap:binding style="rpc"
        > transport="http://schemas.xmlsoap.org/soap/http"/>
        > <operation name="actionLog">
        > <soap:operation
        > soapAction="urn:MyTest#actionLog"/>
        > <input>
        > <soap:body use="literal"/>
        > </input>
        > </operation>
        > </binding>
        > <service name="MyTest">
        > <port name="MyTestSoap" binding="y:MyTestBinding">
        > <soap:address
        > location="http://www.prager.ws/cgi-bin/myTest.cgi"/>
        > </port>
        > </service>
        > </definitions>
        > - snip ------------
        > When I try to acces this service with following client
        > - snip ------------
        > #!/usr/bin/perl -w
        > use SOAP::Lite +debug;
        > use strict;
        >
        >
        > my $client = SOAP::Lite
        > ->on_fault( sub {
        > my ($soap, $res) = @_;
        > die ref "error: " . $res ? $res->faultstring :
        > $res->transport->status . "\n";
        > });
        >
        > $client
        > ->service('http://www.prager.ws/MyTest.wsdl')
        > <http://www.prager.ws/MyTest.wsdl%27%29>
        > ->actionLog("bernd", "4711");
        > ~
        > - snip ------------
        > 1) I don't get a normal error message.
        > 2) When I turn on debug I get following snippet:
        > - snip ------------
        > SOAPAction: "urn:MyTest#actionLog"
        >
        > <?xml version="1.0" encoding="UTF-8"?><soap:Envelope
        > xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        > xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
        > xmlns:xsd="http://www.w3.org/2001/XMLSchema"
        > soap:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
        > xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"><soap:Body><actionLog
        > xmlns=""><user xsi:type="xsd:string">bernd</user><action
        > xsi:type="xsd:string">4711</action></actionLog></soap:Body></soap:Envelope>
        > SOAP::Transport::HTTP::Client::send_receive:
        > HTTP::Response=HASH(0x8601370)
        > SOAP::Transport::HTTP::Client::send_receive: HTTP/1.1 500 Internal
        > Server Error
        > Connection: close
        > Date: Mon, 25 Oct 2004 16:44:04 GMT
        > Server: Apache/2.0.52 (Debian GNU/Linux) mod_ssl/2.0.52 OpenSSL/0.9.7d
        > Content-Length: 551
        > Content-Type: text/xml; charset=utf-8
        > Client-Date: Mon, 25 Oct 2004 16:44:04 GMT
        > Client-Peer: 127.0.0.1:80
        > Client-Response-Num: 1
        > SOAPServer: SOAP::Lite/Perl/0.65
        >
        > <?xml version="1.0" encoding="UTF-8"?><soap:Envelope
        > xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        > xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
        > xmlns:xsd="http://www.w3.org/2001/XMLSchema"
        > soap:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
        > xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"><soap:Body><soap:Fault><faultcode>soap:Client</faultcode><faultstring>SOAPAction
        > shall match 'uri#method' if present (got 'urn:MyTest#actionLog',
        > expected '#actionLog'
        > </faultstring></soap:Fault></soap:Body></soap:Envelope>
        > - snip ------------
        >
        > But I've been told that the "soapAction" attribute should contain the
        > Perl package module. Is this a bug or do I have to add the Package
        > somewhere else in my wsdl file?
        >
        > Thanks for any help guys,
        > -- Bernd
      Your message has been successfully submitted and would be delivered to recipients shortly.