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

Re: Re: [soaplite] custom fault generates error 500

Expand Messages
  • Duncan Cameron
    ... Sorry to respond to my own posts ... I can confirm that the ö character does cause a 500 Internal Server Error , and that if the character is removed
    Message 1 of 5 , Jul 1, 2004
    • 0 Attachment
      At 2004-07-01, 12:20:28 Duncan Cameron <duncan_cameron2002@...> wrote:

      >At 2004-07-01, 11:57:05 you wrote:
      >
      >>Hi,
      >>
      >>my soapserver should generate customized faults as described in
      >>http://cookbook.soaplite.com/#soap%20faults
      >>So I have a test-function on the server:
      >>
      >>sub make_fail{
      >> #generiert SOAP-Fehler
      >> die SOAP::Fault->faultcode('Server.Custom')
      >> ->faultstring('Böser Fehler')
      >> ->faultdetail('Aber gewollt!');
      >>}
      >>
      >>my client:
      >>-------------------------------------
      >>[...]
      >>my $call=SOAP::Lite
      >> -> uri('urn:simple_o')
      >> -> proxy ('http://localhost:8081/simple_o ');
      >>
      >>my $res = eval{
      >> $call->make_fail;
      >>};
      >>
      >>if($@){
      >> print STDERR "Fehler bei Ausführung: ".join("\n",$@,'');
      >> exit;
      >>}
      >>
      >>if(defined($res)
      >>[...]
      >>---------------------------------------
      >>
      >>My client says:
      >>Fehler bei Ausführung: 500 Internal Server Error at
      >>./simple_client.pl line 36
      >>
      >>The response from the server seems OK:
      >>
      >><?xml version="1.0" encoding="UTF-8"?><SOAP-ENV:Envelope
      >>xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance"
      >>xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
      >>xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
      >>xmlns:xsd="http://www.w3.org/1999/XMLSchema"
      >>SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><SOAP-ENV:Fault><faultcode>SOAP-ENV:Server.Custom</faultcode><faultstring>Böser
      >>Fehler</faultstring><detail xsi:type="xsd:string">Aber
      >>gewollt!</detail><faultactor>http://localhost:8081/</faultactor></SOAP-ENV:Fault></SOAP-ENV:Body></SOAP-ENV:Envelope>
      >>
      >>
      >>But there is no result-object ($res) generated.
      >>Any idea?
      >
      >From your example you appear to be sending back a literal ö character which is not valid
      >UTF-8. This will cause a problem when the SOAP message is parsed which might be causing
      >your problem.
      >Can you try setting your fault strings to be simple ASCII to see whether that removes the
      >problem? If you want to send ISO-8859-1 characters then you need to change the XML
      >declaration using the encoding() method.

      Sorry to respond to my own posts ...

      I can confirm that the ö character does cause a "500 Internal Server Error", and that if the
      character is removed then Jens approach does work, i.e. $@ is false, $res is defined
      and $res->fault contains the fault generated by his server.

      Regards
      Duncan
    • Jens Puruckherr
      ... That s it! Thanks! ... Mit freundlichen Grüßen Jens Puruckherr
      Message 2 of 5 , Jul 1, 2004
      • 0 Attachment
        dcameron@... schreibt:
        >
        >From your example you appear to be sending back a literal ö
        >character which is not valid UTF-8. This will cause a problem when
        >the SOAP message is parsed which might be causing your problem.
        >Can you try setting your fault strings to be simple ASCII to see
        >whether that removes the problem? If you want to send ISO-8859-1
        >characters then you need to change the XML declaration using the
        >encoding() method.


        That's it!
        Thanks!
        >

        Mit freundlichen Grüßen

        Jens Puruckherr
      Your message has been successfully submitted and would be delivered to recipients shortly.