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 |
From: Thorsten S. <tsc...@am...> - 2011-05-12 07:14:33
|
Guten Tag Alceu R. de Freitas Jr., am Mittwoch, 11. Mai 2011 um 22:23 schrieben Sie: > 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. The request itself was OK and that what's the status code 400 focuses on, your error is on application level. > So my first question is: should I worry about that? > Question 2: if I should, how should I change that? In this case you shouldn't worry nor change, every framework and programming language I know of can handle at least 500. If you want to change the status code sent you first should really look at your clients and make sure they can handle anything else. Remember that webservices are made for interoperability and sometimes this just means to not use everything what might be possible. In our software for example we started to use Perl and SOAP::Lite on sevrer and client side and didn't care about datatypes, proper encoding of data etc. It just worked because SOAP::Lite handled it all. Some years late we really have a hard time to support Java, C++, C#, publish a WSDL and so on. No we think twice on any change. :-) Mit freundlichen Grüßen, Thorsten Schöning -- Thorsten Schöning AM-SoFT IT-Systeme - Hameln | Potsdam | Leipzig Telefon: Potsdam: 0331-743881-0 E-Mail: tsc...@am... Web: http://www.am-soft.de AM-SoFT GmbH IT-Systeme, Konsumhof 1-5, 14482 Potsdam Amtsgericht Potsdam HRB 21278 P, Geschäftsführer: Andreas Muchow |
From: Thorsten S. <tsc...@am...> - 2011-05-13 14:06:02
|
Guten Tag Alceu Rodrigues de Freitas Junior, am Freitag, 13. Mai 2011 um 15:12 schrieben Sie: > I had to use SOAPUi to validate the WSDL and Eclipse to generate an > structure that were close of what I was doing to find several small > issues regarding namespaces. > After I finally got something usable by .Net, the WSDL was not working > anymore in my SOAP::Lite client. > There is any hope to get things working for both platforms? Sorry, but we don't use our own WSDL for Perl right now, it's only for C++ and .NET and therefore hand coded like you said using Eclipse and SoapUI. Therefore I have no experience in namespaces differences or stuff like that using the WSDL in Perl and .NET. I just tried to let Eclipse do what it means is necessary during binding and this worked for my customers. Our real problem was to make the Perl server send what is stated in the WSDL. :-) Mit freundlichen Grüßen, Thorsten Schöning -- Thorsten Schöning AM-SoFT IT-Systeme - Hameln | Potsdam | Leipzig Telefon: Potsdam: 0331-743881-0 E-Mail: tsc...@am... Web: http://www.am-soft.de AM-SoFT GmbH IT-Systeme, Konsumhof 1-5, 14482 Potsdam Amtsgericht Potsdam HRB 21278 P, Geschäftsführer: Andreas Muchow |