Re: [Axis2][1.0] Handling HTTP 500 errors for input only requests!
Hi, Does anyone have a solution or knowledge about this? It's really a big problem as it can cause message loss. For example, if request doesn't pass the security check, service sends a soap fault back wrapped in HTTP 500. However, generated client code doesn't do anything with it. Therefore, client application assumes that its request accepted. In this scenario, neither the client nor the server knows the problem since there is no exception thrown in either side. It would be great, if someone was kind enough to respond my post. Thanks in advance. Ali Sadik Kumlali --- Ali Sadik Kumlali [EMAIL PROTECTED] wrote: Hi again, I've found that org.apache.axis2.transport.http.AbstractHTTPSender really doesn't care about the HTTP status code returned by the service. Here is the code: - // org.apache.axis2.transport.http.AbstractHTTPSender protected void executeMethod(...) throws IOException { HostConfiguration config = this.getHostConfiguration(...); msgContext.setProperty(HTTPConstants.HTTP_METHOD, method); ... // --- // executeMethod returns back 202, 500, etc. but // it is not handled! // --- httpClient.executeMethod(config, method); } - Is it on purpose? If yes, could you please answer my previous questions? Thanks a lot. Ali Sadik Kumlali --- Ali Sadik Kumlali [EMAIL PROTECTED] wrote: Hi all, The subject may seem contradictory, as it has both input only and return words together :) Here is the scenario: - In my WSDL, all the operations have input message only. Therefore, I assume that I have input only services. - WSDL2Java generates *MessageReceiverInOnly as expected. Therefore, I beleive, my first assumption is confirmed. - I add InflowSecurity in service.xml. Therefore, my service requires security headers. - I don't add OutflowSecurity in the axis2.xml at the client side. (This is made deliberately to cause the server throwing missing security headers exception.) - I send request by calling generated test code. - All the messages goes through TCP/IP Monitor. - Request doesn't have security headers as expected. - Server sends a SOAPFault back to the client. (HTTP header says HTTP/1.1 500 Internal Server Error) - However, client doesn't do anything with this exception, although it successfully receives the whole message. Here are the questions: - Is this expected behavior? - If yes, why the server send soap fault for the in-only message? - Does the client only wait for *any* HTTP response without actually caring about what the header is? Or, does it behave differently but not for HTTP 500? - I saw the ReplyTo header in the request. Spec says ReplyTo is optional for in-only messages. What purposes Axis2 set it for? Thanks for your reading efforts :) Ali Sadik Kumlali __ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com __ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com __ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com
Re: [Axis2][1.0] Handling HTTP 500 errors for input only requests!
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Ali Sadik Kumlali wrote: Hi again, I've found that org.apache.axis2.transport.http.AbstractHTTPSender really doesn't care about the HTTP status code returned by the service. Here is the code: - // org.apache.axis2.transport.http.AbstractHTTPSender protected void executeMethod(...) throws IOException { HostConfiguration config = this.getHostConfiguration(...); msgContext.setProperty(HTTPConstants.HTTP_METHOD, method); ... // --- // executeMethod returns back 202, 500, etc. but // it is not handled! // --- httpClient.executeMethod(config, method); } - Is it on purpose? If yes, could you please answer my previous questions? Thanks a lot. Ali Sadik Kumlali --- Ali Sadik Kumlali [EMAIL PROTECTED] wrote: Hi all, The subject may seem contradictory, as it has both input only and return words together :) Here is the scenario: - In my WSDL, all the operations have input message only. Therefore, I assume that I have input only services. - WSDL2Java generates *MessageReceiverInOnly as expected. Therefore, I beleive, my first assumption is confirmed. - I add InflowSecurity in service.xml. Therefore, my service requires security headers. - I don't add OutflowSecurity in the axis2.xml at the client side. (This is made deliberately to cause the server throwing missing security headers exception.) - I send request by calling generated test code. - All the messages goes through TCP/IP Monitor. - Request doesn't have security headers as expected. - Server sends a SOAPFault back to the client. (HTTP header says HTTP/1.1 500 Internal Server Error) - However, client doesn't do anything with this exception, although it successfully receives the whole message. Here are the questions: - Is this expected behavior? - If yes, why the server send soap fault for the in-only message? - Does the client only wait for *any* HTTP response without actually caring about what the header is? Or, does it behave differently but not for HTTP 500? - I saw the ReplyTo header in the request. Spec says ReplyTo is optional for in-only messages. What purposes Axis2 set it for? Thanks for your reading efforts :) Ali Sadik Kumlali __ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com __ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com Hi, org.apache.axis2.transport.http.AbstractHTTPSender does care about response http status code. for a soap request, CommonsHttpTransportSender creates org.apache.axis2.transport.http.SOAPOverHTTPSender which extends org.apache.axis2.transport.http.AbstractHTTPSender and if you observe the code in lines 103 to 121, response will be handle according to the http status code. Currently axis2 support 200,202 and 500. Thank you Saminda -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.1 (GNU/Linux) Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org iD8DBQFEYGf0YmklbLuW6wYRAl7FAJ9CjyfxNL/E8u90i8wcBRPalI3AuQCgwZEg mnq77GrPynQ8awsui8gWbQo= =ACXR -END PGP SIGNATURE-
Re: [Axis2][1.0] Handling HTTP 500 errors for input only requests!
Thank you very much Saminda. I've examined the lines you addressed. I've found followings: - After execution, SOAPOverHTTPSender dispatches the response according to the HTTP status code. - In my case(HTTP 500), it calls AbstractHTTPSender's processResponse() method. - A reference to the input stream extracted from response body is set to operation context as following: if(msgContext.getOperationContext() != null) { msgContext.getOperationContext() .setProperty(MessageContext.TRANSPORT_IN, in); } What is the purpose of this? Can I reach this property and receive the input stream within the class that I call the stub? If yes, could you please tell me how? Also, I examined PingClient sample a little. I changed ClientUtil.getPingOMElement() to be able to call pingF service which throws an AxisFault when it is called. After I had called it, there was no AxisFault at either the client or server side althought HTTP stream says HTTP 500. This might be because of fireAndForget () whose javadoc says That is, there is no opportunity to get an error from the service via this API; one may still get client-side errors, such as host unknown etc.. But, generated stub does not call fireAndForget(). Anyway, should I expect them both behave the same? Thanks again. Ali Sadik Kumlali --- Saminda Abeyruwan [EMAIL PROTECTED] wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Ali Sadik Kumlali wrote: Hi again, I've found that org.apache.axis2.transport.http.AbstractHTTPSender really doesn't care about the HTTP status code returned by the service. Here is the code: - // org.apache.axis2.transport.http.AbstractHTTPSender protected void executeMethod(...) throws IOException { HostConfiguration config = this.getHostConfiguration(...); msgContext.setProperty(HTTPConstants.HTTP_METHOD, method); ... // --- // executeMethod returns back 202, 500, etc. but // it is not handled! // --- httpClient.executeMethod(config, method); } - Is it on purpose? If yes, could you please answer my previous questions? Thanks a lot. Ali Sadik Kumlali --- Ali Sadik Kumlali [EMAIL PROTECTED] wrote: Hi all, The subject may seem contradictory, as it has both input only and return words together :) Here is the scenario: - In my WSDL, all the operations have input message only. Therefore, I assume that I have input only services. - WSDL2Java generates *MessageReceiverInOnly as expected. Therefore, I beleive, my first assumption is confirmed. - I add InflowSecurity in service.xml. Therefore, my service requires security headers. - I don't add OutflowSecurity in the axis2.xml at the client side. (This is made deliberately to cause the server throwing missing security headers exception.) - I send request by calling generated test code. - All the messages goes through TCP/IP Monitor. - Request doesn't have security headers as expected. - Server sends a SOAPFault back to the client. (HTTP header says HTTP/1.1 500 Internal Server Error) - However, client doesn't do anything with this exception, although it successfully receives the whole message. Here are the questions: - Is this expected behavior? - If yes, why the server send soap fault for the in-only message? - Does the client only wait for *any* HTTP response without actually caring about what the header is? Or, does it behave differently but not for HTTP 500? - I saw the ReplyTo header in the request. Spec says ReplyTo is optional for in-only messages. What purposes Axis2 set it for? Thanks for your reading efforts :) Ali Sadik Kumlali __ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com __ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com Hi, org.apache.axis2.transport.http.AbstractHTTPSender does care about response http status code. for a soap request, CommonsHttpTransportSender creates org.apache.axis2.transport.http.SOAPOverHTTPSender which extends org.apache.axis2.transport.http.AbstractHTTPSender and if you observe the code in lines 103 to 121, response will be handle according to the http status code. Currently axis2 support 200,202 and 500. Thank you Saminda -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.1 (GNU/Linux) Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org iD8DBQFEYGf0YmklbLuW6wYRAl7FAJ9CjyfxNL/E8u90i8wcBRPalI3AuQCgwZEg mnq77GrPynQ8awsui8gWbQo= =ACXR -END PGP SIGNATURE-
Re: [Axis2][1.0] Handling HTTP 500 errors for input only requests!
Hi, I've discovered ServiceClient's sendRobust() method and RobustOutOnlyAxisOperation which is implicitly an Out-In operation. Therefore, it sends the SOAP message and receives a response. Then, it checks for a fault and throws an AxisFault if the incoming message is actually a SOAPFault. This behavior is what I've been looking for in last two-three weeks :) So, I gave ping and pingF services a try. You may see the results below. But, it doesn't seem to meet my needs. What I need are: - If the service returns HTTP 500, I want it to behave as in pingF sendRobust case. But, with the actual exception message thrown by the service. - If the service returns HTTP 202, I want it to behave as in ping fireAndForget case. Should I directly use createClient() method of ServiceClient? Or, do my expectations weird? :) If I'm required to use createClient(), should I manually change all the generated stub code? Or, is there a better way for the human being :) Thanks a lot. Ali Sadik Kumlali --- Server responses for ping and pingF service calls --- ping fireAndForget - HTTP status : HTTP/1.1 202 Accepted - Incoming message : N/A - Client side exception: N/A - Server side exception: N/A ping sendRobust - HTTP status : HTTP/1.1 202 Accepted - Incoming message : N/A - Client side exception: Incoming message input stream is null - Server side exception: N/A pingF fireAndForget - HTTP status : HTTP/1.1 500 Internal Server Error - Incoming message : SOAPFault whose faultstring is unknown. However, the error message thrown by pingF is Fault being thrown - Client side exception: Incoming message input stream is null - Server side exception: N/A pingF sendRobust - HTTP status : HTTP/1.1 500 Internal Server Error - Incoming message: SOAPFault whose faultstring is unknown. However, the error message thrown by pingF is Fault being thrown - Client side exeption: Exception part of the incoming SOAP fault. There is stack trace of the error thrown by the server. But, error message is shown as unknown. - Server side exeption: N/A --- --- Ali Sadik Kumlali [EMAIL PROTECTED] wrote: Thank you very much Saminda. I've examined the lines you addressed. I've found followings: - After execution, SOAPOverHTTPSender dispatches the response according to the HTTP status code. - In my case(HTTP 500), it calls AbstractHTTPSender's processResponse() method. - A reference to the input stream extracted from response body is set to operation context as following: if(msgContext.getOperationContext() != null) { msgContext.getOperationContext() .setProperty(MessageContext.TRANSPORT_IN, in); } What is the purpose of this? Can I reach this property and receive the input stream within the class that I call the stub? If yes, could you please tell me how? Also, I examined PingClient sample a little. I changed ClientUtil.getPingOMElement() to be able to call pingF service which throws an AxisFault when it is called. After I had called it, there was no AxisFault at either the client or server side althought HTTP stream says HTTP 500. This might be because of fireAndForget () whose javadoc says That is, there is no opportunity to get an error from the service via this API; one may still get client-side errors, such as host unknown etc.. But, generated stub does not call fireAndForget(). Anyway, should I expect them both behave the same? Thanks again. Ali Sadik Kumlali --- Saminda Abeyruwan [EMAIL PROTECTED] wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Ali Sadik Kumlali wrote: Hi again, I've found that org.apache.axis2.transport.http.AbstractHTTPSender really doesn't care about the HTTP status code returned by the service. Here is the code: - // org.apache.axis2.transport.http.AbstractHTTPSender protected void executeMethod(...) throws IOException { HostConfiguration config = this.getHostConfiguration(...); msgContext.setProperty(HTTPConstants.HTTP_METHOD, method); ... // --- // executeMethod returns back 202, 500, etc. but // it is not handled! // --- httpClient.executeMethod(config, method); } - Is it on purpose? If yes, could you please answer my previous
Re: [Axis2][1.0] Handling HTTP 500 errors for input only requests!
Correction in pingF fireAndForget case. Client side expection must have been N/A. My apologies... - Hi, I've discovered ServiceClient's sendRobust() method and RobustOutOnlyAxisOperation which is implicitly an Out-In operation. Therefore, it sends the SOAP message and receives a response. Then, it checks for a fault and throws an AxisFault if the incoming message is actually a SOAPFault. This behavior is what I've been looking for in last two-three weeks :) So, I gave ping and pingF services a try. You may see the results below. But, it doesn't seem to meet my needs. What I need are: - If the service returns HTTP 500, I want it to behave as in pingF sendRobust case. But, with the actual exception message thrown by the service. - If the service returns HTTP 202, I want it to behave as in ping fireAndForget case. Should I directly use createClient() method of ServiceClient? Or, do my expectations weird? :) If I'm required to use createClient(), should I manually change all the generated stub code? Or, is there a better way for the human being :) Thanks a lot. Ali Sadik Kumlali --- Server responses for ping and pingF service calls --- ping fireAndForget - HTTP status : HTTP/1.1 202 Accepted - Incoming message : N/A - Client side exception: N/A - Server side exception: N/A ping sendRobust - HTTP status : HTTP/1.1 202 Accepted - Incoming message : N/A - Client side exception: Incoming message input stream is null - Server side exception: N/A pingF fireAndForget - HTTP status : HTTP/1.1 500 Internal Server Error - Incoming message : SOAPFault whose faultstring is unknown. However, the error message thrown by pingF is Fault being thrown - Client side exception: N/A - Server side exception: N/A pingF sendRobust - HTTP status : HTTP/1.1 500 Internal Server Error - Incoming message: SOAPFault whose faultstring is unknown. However, the error message thrown by pingF is Fault being thrown - Client side exeption: Exception part of the incoming SOAP fault. There is stack trace of the error thrown by the server. But, error message is shown as unknown. - Server side exeption: N/A --- --- Ali Sadik Kumlali [EMAIL PROTECTED] wrote: Thank you very much Saminda. I've examined the lines you addressed. I've found followings: - After execution, SOAPOverHTTPSender dispatches the response according to the HTTP status code. - In my case(HTTP 500), it calls AbstractHTTPSender's processResponse() method. - A reference to the input stream extracted from response body is set to operation context as following: if(msgContext.getOperationContext() != null) { msgContext.getOperationContext() .setProperty(MessageContext.TRANSPORT_IN, in); } What is the purpose of this? Can I reach this property and receive the input stream within the class that I call the stub? If yes, could you please tell me how? Also, I examined PingClient sample a little. I changed ClientUtil.getPingOMElement() to be able to call pingF service which throws an AxisFault when it is called. After I had called it, there was no AxisFault at either the client or server side althought HTTP stream says HTTP 500. This might be because of fireAndForget () whose javadoc says That is, there is no opportunity to get an error from the service via this API; one may still get client-side errors, such as host unknown etc.. But, generated stub does not call fireAndForget(). Anyway, should I expect them both behave the same? Thanks again. Ali Sadik Kumlali --- Saminda Abeyruwan [EMAIL PROTECTED] wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Ali Sadik Kumlali wrote: Hi again, I've found that org.apache.axis2.transport.http.AbstractHTTPSender really doesn't care about the HTTP status code returned by the service. Here is the code: - // org.apache.axis2.transport.http.AbstractHTTPSender protected void executeMethod(...) throws IOException { HostConfiguration config = this.getHostConfiguration(...); msgContext.setProperty(HTTPConstants.HTTP_METHOD, method); ... // --- // executeMethod returns back 202, 500, etc. but // it is not handled! // --- httpClient.executeMethod(config, method); }
[Axis2][1.0] Handling HTTP 500 errors for input only requests!
Hi all, The subject may seem contradictory, as it has both input only and return words together :) Here is the scenario: - In my WSDL, all the operations have input message only. Therefore, I assume that I have input only services. - WSDL2Java generates *MessageReceiverInOnly as expected. Therefore, I beleive, my first assumption is confirmed. - I add InflowSecurity in service.xml. Therefore, my service requires security headers. - I don't add OutflowSecurity in the axis2.xml at the client side. (This is made deliberately to cause the server throwing missing security headers exception.) - I send request by calling generated test code. - All the messages goes through TCP/IP Monitor. - Request doesn't have security headers as expected. - Server sends a SOAPFault back to the client. (HTTP header says HTTP/1.1 500 Internal Server Error) - However, client doesn't do anything with this exception, although it successfully receives the whole message. Here are the questions: - Is this expected behavior? - If yes, why the server send soap fault for the in-only message? - Does the client only wait for *any* HTTP response without actually caring about what the header is? Or, does it behave differently but not for HTTP 500? - I saw the ReplyTo header in the request. Spec says ReplyTo is optional for in-only messages. What purposes Axis2 set it for? Thanks for your reading efforts :) Ali Sadik Kumlali __ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com
Re: [Axis2][1.0] Handling HTTP 500 errors for input only requests!
Hi again, I've found that org.apache.axis2.transport.http.AbstractHTTPSender really doesn't care about the HTTP status code returned by the service. Here is the code: - // org.apache.axis2.transport.http.AbstractHTTPSender protected void executeMethod(...) throws IOException { HostConfiguration config = this.getHostConfiguration(...); msgContext.setProperty(HTTPConstants.HTTP_METHOD, method); ... // --- // executeMethod returns back 202, 500, etc. but // it is not handled! // --- httpClient.executeMethod(config, method); } - Is it on purpose? If yes, could you please answer my previous questions? Thanks a lot. Ali Sadik Kumlali --- Ali Sadik Kumlali [EMAIL PROTECTED] wrote: Hi all, The subject may seem contradictory, as it has both input only and return words together :) Here is the scenario: - In my WSDL, all the operations have input message only. Therefore, I assume that I have input only services. - WSDL2Java generates *MessageReceiverInOnly as expected. Therefore, I beleive, my first assumption is confirmed. - I add InflowSecurity in service.xml. Therefore, my service requires security headers. - I don't add OutflowSecurity in the axis2.xml at the client side. (This is made deliberately to cause the server throwing missing security headers exception.) - I send request by calling generated test code. - All the messages goes through TCP/IP Monitor. - Request doesn't have security headers as expected. - Server sends a SOAPFault back to the client. (HTTP header says HTTP/1.1 500 Internal Server Error) - However, client doesn't do anything with this exception, although it successfully receives the whole message. Here are the questions: - Is this expected behavior? - If yes, why the server send soap fault for the in-only message? - Does the client only wait for *any* HTTP response without actually caring about what the header is? Or, does it behave differently but not for HTTP 500? - I saw the ReplyTo header in the request. Spec says ReplyTo is optional for in-only messages. What purposes Axis2 set it for? Thanks for your reading efforts :) Ali Sadik Kumlali __ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com __ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com