|
View:
New views
13 Messages
—
Rating Filter:
Alert me
|
|
|
XmlSerializableSerializerHI, where do I have to create/register a XmlSerializableSerializer ?
I got the message: [ID = 'NoFromXML'] The XmlSerializableSerializer does not have an implementation of fromXML() - it only knows how to convert objects that implement XmlSerialiable to XML (using XmlSerializable.toXML()). If you want to deserialize objects of this type from XML, you should extend the XmlSerializableSerializer and override toXML() and getSerializableType(). I want to create a Handler for a http://docs.oasis-open.org/wsn/brw-2/RegisterPublisher/RegisterPublisherRequest request. Thanks, Jan -- Jan Torben Heuer Institute for Geoinformatics jan.heuer@... Robert-Koch-Strasse 26-28 +49 251 83-31960 48151 Münster, Germany --------------------------------------------------------------------- To unsubscribe, e-mail: muse-user-unsubscribe@... For additional commands, e-mail: muse-user-help@... |
|
|
Responde with HTTP 500 on purposeHello,
We receive WS-Notifications from a server. We than try to store the notification first. If this fails, we need to send back a HTTP 500 errorcode so that the server knows, that we did not receive the notification successfully. Is there are a way in muse how we can accomplish that? Regards, Christian --------------------------------------------------------------------- To unsubscribe, e-mail: muse-user-unsubscribe@... For additional commands, e-mail: muse-user-help@... |
|
|
RE: Responde with HTTP 500 on purposeHi Christian,
which environment (isolation layer) are you using? As Muse is a plugable environment it does not directly interact with the HttpRequest or force return codes. As such it depends on the environment it runs in to make sensible decisions. cheers, Chris -----Original Message----- From: Rapp, Christian [mailto:christian.rapp@...] Sent: Thursday, July 03, 2008 1:45 PM To: muse-user@... Subject: Responde with HTTP 500 on purpose Hello, We receive WS-Notifications from a server. We than try to store the notification first. If this fails, we need to send back a HTTP 500 errorcode so that the server knows, that we did not receive the notification successfully. Is there are a way in muse how we can accomplish that? Regards, Christian --------------------------------------------------------------------- To unsubscribe, e-mail: muse-user-unsubscribe@... For additional commands, e-mail: muse-user-help@... --------------------------------------------------------------------- To unsubscribe, e-mail: muse-user-unsubscribe@... For additional commands, e-mail: muse-user-help@... |
|
|
AW: Responde with HTTP 500 on purposeHi,
Muse runs on top of Axis2. Regards, Christian -----Ursprüngliche Nachricht----- Von: Chris.Twiner@... [mailto:Chris.Twiner@...] Gesendet: Donnerstag, 3. Juli 2008 13:56 An: muse-user@... Betreff: RE: Responde with HTTP 500 on purpose Hi Christian, which environment (isolation layer) are you using? As Muse is a plugable environment it does not directly interact with the HttpRequest or force return codes. As such it depends on the environment it runs in to make sensible decisions. cheers, Chris -----Original Message----- From: Rapp, Christian [mailto:christian.rapp@...] Sent: Thursday, July 03, 2008 1:45 PM To: muse-user@... Subject: Responde with HTTP 500 on purpose Hello, We receive WS-Notifications from a server. We than try to store the notification first. If this fails, we need to send back a HTTP 500 errorcode so that the server knows, that we did not receive the notification successfully. Is there are a way in muse how we can accomplish that? Regards, Christian --------------------------------------------------------------------- To unsubscribe, e-mail: muse-user-unsubscribe@... For additional commands, e-mail: muse-user-help@... --------------------------------------------------------------------- To unsubscribe, e-mail: muse-user-unsubscribe@... For additional commands, e-mail: muse-user-help@... --------------------------------------------------------------------- To unsubscribe, e-mail: muse-user-unsubscribe@... For additional commands, e-mail: muse-user-help@... |
|
|
RE: XmlSerializableSerializerHi Jan,
You should probably use org.apache.muse.core.serializer.Serializer, see http://ws.apache.org/muse/docs/2.2.0/javadoc/org/apache/muse/core/serializer/Serializer.html . Then Muse will do the rest. I can definitely vouch for this approach. It should be noted that for generated proxys you must specifically change the code to use the serializers. cheers, Chris -----Original Message----- From: Jan Torben Heuer [mailto:jan.heuer@...] Sent: Thursday, July 03, 2008 1:32 PM To: muse-user@... Subject: XmlSerializableSerializer HI, where do I have to create/register a XmlSerializableSerializer ? I got the message: [ID = 'NoFromXML'] The XmlSerializableSerializer does not have an implementation of fromXML() - it only knows how to convert objects that implement XmlSerialiable to XML (using XmlSerializable.toXML()). If you want to deserialize objects of this type from XML, you should extend the XmlSerializableSerializer and override toXML() and getSerializableType(). I want to create a Handler for a http://docs.oasis-open.org/wsn/brw-2/RegisterPublisher/RegisterPublisherRequest request. Thanks, Jan -- Jan Torben Heuer Institute for Geoinformatics jan.heuer@... Robert-Koch-Strasse 26-28 +49 251 83-31960 48151 Münster, Germany --------------------------------------------------------------------- To unsubscribe, e-mail: muse-user-unsubscribe@... For additional commands, e-mail: muse-user-help@... --------------------------------------------------------------------- To unsubscribe, e-mail: muse-user-unsubscribe@... For additional commands, e-mail: muse-user-help@... |
|
|
"BugReport" Re: XmlSerializableSerializerOn Thursday 03 July 2008 14:02:50 Chris.Twiner@... wrote:
Hi, is there a difference between putting the serializer in the muse.xml or doing it in the initialize phase with AbstractCapability#setMessageHandler() ? > http://ws.apache.org/muse/docs/2.2.0/javadoc/org/apache/muse/core/serialize >r/Serializer.html Thanks, and now it is time for me to give something back to community ;-) Here is a javadoc mistake: > <custom-serializer> > <java-serializable-type>the new type</java-concrete-class> ^^^^^^^^^^^^^^^^^^^^^^^ > <java-serializer-class>the type's serializer</java-serializer-class> > </custom-serializer> Jan -- Jan Torben Heuer Institute for Geoinformatics jan.heuer@... Robert-Koch-Strasse 26-28 +49 251 83-31960 48151 Münster, Germany --------------------------------------------------------------------- To unsubscribe, e-mail: muse-user-unsubscribe@... For additional commands, e-mail: muse-user-help@... |
|
|
RE: Responde with HTTP 500 on purposeHi,
Just to be sure are you receiving the message with a NotificationMessageListener? If so you can't actually throw anything back to the environment (there is a current JIRA for this I beleive) the Throwable will just be caught and logged. Using Axis2 directly (1.1 and above) the MessageContext.getCurrentMessageContext should allow you to directly set a soap fault for the reply, thus causing a 500. http://wso2.org/library/106 let us know how you get on cheers, Chris -----Original Message----- From: Rapp, Christian [mailto:christian.rapp@...] Sent: Thursday, July 03, 2008 1:59 PM To: muse-user@... Subject: AW: Responde with HTTP 500 on purpose Hi, Muse runs on top of Axis2. Regards, Christian -----Ursprüngliche Nachricht----- Von: Chris.Twiner@... [mailto:Chris.Twiner@...] Gesendet: Donnerstag, 3. Juli 2008 13:56 An: muse-user@... Betreff: RE: Responde with HTTP 500 on purpose Hi Christian, which environment (isolation layer) are you using? As Muse is a plugable environment it does not directly interact with the HttpRequest or force return codes. As such it depends on the environment it runs in to make sensible decisions. cheers, Chris -----Original Message----- From: Rapp, Christian [mailto:christian.rapp@...] Sent: Thursday, July 03, 2008 1:45 PM To: muse-user@... Subject: Responde with HTTP 500 on purpose Hello, We receive WS-Notifications from a server. We than try to store the notification first. If this fails, we need to send back a HTTP 500 errorcode so that the server knows, that we did not receive the notification successfully. Is there are a way in muse how we can accomplish that? Regards, Christian --------------------------------------------------------------------- To unsubscribe, e-mail: muse-user-unsubscribe@... For additional commands, e-mail: muse-user-help@... --------------------------------------------------------------------- To unsubscribe, e-mail: muse-user-unsubscribe@... For additional commands, e-mail: muse-user-help@... --------------------------------------------------------------------- To unsubscribe, e-mail: muse-user-unsubscribe@... For additional commands, e-mail: muse-user-help@... --------------------------------------------------------------------- To unsubscribe, e-mail: muse-user-unsubscribe@... For additional commands, e-mail: muse-user-help@... |
|
|
AW: Responde with HTTP 500 on purposeHi Chris,
Yes, I am using a TopicListener which is a NotificationMessageListener. Currently I am able to send back a SOAP-Fault, but that does not include sending back a HTTP500. It rather returns a HTTP200 which does not help us very much. Is it possible to overwrite the class responsible for setting the HTTP returncode? Because we can not wait until the issue you mentioned has been fixed. Do you have the issue number of the mentioned issue? Regards, Christian -----Ursprüngliche Nachricht----- Von: Chris.Twiner@... [mailto:Chris.Twiner@...] Gesendet: Donnerstag, 3. Juli 2008 14:47 An: muse-user@... Betreff: RE: Responde with HTTP 500 on purpose Hi, Just to be sure are you receiving the message with a NotificationMessageListener? If so you can't actually throw anything back to the environment (there is a current JIRA for this I beleive) the Throwable will just be caught and logged. Using Axis2 directly (1.1 and above) the MessageContext.getCurrentMessageContext should allow you to directly set a soap fault for the reply, thus causing a 500. http://wso2.org/library/106 let us know how you get on cheers, Chris -----Original Message----- From: Rapp, Christian [mailto:christian.rapp@...] Sent: Thursday, July 03, 2008 1:59 PM To: muse-user@... Subject: AW: Responde with HTTP 500 on purpose Hi, Muse runs on top of Axis2. Regards, Christian -----Ursprüngliche Nachricht----- Von: Chris.Twiner@... [mailto:Chris.Twiner@...] Gesendet: Donnerstag, 3. Juli 2008 13:56 An: muse-user@... Betreff: RE: Responde with HTTP 500 on purpose Hi Christian, which environment (isolation layer) are you using? As Muse is a plugable environment it does not directly interact with the HttpRequest or force return codes. As such it depends on the environment it runs in to make sensible decisions. cheers, Chris -----Original Message----- From: Rapp, Christian [mailto:christian.rapp@...] Sent: Thursday, July 03, 2008 1:45 PM To: muse-user@... Subject: Responde with HTTP 500 on purpose Hello, We receive WS-Notifications from a server. We than try to store the notification first. If this fails, we need to send back a HTTP 500 errorcode so that the server knows, that we did not receive the notification successfully. Is there are a way in muse how we can accomplish that? Regards, Christian --------------------------------------------------------------------- To unsubscribe, e-mail: muse-user-unsubscribe@... For additional commands, e-mail: muse-user-help@... --------------------------------------------------------------------- To unsubscribe, e-mail: muse-user-unsubscribe@... For additional commands, e-mail: muse-user-help@... --------------------------------------------------------------------- To unsubscribe, e-mail: muse-user-unsubscribe@... For additional commands, e-mail: muse-user-help@... --------------------------------------------------------------------- To unsubscribe, e-mail: muse-user-unsubscribe@... For additional commands, e-mail: muse-user-help@... --------------------------------------------------------------------- To unsubscribe, e-mail: muse-user-unsubscribe@... For additional commands, e-mail: muse-user-help@... |
|
|
RE: Responde with HTTP 500 on purposeHi Christian
The code responsible for this is somewhere in Axis2 not inside of Muse itself. From a small bit of googling I found this: HttpServletResponse resp = (HttpServletResponse) getCurrentMessageContext() .getProperty(HTTPConstants.MC_HTTP_SERVLETRESPONSE); if (resp != null) { resp.setStatus(status); } I didn't find any obvious Axis2 docs for this kind of behaviour though, or even how the return status codes are decided. cheers, Chris -----Original Message----- From: Rapp, Christian [mailto:christian.rapp@...] Sent: Thursday, July 03, 2008 4:59 PM To: muse-user@... Subject: AW: Responde with HTTP 500 on purpose Hi Chris, Yes, I am using a TopicListener which is a NotificationMessageListener. Currently I am able to send back a SOAP-Fault, but that does not include sending back a HTTP500. It rather returns a HTTP200 which does not help us very much. Is it possible to overwrite the class responsible for setting the HTTP returncode? Because we can not wait until the issue you mentioned has been fixed. Do you have the issue number of the mentioned issue? Regards, Christian -----Ursprüngliche Nachricht----- Von: Chris.Twiner@... [mailto:Chris.Twiner@...] Gesendet: Donnerstag, 3. Juli 2008 14:47 An: muse-user@... Betreff: RE: Responde with HTTP 500 on purpose Hi, Just to be sure are you receiving the message with a NotificationMessageListener? If so you can't actually throw anything back to the environment (there is a current JIRA for this I beleive) the Throwable will just be caught and logged. Using Axis2 directly (1.1 and above) the MessageContext.getCurrentMessageContext should allow you to directly set a soap fault for the reply, thus causing a 500. http://wso2.org/library/106 let us know how you get on cheers, Chris -----Original Message----- From: Rapp, Christian [mailto:christian.rapp@...] Sent: Thursday, July 03, 2008 1:59 PM To: muse-user@... Subject: AW: Responde with HTTP 500 on purpose Hi, Muse runs on top of Axis2. Regards, Christian -----Ursprüngliche Nachricht----- Von: Chris.Twiner@... [mailto:Chris.Twiner@...] Gesendet: Donnerstag, 3. Juli 2008 13:56 An: muse-user@... Betreff: RE: Responde with HTTP 500 on purpose Hi Christian, which environment (isolation layer) are you using? As Muse is a plugable environment it does not directly interact with the HttpRequest or force return codes. As such it depends on the environment it runs in to make sensible decisions. cheers, Chris -----Original Message----- From: Rapp, Christian [mailto:christian.rapp@...] Sent: Thursday, July 03, 2008 1:45 PM To: muse-user@... Subject: Responde with HTTP 500 on purpose Hello, We receive WS-Notifications from a server. We than try to store the notification first. If this fails, we need to send back a HTTP 500 errorcode so that the server knows, that we did not receive the notification successfully. Is there are a way in muse how we can accomplish that? Regards, Christian --------------------------------------------------------------------- To unsubscribe, e-mail: muse-user-unsubscribe@... For additional commands, e-mail: muse-user-help@... --------------------------------------------------------------------- To unsubscribe, e-mail: muse-user-unsubscribe@... For additional commands, e-mail: muse-user-help@... --------------------------------------------------------------------- To unsubscribe, e-mail: muse-user-unsubscribe@... For additional commands, e-mail: muse-user-help@... --------------------------------------------------------------------- To unsubscribe, e-mail: muse-user-unsubscribe@... For additional commands, e-mail: muse-user-help@... --------------------------------------------------------------------- To unsubscribe, e-mail: muse-user-unsubscribe@... For additional commands, e-mail: muse-user-help@... --------------------------------------------------------------------- To unsubscribe, e-mail: muse-user-unsubscribe@... For additional commands, e-mail: muse-user-help@... |
|
|
AW: Responde with HTTP 500 on purposeHi Chris,
As far as I found out this is only working in Axis and not Axis2. In Axis2 this should work: MessageContext inContext = MessageContext.getCurrentMessageContext(); inContext.setProperty(Constants.HTTP_RESPONSE_STATE, HttpServletResponse.SC_INTERNAL_SERVER_ERROR); But this does not work for the Axis2 version that comes with Muse. Therre the Constants class does not know this constant. We somehow need to get access to the HttpServletResponse object. In that I found the status code that is being returned. Always being 200. I am doing more research on this tomorrow. Regards, Christian -----Ursprüngliche Nachricht----- Von: Chris.Twiner@... [mailto:Chris.Twiner@...] Gesendet: Donnerstag, 3. Juli 2008 17:11 An: muse-user@... Betreff: RE: Responde with HTTP 500 on purpose Hi Christian The code responsible for this is somewhere in Axis2 not inside of Muse itself. From a small bit of googling I found this: HttpServletResponse resp = (HttpServletResponse) getCurrentMessageContext() .getProperty(HTTPConstants.MC_HTTP_SERVLETRESPONSE); if (resp != null) { resp.setStatus(status); } I didn't find any obvious Axis2 docs for this kind of behaviour though, or even how the return status codes are decided. cheers, Chris -----Original Message----- From: Rapp, Christian [mailto:christian.rapp@...] Sent: Thursday, July 03, 2008 4:59 PM To: muse-user@... Subject: AW: Responde with HTTP 500 on purpose Hi Chris, Yes, I am using a TopicListener which is a NotificationMessageListener. Currently I am able to send back a SOAP-Fault, but that does not include sending back a HTTP500. It rather returns a HTTP200 which does not help us very much. Is it possible to overwrite the class responsible for setting the HTTP returncode? Because we can not wait until the issue you mentioned has been fixed. Do you have the issue number of the mentioned issue? Regards, Christian -----Ursprüngliche Nachricht----- Von: Chris.Twiner@... [mailto:Chris.Twiner@...] Gesendet: Donnerstag, 3. Juli 2008 14:47 An: muse-user@... Betreff: RE: Responde with HTTP 500 on purpose Hi, Just to be sure are you receiving the message with a NotificationMessageListener? If so you can't actually throw anything back to the environment (there is a current JIRA for this I beleive) the Throwable will just be caught and logged. Using Axis2 directly (1.1 and above) the MessageContext.getCurrentMessageContext should allow you to directly set a soap fault for the reply, thus causing a 500. http://wso2.org/library/106 let us know how you get on cheers, Chris -----Original Message----- From: Rapp, Christian [mailto:christian.rapp@...] Sent: Thursday, July 03, 2008 1:59 PM To: muse-user@... Subject: AW: Responde with HTTP 500 on purpose Hi, Muse runs on top of Axis2. Regards, Christian -----Ursprüngliche Nachricht----- Von: Chris.Twiner@... [mailto:Chris.Twiner@...] Gesendet: Donnerstag, 3. Juli 2008 13:56 An: muse-user@... Betreff: RE: Responde with HTTP 500 on purpose Hi Christian, which environment (isolation layer) are you using? As Muse is a plugable environment it does not directly interact with the HttpRequest or force return codes. As such it depends on the environment it runs in to make sensible decisions. cheers, Chris -----Original Message----- From: Rapp, Christian [mailto:christian.rapp@...] Sent: Thursday, July 03, 2008 1:45 PM To: muse-user@... Subject: Responde with HTTP 500 on purpose Hello, We receive WS-Notifications from a server. We than try to store the notification first. If this fails, we need to send back a HTTP 500 errorcode so that the server knows, that we did not receive the notification successfully. Is there are a way in muse how we can accomplish that? Regards, Christian --------------------------------------------------------------------- To unsubscribe, e-mail: muse-user-unsubscribe@... For additional commands, e-mail: muse-user-help@... --------------------------------------------------------------------- To unsubscribe, e-mail: muse-user-unsubscribe@... For additional commands, e-mail: muse-user-help@... --------------------------------------------------------------------- To unsubscribe, e-mail: muse-user-unsubscribe@... For additional commands, e-mail: muse-user-help@... --------------------------------------------------------------------- To unsubscribe, e-mail: muse-user-unsubscribe@... For additional commands, e-mail: muse-user-help@... --------------------------------------------------------------------- To unsubscribe, e-mail: muse-user-unsubscribe@... For additional commands, e-mail: muse-user-help@... --------------------------------------------------------------------- To unsubscribe, e-mail: muse-user-unsubscribe@... For additional commands, e-mail: muse-user-help@... --------------------------------------------------------------------- To unsubscribe, e-mail: muse-user-unsubscribe@... For additional commands, e-mail: muse-user-help@... |
|
|
RE: Responde with HTTP 500 on purposeHi,
You can send a 500 directly on the HttpServletResponse by: response.sendError(HttpServletResponse.SC_NOT_FOUND); But from within Muse, I don't believe there's a way to get a direct handle on the HttpServletResponse. That's in the core Axis2 SOAP engine which receives all requests and processes the SOAP. So you might have to dig into the Axis2 code. I did a little checking, and I'm not sure if you can easily access the HttpServletResponse in the Axis2 code either. So going the top-down approach, the AxisServlet is defined in the web.xml. The latest Axis2 1.4 source code is attached, although I'm not sure if it has changed much since 1.2. One possible solution is to extend/override the post() method in this class. Catch a custom exception that you would throw from your consumer capability if you fail to persist a notification. When this exception is caught, you can set the 500 code on the response. Then specify this custom servlet in your web.xml instead of the original Axis2. This is not a clean solution though. The better solution is to throw a custom SoapFault from your consumer. The producer will get it and can check the content. This way, you don't have to explicitly depend on HTTP responses, but instead handle SOAP responses like all other SOAP operations. Hope this helps... -Vinh -----Original Message----- From: Rapp, Christian [mailto:christian.rapp@...] Sent: Thursday, July 03, 2008 10:41 AM To: muse-user@... Subject: AW: Responde with HTTP 500 on purpose Hi Chris, As far as I found out this is only working in Axis and not Axis2. In Axis2 this should work: MessageContext inContext = MessageContext.getCurrentMessageContext(); inContext.setProperty(Constants.HTTP_RESPONSE_STATE, HttpServletResponse.SC_INTERNAL_SERVER_ERROR); But this does not work for the Axis2 version that comes with Muse. Therre the Constants class does not know this constant. We somehow need to get access to the HttpServletResponse object. In that I found the status code that is being returned. Always being 200. I am doing more research on this tomorrow. Regards, Christian -----Ursprüngliche Nachricht----- Von: Chris.Twiner@... [mailto:Chris.Twiner@...] Gesendet: Donnerstag, 3. Juli 2008 17:11 An: muse-user@... Betreff: RE: Responde with HTTP 500 on purpose Hi Christian The code responsible for this is somewhere in Axis2 not inside of Muse itself. From a small bit of googling I found this: HttpServletResponse resp = (HttpServletResponse) getCurrentMessageContext() .getProperty(HTTPConstants.MC_HTTP_SERVLETRESPONSE); if (resp != null) { resp.setStatus(status); } I didn't find any obvious Axis2 docs for this kind of behaviour though, or even how the return status codes are decided. cheers, Chris -----Original Message----- From: Rapp, Christian [mailto:christian.rapp@...] Sent: Thursday, July 03, 2008 4:59 PM To: muse-user@... Subject: AW: Responde with HTTP 500 on purpose Hi Chris, Yes, I am using a TopicListener which is a NotificationMessageListener. Currently I am able to send back a SOAP-Fault, but that does not include sending back a HTTP500. It rather returns a HTTP200 which does not help us very much. Is it possible to overwrite the class responsible for setting the HTTP returncode? Because we can not wait until the issue you mentioned has been fixed. Do you have the issue number of the mentioned issue? Regards, Christian -----Ursprüngliche Nachricht----- Von: Chris.Twiner@... [mailto:Chris.Twiner@...] Gesendet: Donnerstag, 3. Juli 2008 14:47 An: muse-user@... Betreff: RE: Responde with HTTP 500 on purpose Hi, Just to be sure are you receiving the message with a NotificationMessageListener? If so you can't actually throw anything back to the environment (there is a current JIRA for this I beleive) the Throwable will just be caught and logged. Using Axis2 directly (1.1 and above) the MessageContext.getCurrentMessageContext should allow you to directly set a soap fault for the reply, thus causing a 500. http://wso2.org/library/106 let us know how you get on cheers, Chris -----Original Message----- From: Rapp, Christian [mailto:christian.rapp@...] Sent: Thursday, July 03, 2008 1:59 PM To: muse-user@... Subject: AW: Responde with HTTP 500 on purpose Hi, Muse runs on top of Axis2. Regards, Christian -----Ursprüngliche Nachricht----- Von: Chris.Twiner@... [mailto:Chris.Twiner@...] Gesendet: Donnerstag, 3. Juli 2008 13:56 An: muse-user@... Betreff: RE: Responde with HTTP 500 on purpose Hi Christian, which environment (isolation layer) are you using? As Muse is a plugable environment it does not directly interact with the HttpRequest or force return codes. As such it depends on the environment it runs in to make sensible decisions. cheers, Chris -----Original Message----- From: Rapp, Christian [mailto:christian.rapp@...] Sent: Thursday, July 03, 2008 1:45 PM To: muse-user@... Subject: Responde with HTTP 500 on purpose Hello, We receive WS-Notifications from a server. We than try to store the notification first. If this fails, we need to send back a HTTP 500 errorcode so that the server knows, that we did not receive the notification successfully. Is there are a way in muse how we can accomplish that? Regards, Christian --------------------------------------------------------------------- To unsubscribe, e-mail: muse-user-unsubscribe@... For additional commands, e-mail: muse-user-help@... --------------------------------------------------------------------- To unsubscribe, e-mail: muse-user-unsubscribe@... For additional commands, e-mail: muse-user-help@... --------------------------------------------------------------------- To unsubscribe, e-mail: muse-user-unsubscribe@... For additional commands, e-mail: muse-user-help@... --------------------------------------------------------------------- To unsubscribe, e-mail: muse-user-unsubscribe@... For additional commands, e-mail: muse-user-help@... --------------------------------------------------------------------- To unsubscribe, e-mail: muse-user-unsubscribe@... For additional commands, e-mail: muse-user-help@... --------------------------------------------------------------------- To unsubscribe, e-mail: muse-user-unsubscribe@... For additional commands, e-mail: muse-user-help@... --------------------------------------------------------------------- To unsubscribe, e-mail: muse-user-unsubscribe@... For additional commands, e-mail: muse-user-help@... --------------------------------------------------------------------- To unsubscribe, e-mail: muse-user-unsubscribe@... For additional commands, e-mail: muse-user-help@... |
|
|
RE: Responde with HTTP 500 on purposeLooks like attachments aren't going thru. To be safe though, you can view the source code on the Axis2 site for:
org.apache.axis2.transport.http.AxisServlet -----Original Message----- From: Vinh Nguyen (vinguye2) Sent: Thursday, July 03, 2008 4:00 PM To: muse-user@... Subject: RE: Responde with HTTP 500 on purpose Hi, You can send a 500 directly on the HttpServletResponse by: response.sendError(HttpServletResponse.SC_NOT_FOUND); But from within Muse, I don't believe there's a way to get a direct handle on the HttpServletResponse. That's in the core Axis2 SOAP engine which receives all requests and processes the SOAP. So you might have to dig into the Axis2 code. I did a little checking, and I'm not sure if you can easily access the HttpServletResponse in the Axis2 code either. So going the top-down approach, the AxisServlet is defined in the web.xml. The latest Axis2 1.4 source code is attached, although I'm not sure if it has changed much since 1.2. One possible solution is to extend/override the post() method in this class. Catch a custom exception that you would throw from your consumer capability if you fail to persist a notification. When this exception is caught, you can set the 500 code on the response. Then specify this custom servlet in your web.xml instead of the original Axis2. This is not a clean solution though. The better solution is to throw a custom SoapFault from your consumer. The producer will get it and can check the content. This way, you don't have to explicitly depend on HTTP responses, but instead handle SOAP responses like all other SOAP operations. Hope this helps... -Vinh -----Original Message----- From: Rapp, Christian [mailto:christian.rapp@...] Sent: Thursday, July 03, 2008 10:41 AM To: muse-user@... Subject: AW: Responde with HTTP 500 on purpose Hi Chris, As far as I found out this is only working in Axis and not Axis2. In Axis2 this should work: MessageContext inContext = MessageContext.getCurrentMessageContext(); inContext.setProperty(Constants.HTTP_RESPONSE_STATE, HttpServletResponse.SC_INTERNAL_SERVER_ERROR); But this does not work for the Axis2 version that comes with Muse. Therre the Constants class does not know this constant. We somehow need to get access to the HttpServletResponse object. In that I found the status code that is being returned. Always being 200. I am doing more research on this tomorrow. Regards, Christian -----Ursprüngliche Nachricht----- Von: Chris.Twiner@... [mailto:Chris.Twiner@...] Gesendet: Donnerstag, 3. Juli 2008 17:11 An: muse-user@... Betreff: RE: Responde with HTTP 500 on purpose Hi Christian The code responsible for this is somewhere in Axis2 not inside of Muse itself. From a small bit of googling I found this: HttpServletResponse resp = (HttpServletResponse) getCurrentMessageContext() .getProperty(HTTPConstants.MC_HTTP_SERVLETRESPONSE); if (resp != null) { resp.setStatus(status); } I didn't find any obvious Axis2 docs for this kind of behaviour though, or even how the return status codes are decided. cheers, Chris -----Original Message----- From: Rapp, Christian [mailto:christian.rapp@...] Sent: Thursday, July 03, 2008 4:59 PM To: muse-user@... Subject: AW: Responde with HTTP 500 on purpose Hi Chris, Yes, I am using a TopicListener which is a NotificationMessageListener. Currently I am able to send back a SOAP-Fault, but that does not include sending back a HTTP500. It rather returns a HTTP200 which does not help us very much. Is it possible to overwrite the class responsible for setting the HTTP returncode? Because we can not wait until the issue you mentioned has been fixed. Do you have the issue number of the mentioned issue? Regards, Christian -----Ursprüngliche Nachricht----- Von: Chris.Twiner@... [mailto:Chris.Twiner@...] Gesendet: Donnerstag, 3. Juli 2008 14:47 An: muse-user@... Betreff: RE: Responde with HTTP 500 on purpose Hi, Just to be sure are you receiving the message with a NotificationMessageListener? If so you can't actually throw anything back to the environment (there is a current JIRA for this I beleive) the Throwable will just be caught and logged. Using Axis2 directly (1.1 and above) the MessageContext.getCurrentMessageContext should allow you to directly set a soap fault for the reply, thus causing a 500. http://wso2.org/library/106 let us know how you get on cheers, Chris -----Original Message----- From: Rapp, Christian [mailto:christian.rapp@...] Sent: Thursday, July 03, 2008 1:59 PM To: muse-user@... Subject: AW: Responde with HTTP 500 on purpose Hi, Muse runs on top of Axis2. Regards, Christian -----Ursprüngliche Nachricht----- Von: Chris.Twiner@... [mailto:Chris.Twiner@...] Gesendet: Donnerstag, 3. Juli 2008 13:56 An: muse-user@... Betreff: RE: Responde with HTTP 500 on purpose Hi Christian, which environment (isolation layer) are you using? As Muse is a plugable environment it does not directly interact with the HttpRequest or force return codes. As such it depends on the environment it runs in to make sensible decisions. cheers, Chris -----Original Message----- From: Rapp, Christian [mailto:christian.rapp@...] Sent: Thursday, July 03, 2008 1:45 PM To: muse-user@... Subject: Responde with HTTP 500 on purpose Hello, We receive WS-Notifications from a server. We than try to store the notification first. If this fails, we need to send back a HTTP 500 errorcode so that the server knows, that we did not receive the notification successfully. Is there are a way in muse how we can accomplish that? Regards, Christian --------------------------------------------------------------------- To unsubscribe, e-mail: muse-user-unsubscribe@... For additional commands, e-mail: muse-user-help@... --------------------------------------------------------------------- To unsubscribe, e-mail: muse-user-unsubscribe@... For additional commands, e-mail: muse-user-help@... --------------------------------------------------------------------- To unsubscribe, e-mail: muse-user-unsubscribe@... For additional commands, e-mail: muse-user-help@... --------------------------------------------------------------------- To unsubscribe, e-mail: muse-user-unsubscribe@... For additional commands, e-mail: muse-user-help@... --------------------------------------------------------------------- To unsubscribe, e-mail: muse-user-unsubscribe@... For additional commands, e-mail: muse-user-help@... --------------------------------------------------------------------- To unsubscribe, e-mail: muse-user-unsubscribe@... For additional commands, e-mail: muse-user-help@... --------------------------------------------------------------------- To unsubscribe, e-mail: muse-user-unsubscribe@... For additional commands, e-mail: muse-user-help@... --------------------------------------------------------------------- To unsubscribe, e-mail: muse-user-unsubscribe@... For additional commands, e-mail: muse-user-help@... |
|
|
AW: Responde with HTTP 500 on purposeHi,
So I finally found the resolution for my problem. Quick but dirty. :( But it works.:) I overwrote class 'org.apache.axis2.transport.http.AxisServlet' named it 'my.package.MyAxisServlet' and added the line <code> msgContext.setProperty(HTTPConstants.MC_HTTP_SERVLETRESPONSE, resp); </code> into method <code> protected MessageContext createAndSetInitialParamsToMsgCtxt( HttpServletResponse resp, HttpServletRequest req) throws AxisFault </code> Now I am able to access the response whereever I like to. Then in my implementing Capability for URI http://docs.oasis-open.org/wsn/bw-2/NotificationConsumer I add this in method 'notify' to set the "HTTP 500" statuscode into http response when necessary: <code> MessageContext inContext = MessageContext.getCurrentMessageContext(); HttpServletResponse resp = (HttpServletResponse) inContext.getProperty(HTTPConstants.MC_HTTP_SERVLETRESPONSE); if (resp != null) { resp.setStatus(500); } </code> To get it working I had to do the following change in the web.xml of the web application: Old: <servlet> <servlet-name>AxisServlet</servlet-name> <display-name>Apache-Axis Servlet</display-name> <servlet-class>org.apache.axis2.transport.http.AxisServlet</servlet-class> </servlet> New: <servlet> <servlet-name>AxisServlet</servlet-name> <display-name>Apache-Axis Servlet</display-name> <servlet-class>my.package.MyAxisServlet</servlet-class> </servlet> Regards, Christian -----Ursprüngliche Nachricht----- Von: Vinh Nguyen (vinguye2) [mailto:vinguye2@...] Gesendet: Freitag, 4. Juli 2008 01:05 An: muse-user@... Betreff: RE: Responde with HTTP 500 on purpose Looks like attachments aren't going thru. To be safe though, you can view the source code on the Axis2 site for: org.apache.axis2.transport.http.AxisServlet -----Original Message----- From: Vinh Nguyen (vinguye2) Sent: Thursday, July 03, 2008 4:00 PM To: muse-user@... Subject: RE: Responde with HTTP 500 on purpose Hi, You can send a 500 directly on the HttpServletResponse by: response.sendError(HttpServletResponse.SC_NOT_FOUND); But from within Muse, I don't believe there's a way to get a direct handle on the HttpServletResponse. That's in the core Axis2 SOAP engine which receives all requests and processes the SOAP. So you might have to dig into the Axis2 code. I did a little checking, and I'm not sure if you can easily access the HttpServletResponse in the Axis2 code either. So going the top-down approach, the AxisServlet is defined in the web.xml. The latest Axis2 1.4 source code is attached, although I'm not sure if it has changed much since 1.2. One possible solution is to extend/override the post() method in this class. Catch a custom exception that you would throw from your consumer capability if you fail to persist a notification. When this exception is caught, you can set the 500 code on the response. Then specify this custom servlet in your web.xml instead of the original Axis2. This is not a clean solution though. The better solution is to throw a custom SoapFault from your consumer. The producer will get it and can check the content. This way, you don't have to explicitly depend on HTTP responses, but instead handle SOAP responses like all other SOAP operations. Hope this helps... -Vinh -----Original Message----- From: Rapp, Christian [mailto:christian.rapp@...] Sent: Thursday, July 03, 2008 10:41 AM To: muse-user@... Subject: AW: Responde with HTTP 500 on purpose Hi Chris, As far as I found out this is only working in Axis and not Axis2. In Axis2 this should work: MessageContext inContext = MessageContext.getCurrentMessageContext(); inContext.setProperty(Constants.HTTP_RESPONSE_STATE, HttpServletResponse.SC_INTERNAL_SERVER_ERROR); But this does not work for the Axis2 version that comes with Muse. Therre the Constants class does not know this constant. We somehow need to get access to the HttpServletResponse object. In that I found the status code that is being returned. Always being 200. I am doing more research on this tomorrow. Regards, Christian -----Ursprüngliche Nachricht----- Von: Chris.Twiner@... [mailto:Chris.Twiner@...] Gesendet: Donnerstag, 3. Juli 2008 17:11 An: muse-user@... Betreff: RE: Responde with HTTP 500 on purpose Hi Christian The code responsible for this is somewhere in Axis2 not inside of Muse itself. From a small bit of googling I found this: HttpServletResponse resp = (HttpServletResponse) getCurrentMessageContext() .getProperty(HTTPConstants.MC_HTTP_SERVLETRESPONSE); if (resp != null) { resp.setStatus(status); } I didn't find any obvious Axis2 docs for this kind of behaviour though, or even how the return status codes are decided. cheers, Chris -----Original Message----- From: Rapp, Christian [mailto:christian.rapp@...] Sent: Thursday, July 03, 2008 4:59 PM To: muse-user@... Subject: AW: Responde with HTTP 500 on purpose Hi Chris, Yes, I am using a TopicListener which is a NotificationMessageListener. Currently I am able to send back a SOAP-Fault, but that does not include sending back a HTTP500. It rather returns a HTTP200 which does not help us very much. Is it possible to overwrite the class responsible for setting the HTTP returncode? Because we can not wait until the issue you mentioned has been fixed. Do you have the issue number of the mentioned issue? Regards, Christian -----Ursprüngliche Nachricht----- Von: Chris.Twiner@... [mailto:Chris.Twiner@...] Gesendet: Donnerstag, 3. Juli 2008 14:47 An: muse-user@... Betreff: RE: Responde with HTTP 500 on purpose Hi, Just to be sure are you receiving the message with a NotificationMessageListener? If so you can't actually throw anything back to the environment (there is a current JIRA for this I beleive) the Throwable will just be caught and logged. Using Axis2 directly (1.1 and above) the MessageContext.getCurrentMessageContext should allow you to directly set a soap fault for the reply, thus causing a 500. http://wso2.org/library/106 let us know how you get on cheers, Chris -----Original Message----- From: Rapp, Christian [mailto:christian.rapp@...] Sent: Thursday, July 03, 2008 1:59 PM To: muse-user@... Subject: AW: Responde with HTTP 500 on purpose Hi, Muse runs on top of Axis2. Regards, Christian -----Ursprüngliche Nachricht----- Von: Chris.Twiner@... [mailto:Chris.Twiner@...] Gesendet: Donnerstag, 3. Juli 2008 13:56 An: muse-user@... Betreff: RE: Responde with HTTP 500 on purpose Hi Christian, which environment (isolation layer) are you using? As Muse is a plugable environment it does not directly interact with the HttpRequest or force return codes. As such it depends on the environment it runs in to make sensible decisions. cheers, Chris -----Original Message----- From: Rapp, Christian [mailto:christian.rapp@...] Sent: Thursday, July 03, 2008 1:45 PM To: muse-user@... Subject: Responde with HTTP 500 on purpose Hello, We receive WS-Notifications from a server. We than try to store the notification first. If this fails, we need to send back a HTTP 500 errorcode so that the server knows, that we did not receive the notification successfully. Is there are a way in muse how we can accomplish that? Regards, Christian --------------------------------------------------------------------- To unsubscribe, e-mail: muse-user-unsubscribe@... For additional commands, e-mail: muse-user-help@... --------------------------------------------------------------------- To unsubscribe, e-mail: muse-user-unsubscribe@... For additional commands, e-mail: muse-user-help@... --------------------------------------------------------------------- To unsubscribe, e-mail: muse-user-unsubscribe@... For additional commands, e-mail: muse-user-help@... --------------------------------------------------------------------- To unsubscribe, e-mail: muse-user-unsubscribe@... For additional commands, e-mail: muse-user-help@... --------------------------------------------------------------------- To unsubscribe, e-mail: muse-user-unsubscribe@... For additional commands, e-mail: muse-user-help@... --------------------------------------------------------------------- To unsubscribe, e-mail: muse-user-unsubscribe@... For additional commands, e-mail: muse-user-help@... --------------------------------------------------------------------- To unsubscribe, e-mail: muse-user-unsubscribe@... For additional commands, e-mail: muse-user-help@... --------------------------------------------------------------------- To unsubscribe, e-mail: muse-user-unsubscribe@... For additional commands, e-mail: muse-user-help@... --------------------------------------------------------------------- To unsubscribe, e-mail: muse-user-unsubscribe@... For additional commands, e-mail: muse-user-help@... |
| Free embeddable forum powered by Nabble | Forum Help |