From: Alceu R. de F. Jr. <gla...@ya...> - 2011-05-11 20:23:35
|
Hello there, My name is Alceu and I'm a newbie with SOAP::Lite. I was adding some parameter validation in server side and follow the explanations on http://cookbook.soaplite.com/#soap%20faults about how to setup error codes to give better explanations about the invalid parameters. Everything looks fine, but I'm alway getting an HTTP 500 error in the HTTP header: SOAP::Transport::HTTP::Client::send_receive: HTTP::Response=HASH(0x136a3fc) SOAP::Transport::HTTP::Client::send_receive: HTTP/1.1 500 Internal Server Error Connection: close Date: Wed, 27 Apr 2011 15:48:08 GMT Server: Apache/2.2.17 (Win32) Content-Length: 637 Content-Type: text/xml; charset=utf-8 Client-Date: Wed, 27 Apr 2011 15:48:09 GMT Client-Peer: 127.0.0.1:80 Client-Response-Num: 1 SOAPServer: SOAP::Lite/Perl/0.712 <?xml version="1.0" encoding="UTF-8"?><soap:Envelope xmlns:namesp1="http://namespaces.soaplite.com/perl" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:soapenc="http://schemas.xmlsoap.org/so ap/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:Server.Custom</faultcode><faultstring>Invalid state string: 'ef'</faultstring><detail><BadState xsi:type="namesp1:BadState"><code xsi:type="xsd:int">1</code></BadState></detail></soap:Fault> </soap:Body></soap:Envelope> While the SOAP fault code looks ok, I'm wondering if the HTTP header is the correct one. Of course this will happen (once I'm using the Perl die function in the CGI) but it seems to me more resonable that the HTTP error should be "400 Bad Request" since the server was able to process the request, but the parameter(s) is(are) invalid. So my first question is: should I worry about that? Question 2: if I should, how should I change that? I'm using SOAP::Transport::HTTP::CGI in the server side to process the requests. Thanks, Alceu |