RE: Handlers
This will help clarify the reason to use handlers as well as illustrating how to write a simple Handler http://www.packtpub.com/article/handler-and-phase-in-apache-axis HTH Martin __ Disclaimer and Confidentiality/Verzicht und Vertraulichkeitanmerkung / Note de déni et de confidentialité This message is confidential. If you should not be the intended receiver, then we ask politely to report. Each unauthorized forwarding or manufacturing of a copy is inadmissible. This message serves only for the exchange of information and has no legal binding effect. Due to the easy manipulation of emails we cannot take responsibility over the the contents. Diese Nachricht ist vertraulich. Sollten Sie nicht der vorgesehene Empfaenger sein, so bitten wir hoeflich um eine Mitteilung. Jede unbefugte Weiterleitung oder Fertigung einer Kopie ist unzulaessig. Diese Nachricht dient lediglich dem Austausch von Informationen und entfaltet keine rechtliche Bindungswirkung. Aufgrund der leichten Manipulierbarkeit von E-Mails koennen wir keine Haftung fuer den Inhalt uebernehmen. Ce message est confidentiel et peut être privilégié. Si vous n'êtes pas le destinataire prévu, nous te demandons avec bonté que pour satisfaire informez l'expéditeur. N'importe quelle diffusion non autorisée ou la copie de ceci est interdite. Ce message sert à l'information seulement et n'aura pas n'importe quel effet légalement obligatoire. Étant donné que les email peuvent facilement être sujets à la manipulation, nous ne pouvons accepter aucune responsabilité pour le contenu fourni. Date: Mon, 4 May 2009 08:37:55 -0700 From: kit...@gmail.com To: axis-user@ws.apache.org Subject: Handlers Hi All, I need some resources to learn about handlers. I have a vogue idea about it, but i would like to know more about how to write handlers for security, addressing, logging etc. using Axis2 Thanks Kris -- View this message in context: http://www.nabble.com/Handlers-tp23370955p23370955.html Sent from the Axis - User mailing list archive at Nabble.com. _ Windows Live™: Keep your life in sync. http://windowslive.com/explore?ocid=TXT_TAGLM_BR_life_in_synch_052009
Re: Handlers, client.wsdd, change soap body on request/response path
Hi, I'd recommend you read the Handler Tutorial here : http://ws.apache.org/axis/cpp/arch/handler.html Personally, I would advise only to modify the soap headers and not the soap body within handlers in Axis C++. The APIs you can use are made available through the IMessageData object ( [axis install]/include/axis/IMessageData.hpp ). Regards, Adrian ___ Adrian Dick ([EMAIL PROTECTED]) Krankurs Leonid [EMAIL PROTECTED] wrote on 11/09/2006 14:02:53: Could anybody please clarify if the following can be done by Axis C++ 1.6 client side (all methods that needed have been implemented already in Axis C++ 1.6 build) 1. Handler can change the soap body of the message on request/response path 2. if (1) yes, how the handler(s) needs to be configured in client.wsdd? 2.0. from what base class should the handler be derived 2.1. what type(level) of the handler should it be (service, global, transport) This depends on the behaviour you're expecting. service - this handler is used when invoking a given service - you can specify the same handler for more than one service global - this handler is used when invoking any service transport - Due to only supporting HTTP(S) this is equivalent to global for Axis C++. 2.2. should the handler be explicitly configured to be in a chain? 2.3. What methods should be used on request path to get the current body, change the body, set the new body 2.4. What methods should be used on response path to get the current body, change the body, set the new body Could you please give any samples or link(s) to samples? See the Handler Tutorial here : http://ws.apache.org/axis/cpp/arch/handler.html You will need to use the APIs made available through IMessageData ( [axis install]/include/axis/IMessageData.hpp ) Thank you, -- View this message in context: http://www.nabble.com/Handlers%2C- client.wsdd%2C-change-soap-body-on-request-response-path-tf2252258. html#a6246232 Sent from the Axis - C++ - User forum at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Handlers, client.wsdd, change soap body on request/response path
Hi Adrian, I tried to follow Axis doc on Handlers – and it does not work for me – it looks like that the code of the handlers is executing before Soap message has been created. The content of client.wsdd: ?xml version=1.0 encoding=UTF-8? deployment xmlns=http://xml.apache.org/axis/wsdd/; xmlns:C=http://xml.apache.org/axis/wsdd/providers/c; globalConfiguration requestFlow handler name=PolicyDecision type=C:\Projects\Apache\Axis\lib\PolicyDecisionHandler.dll/ /requestFlow responseFlow handler name=PolicyDecision type=C:\Projects\Apache\Axis\lib\PolicyDecisionHandler.dll/ /responseFlow /globalConfiguration transport name =http requestFlow handler name=PolicyDecision type=C:\Projects\Apache\Axis\lib\PolicyDecisionHandler.dll/ /requestFlow responseFlow handler name=PolicyDecision type=C:\Projects\Apache\Axis\lib\PolicyDecisionHandler.dll/ /responseFlow /transport /deployment The Handler code: int PolicyHandler::invoke(void *pvIMsg) { // cout file = __FILE__ , method =__FUNCTION__ endl; IMessageData* pIMsg = (IMessageData*) pvIMsg; IHandlerSoapSerializer* pISZ; pIMsg-getSoapSerializer(pISZ); IHandlerSoapDeSerializer* pIDZ; pIMsg-getSoapDeSerializer(pIDZ); AxisChar* pSoapBody = 0; if( pIMsg-isPastPivot() ) {/*this is a response*/ cout file = __FILE__ , method = __FUNCTION__ , This is a response!!! endl; (1) pSoapBody = (char*)pISZ-getBodyAsString(); // returns 0 (as implemented) (3) pSoapBody = pIDZ-getBodyAsChar();// just try if works here, throws an exception } else { /*this is a request*/ cout file = __FILE__ , method = __FUNCTION__ , This is a request!!! endl; try { // set new body for calculator service (2)pIDZ-setNewSoapBody((char*)ns1:div xmlns:ns1=\http://tempuri.org/\;ns1:in01/ns1:in0ns1:in110/ns1:in1/ns1:div); (3)pSoapBody = pIDZ-getBodyAsChar(); // throws an exception } catch ( ... ) { cout file = __FILE__ , method = __FUNCTION__ , error when request endl; } } return AXIS_SUCCESS; } (1) returns 0 (2) executes, can see in trace, however the body have not really changed (3) throws and exceptions Could you please give me advice/hint – what is wrong PLEASE HELP Thank you and best regards, Leonid Thank you, Leonid Adrian Dick wrote: Hi, I'd recommend you read the Handler Tutorial here : http://ws.apache.org/axis/cpp/arch/handler.html Personally, I would advise only to modify the soap headers and not the soap body within handlers in Axis C++. The APIs you can use are made available through the IMessageData object ( [axis install]/include/axis/IMessageData.hpp ). Regards, Adrian ___ Adrian Dick ([EMAIL PROTECTED]) Krankurs Leonid [EMAIL PROTECTED] wrote on 11/09/2006 14:02:53: Could anybody please clarify if the following can be done by Axis C++ 1.6 client side (all methods that needed have been implemented already in Axis C++ 1.6 build) 1. Handler can change the soap body of the message on request/response path 2. if (1) yes, how the handler(s) needs to be configured in client.wsdd? 2.0. from what base class should the handler be derived 2.1. what type(level) of the handler should it be (service, global, transport) This depends on the behaviour you're expecting. service - this handler is used when invoking a given service - you can specify the same handler for more than one service global - this handler is used when invoking any service transport - Due to only supporting HTTP(S) this is equivalent to global for Axis C++. 2.2. should the handler be explicitly configured to be in a chain? 2.3. What methods should be used on request path to get the current body, change the body, set the new body 2.4. What methods should be used on response path to get the current body, change the body, set the new body Could you please give any samples or link(s) to samples? See the Handler Tutorial here : http://ws.apache.org/axis/cpp/arch/handler.html You will need to use the APIs made available through IMessageData ( [axis install]/include/axis/IMessageData.hpp ) Thank you, -- View this message in context: http://www.nabble.com/Handlers%2C- client.wsdd%2C-change-soap-body-on-request-response-path-tf2252258. html#a6246232 Sent from the Axis - C++ - User forum
Re: Handlers and Dynamic Header info
Have the caller enter this data into the SOAP header when they make the service call and then read it from the message header in your server-side handler to use/process it. By design, standard (Axis/RPC) handlers are thread-safe. On 3/22/06, Michael Rasmussen [EMAIL PROTECTED] wrote: Hi, I have just written a handler to insert an element into my header. This works fine. Now I need to be able to insert a value into the header on a per call basis ( I need a different value determined by the caller). I should note here that I don't know why this isn't a parameter in the method, but then again I didn't write the service, so I don't have any control over it. Basically what I need is a way for the caller to either insert into the MessageContext or something similar. As expected whatever solution I use has to be threadsafe. One thing I considered was to create a hash map that is the value with the thread id as the hash. Does anyone know how to accomplish what I am talking about? Thanks in advance,Michael Rasmussen
Re: Handlers and Dynamic Header info
Hmm...maybe caller is not the best term. I'm not talking about the caller of the service and reading it on the server side. I am talking about the caller of the SOAP method (the one generated by axis) passing the value to the handler (Still on the client side) so that it can be inserted into the request header. I could do all this by modifying the wsdl2java generated code, but that would be a suboptimal solution in my mind. MichaelOn 3/22/06, Soactive Inc [EMAIL PROTECTED] wrote: Have the caller enter this data into the SOAP header when they make the service call and then read it from the message header in your server-side handler to use/process it. By design, standard (Axis/RPC) handlers are thread-safe. On 3/22/06, Michael Rasmussen [EMAIL PROTECTED] wrote: Hi, I have just written a handler to insert an element into my header. This works fine. Now I need to be able to insert a value into the header on a per call basis ( I need a different value determined by the caller). I should note here that I don't know why this isn't a parameter in the method, but then again I didn't write the service, so I don't have any control over it. Basically what I need is a way for the caller to either insert into the MessageContext or something similar. As expected whatever solution I use has to be threadsafe. One thing I considered was to create a hash map that is the value with the thread id as the hash. Does anyone know how to accomplish what I am talking about? Thanks in advance,Michael Rasmussen
Re: Handlers and Dynamic Header info
Thanks for the responses, I found a solution herehttp://ws.apache.org/axis/faq.html#faq18I got rid of the handler and just cast the Soap object to a Stub where I had access to the header. MichaelOn 3/22/06, Michael Rasmussen [EMAIL PROTECTED] wrote: Hmm...maybe caller is not the best term. I'm not talking about the caller of the service and reading it on the server side. I am talking about the caller of the SOAP method (the one generated by axis) passing the value to the handler (Still on the client side) so that it can be inserted into the request header. I could do all this by modifying the wsdl2java generated code, but that would be a suboptimal solution in my mind. MichaelOn 3/22/06, Soactive Inc [EMAIL PROTECTED] wrote: Have the caller enter this data into the SOAP header when they make the service call and then read it from the message header in your server-side handler to use/process it. By design, standard (Axis/RPC) handlers are thread-safe. On 3/22/06, Michael Rasmussen [EMAIL PROTECTED] wrote: Hi, I have just written a handler to insert an element into my header. This works fine. Now I need to be able to insert a value into the header on a per call basis ( I need a different value determined by the caller). I should note here that I don't know why this isn't a parameter in the method, but then again I didn't write the service, so I don't have any control over it. Basically what I need is a way for the caller to either insert into the MessageContext or something similar. As expected whatever solution I use has to be threadsafe. One thing I considered was to create a hash map that is the value with the thread id as the hash. Does anyone know how to accomplish what I am talking about? Thanks in advance,Michael Rasmussen
Re: Handlers in Axis2
Hi Brian; Handlers are stateless across multiple invocations. You should store the states in the OperationContext (msgctx.getOperationContext()). Get back if that do not solve your problem. Thanks Srinath On 1/31/06, Brian Shields [EMAIL PROTECTED] wrote: Hello, When using the same handler for inflow and outflow messages, does axis2 create a seperate object of the handler for the different flow. It uses the same object for all inflows, but is there a second object for all outflow messages? It is confusing as the two instances of the handler (if there are two instances) have the same object hashCode, yet when using a java collection object within the handler, the outflow cannot see the same collection object as the inflow?? Any suggestions? -- Brian Shields BSc. MSc., PhD Candidate, Department of Information Technology, National University of Ireland, Galway, Ireland. -- Srinath Perera: http://www.cs.indiana.edu/~hperera/ http://www.bloglines.com/blog/hemapani
Re: Handlers in Axis2
Thanks Srinath, using the OperationContext I can persist object state between the request and the reply. Regards, Brian. Srinath Perera wrote: Hi Brian; Handlers are stateless across multiple invocations. You should store the states in the OperationContext (msgctx.getOperationContext()). Get back if that do not solve your problem. Thanks Srinath On 1/31/06, Brian Shields [EMAIL PROTECTED] wrote: Hello, When using the same handler for inflow and outflow messages, does axis2 create a seperate object of the handler for the different flow. It uses the same object for all inflows, but is there a second object for all outflow messages? It is confusing as the two instances of the handler (if there are two instances) have the same object hashCode, yet when using a java collection object within the handler, the outflow cannot see the same collection object as the inflow?? Any suggestions? -- Brian Shields BSc. MSc., PhD Candidate, Department of Information Technology, National University of Ireland, Galway, Ireland. -- Srinath Perera: http://www.cs.indiana.edu/~hperera/ http://www.bloglines.com/blog/hemapani -- Brian Shields BSc. MSc., PhD Candidate, Department of Information Technology, National University of Ireland, Galway, Ireland.
Re: Handlers in Axis2
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Hi Brian, Small clarification. OperationContext is not only for request-response (In-Out). It is per MEP. But for the time being we support InOut and In only MEPs. - -- Chinthaka Brian Shields wrote: Thanks Srinath, using the OperationContext I can persist object state between the request and the reply. Regards, Brian. Srinath Perera wrote: Hi Brian; Handlers are stateless across multiple invocations. You should store the states in the OperationContext (msgctx.getOperationContext()). Get back if that do not solve your problem. Thanks Srinath On 1/31/06, Brian Shields [EMAIL PROTECTED] wrote: Hello, When using the same handler for inflow and outflow messages, does axis2 create a seperate object of the handler for the different flow. It uses the same object for all inflows, but is there a second object for all outflow messages? It is confusing as the two instances of the handler (if there are two instances) have the same object hashCode, yet when using a java collection object within the handler, the outflow cannot see the same collection object as the inflow?? Any suggestions? -- Brian Shields BSc. MSc., PhD Candidate, Department of Information Technology, National University of Ireland, Galway, Ireland. -- Srinath Perera: http://www.cs.indiana.edu/~hperera/ http://www.bloglines.com/blog/hemapani -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.2 (MingW32) iD8DBQFD33mrjON2uBzUhh8RAqZRAKCVhs22wm+y3Li53GXGhqdOs2R1xwCgqeo0 C3/4iz1DlcUzrSgbZSShfeQ= =PZnG -END PGP SIGNATURE-
Re: Handlers, and methods
You can think of writing a custom handler that does the checking of message contents and adding a mention of it in the globalConfiguration placeholder of server-config.wsdd. Handlers specified in this placeholder will be invoked after the transport specific handlers but *before* the service method invocation. Transport - Global - ServiceSpecific handlers [This is on server side] HTH, Jaya On Wed, 16 Mar 2005 14:09:40 +, Dan O'Neill [EMAIL PROTECTED] wrote: Is it possible to make a handler invoke after a method is invoked? Or if not is it possible to have all your messages filtered and if they contain a certain something etc., then do something else? The second part I can do but how do you filter all messages? Can anyone help? Dan -- -- Jaya
Re: Handlers, and methods
Ahhh... Brilliant... Thanks for the reply! And great idea. Any idea where I'd find out about content filtering? As in a quick method to search through a soap msg? It doesn't have to be very good or quick... Many thanks for the idea anyway if you cant. Dan On Thu, 17 Mar 2005 18:15:07 +0530, jayachandra [EMAIL PROTECTED] wrote: You can think of writing a custom handler that does the checking of message contents and adding a mention of it in the globalConfiguration placeholder of server-config.wsdd. Handlers specified in this placeholder will be invoked after the transport specific handlers but *before* the service method invocation. Transport - Global - ServiceSpecific handlers [This is on server side] HTH, Jaya On Wed, 16 Mar 2005 14:09:40 +, Dan O'Neill [EMAIL PROTECTED] wrote: Is it possible to make a handler invoke after a method is invoked? Or if not is it possible to have all your messages filtered and if they contain a certain something etc., then do something else? The second part I can do but how do you filter all messages? Can anyone help? Dan -- -- Jaya -- Classic Family Guy. Yes, but no sprinkles. For every sprinkle i find, i shall KILL you. - Stewie And Joe, I've had new neighbors before, but none of them were half the man you are. Since you're half a man already, that splits them into some kind of fraction I can't even measure. - Peter Hello, 911? It's Quagmire. Yeah, it's caught in the window this time. Quagmire I got an idea, an idea so smart my head would explode if I even began to know what I was talking about. - Peter
Re: Handlers, GUI's and problems... (Java, Axis)
If I understand you correctly, you want the server side to call a service on the client side? It's possible but not practical. Primarily because the server side is now suddenly a client, and has to know every client IP that is accessing it. How do you deal with proxies and dynamic IPs? You are going to have a very hard time guaranteeing all client sides that your server side can call them. It sounds like what you should probably do is poll the server for some sort of update, and on the server side keep a database (or in memory) table of updates that specific clients should get data from if its available. However, it's not entirely possible to do this... if you happen to have a central server and you want internal clients to be known by the server, that is possible. For example, a rendering farm may have a central server that a single client puts a task on to it. The task could be broken down into sub-tasks that the server then hands off to clients to carry out. There are any number of setups like this, this is just one example. Remote administration of a cluster of J2EE servers is another example, where at least one server that you remote to is aware of all the servers in the cluster, or even enterprise. --- Dan O'Neill [EMAIL PROTECTED] wrote: Hi all, If have a system with handlers on both the server and client side. Now I was wondering is it possible to call a GUI on the client side when a certain server side handler is called? What way would I go about it? Anybody done this before or know if it is possible? Now, I don't need code, just the workings? and if its possible? Thanks so much all. Dan __ Do you Yahoo!? Make Yahoo! your home page http://www.yahoo.com/r/hs
RE: Handlers in wsad5.1.2
Hi, I have never used WSAD for anything ! I am not sure that anyone in FINEOS has before. Sorry about that, Brian -Original Message-From: Terance Dias [mailto:[EMAIL PROTECTED]Sent: 03 March 2005 10:37To: apacheSubject: Handlers in wsad5.1.2 Hi, I'm using WSAD5.1.2. How do I make the client invoke the clientside handler? I've tried including the handler class in the webservicesclient.xml file, but it works only when I use the TestClient.jsp. If I create my own client,theclient side handler doesn't get called. Any help on how I can getit to work will be appreciated. Terance. __Do You Yahoo!?Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com ** The information contained in this e-mail is confidential, may be privileged and is intended only for the user of the recipient named above. If you are not the intended recipient or a representative of the intended recipient, you have received this e-mail in error and must not copy, use or disclose the contents of this e-mail to anybody else. If you have received this e-mail in error, please notify the sender immediately by return e-mail and permanently delete the copy you received. This e-mail has been swept for computer viruses. However, you should carry out your own virus checks. Registered in Ireland, No. 205721. http://www.FINEOS.com **