You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@axis.apache.org by Benedikt Heintel <he...@seceng.informatik.tu-darmstadt.de> on 2010/09/07 14:04:49 UTC

Modify Web Service Call

Dear List,

I'm on a project that needs to change a web service call based on the
header of a SOAP message. The goal is to implement a switch in axis,
that enables an additional "-javaagent" call if a special header is set.
I thought about using the module architecture if possible.

I need to understand:
o Which class handles the start-up information to the JVM?
o Where and how can I change the parameter based on the header information?
o Is it a good idea to use the module architecture?

Thank you for your help,
Benedikt


---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@axis.apache.org
For additional commands, e-mail: java-user-help@axis.apache.org


Re: Modify Web Service Call

Posted by Glen Daniels <gl...@thoughtcraft.com>.
Hi Benedikt,

It seems that LimpidLog is dynamically configurable in code [1].  If that's
the case, then perhaps you can just stick a custom Handler before and after
the MessageReceiver, and do something like:

    if (messageContext.isPropertyTrue("logServiceCalls")) {
	String myServiceClassName =
            messageContext.getProperty("serviceClass");
        clientTalk.sendCommand("register", myServiceClassName);
    }

--Glen

[1] http://www.acelet.com/limpidlog/LimpidLog.html#Programmatically configure

On 9/9/2010 11:52 AM, Benedikt Heintel wrote:
> Actually, yes. I should be able if I do AOP based on policies given by
> the creator of the web service. Eventually, I can work on jars directly.
> 
> Right now we play around with Limpid Log [1]. This loggers uses the
> JVMTI [2].
> 
> We will see what's the best way to handle it.
> 
> Cheers,
> Benedikt
> 
> [1] http://www.acelet.com/limpidlog/index.html
> [2] http://download.oracle.com/javase/6/docs/platform/jvmti/jvmti.html
> 
> On 09.09.2010 17:49, nch wrote:
>>
>>   I thought you'd said you had the binaries (jars). You might (I'm not sure) be able to apply AOP (AspectWerkz, ...) on them.
>>
>>   Cheers.
>>
>> --- El jue, 9/9/10, Benedikt Heintel <he...@seceng.informatik.tu-darmstadt.de> escribió:
>>
>>> De: Benedikt Heintel <he...@seceng.informatik.tu-darmstadt.de>
>>> Asunto: Re: Modify Web Service Call
>>> Para: java-user@axis.apache.org
>>> Fecha: jueves, 9 de septiembre, 2010 14:08
>>> Hi nch,
>>>
>>> I checked AOP and it looks promising, but I'm not sure how
>>> I can use it
>>> with unknown implementations of web services.
>>> If I would use it for WS logging I need to parse the WSDL
>>> because I
>>> don't know anything about the service and its methods.
>>>
>>> Benedikt
>>>
>>> On 09.09.2010 09:19, nch wrote :
>>>>
>>>>    AOP might also help you. Logging is
>>> one of the most common use cases.
>>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: java-user-unsubscribe@axis.apache.org
>>> For additional commands, e-mail: java-user-help@axis.apache.org
>>>
>>>
>>
>>
>>       
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: java-user-unsubscribe@axis.apache.org
>> For additional commands, e-mail: java-user-help@axis.apache.org
>>
>>
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: java-user-unsubscribe@axis.apache.org
> For additional commands, e-mail: java-user-help@axis.apache.org
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@axis.apache.org
For additional commands, e-mail: java-user-help@axis.apache.org


Re: Modify Web Service Call

Posted by Benedikt Heintel <he...@seceng.informatik.tu-darmstadt.de>.
Actually, yes. I should be able if I do AOP based on policies given by
the creator of the web service. Eventually, I can work on jars directly.

Right now we play around with Limpid Log [1]. This loggers uses the
JVMTI [2].

We will see what's the best way to handle it.

Cheers,
Benedikt

[1] http://www.acelet.com/limpidlog/index.html
[2] http://download.oracle.com/javase/6/docs/platform/jvmti/jvmti.html

On 09.09.2010 17:49, nch wrote:
> 
>   I thought you'd said you had the binaries (jars). You might (I'm not sure) be able to apply AOP (AspectWerkz, ...) on them.
> 
>   Cheers.
> 
> --- El jue, 9/9/10, Benedikt Heintel <he...@seceng.informatik.tu-darmstadt.de> escribió:
> 
>> De: Benedikt Heintel <he...@seceng.informatik.tu-darmstadt.de>
>> Asunto: Re: Modify Web Service Call
>> Para: java-user@axis.apache.org
>> Fecha: jueves, 9 de septiembre, 2010 14:08
>> Hi nch,
>>
>> I checked AOP and it looks promising, but I'm not sure how
>> I can use it
>> with unknown implementations of web services.
>> If I would use it for WS logging I need to parse the WSDL
>> because I
>> don't know anything about the service and its methods.
>>
>> Benedikt
>>
>> On 09.09.2010 09:19, nch wrote :
>>>
>>>    AOP might also help you. Logging is
>> one of the most common use cases.
>>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: java-user-unsubscribe@axis.apache.org
>> For additional commands, e-mail: java-user-help@axis.apache.org
>>
>>
> 
> 
>       
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: java-user-unsubscribe@axis.apache.org
> For additional commands, e-mail: java-user-help@axis.apache.org
> 
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@axis.apache.org
For additional commands, e-mail: java-user-help@axis.apache.org


Re: Modify Web Service Call

Posted by nch <un...@yahoo.com>.
  I thought you'd said you had the binaries (jars). You might (I'm not sure) be able to apply AOP (AspectWerkz, ...) on them.

  Cheers.

--- El jue, 9/9/10, Benedikt Heintel <he...@seceng.informatik.tu-darmstadt.de> escribió:

> De: Benedikt Heintel <he...@seceng.informatik.tu-darmstadt.de>
> Asunto: Re: Modify Web Service Call
> Para: java-user@axis.apache.org
> Fecha: jueves, 9 de septiembre, 2010 14:08
> Hi nch,
> 
> I checked AOP and it looks promising, but I'm not sure how
> I can use it
> with unknown implementations of web services.
> If I would use it for WS logging I need to parse the WSDL
> because I
> don't know anything about the service and its methods.
> 
> Benedikt
> 
> On 09.09.2010 09:19, nch wrote :
> > 
> >   AOP might also help you. Logging is
> one of the most common use cases.
> > 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: java-user-unsubscribe@axis.apache.org
> For additional commands, e-mail: java-user-help@axis.apache.org
> 
> 


      

---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@axis.apache.org
For additional commands, e-mail: java-user-help@axis.apache.org


Re: Modify Web Service Call

Posted by Benedikt Heintel <he...@seceng.informatik.tu-darmstadt.de>.
Hi nch,

I checked AOP and it looks promising, but I'm not sure how I can use it
with unknown implementations of web services.
If I would use it for WS logging I need to parse the WSDL because I
don't know anything about the service and its methods.

Benedikt

On 09.09.2010 09:19, nch wrote :
> 
>   AOP might also help you. Logging is one of the most common use cases.
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@axis.apache.org
For additional commands, e-mail: java-user-help@axis.apache.org


Re: Modify Web Service Call

Posted by nch <un...@yahoo.com>.
  AOP might also help you. Logging is one of the most common use cases.


--- El mié, 8/9/10, Glen Daniels <gl...@thoughtcraft.com> escribió:

> De: Glen Daniels <gl...@thoughtcraft.com>
> Asunto: Re: Modify Web Service Call
> Para: java-user@axis.apache.org
> Fecha: miércoles, 8 de septiembre, 2010 16:41
> Hi Benedikt,
> 
> On 9/8/2010 10:20 AM, Benedikt Heintel wrote:
> > If all web service instances are started in the same
> container, I need
> > to find out how to separate them for logging.
> > 
> > Since we cannot change the web services (they are
> jared and will not
> > contain source code), we need to find a way to enable
> the logging, based
> > on the information we receive with the SOAP message.
> 
> It is certainly very easy (as Deepal has described) to use
> a Handler to
> execute arbitrary code during the execution of a service
> request, so you just
> need to figure out how to enable/disable your logging for
> particular threads
> and you should be good to go.
> 
> Are you using a homegrown logging tool, or an open source
> framework?
> 
> --Glen
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: java-user-unsubscribe@axis.apache.org
> For additional commands, e-mail: java-user-help@axis.apache.org
> 
> 


      

---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@axis.apache.org
For additional commands, e-mail: java-user-help@axis.apache.org


Re: Modify Web Service Call

Posted by Benedikt Heintel <he...@seceng.informatik.tu-darmstadt.de>.
Hi Glen

> It is certainly very easy (as Deepal has described) to use a Handler to
> execute arbitrary code during the execution of a service request, so you just
> need to figure out how to enable/disable your logging for particular threads
> and you should be good to go.
> 
> Are you using a homegrown logging tool, or an open source framework?

There was no decision about the logger yet, because it depends much on
the tasks to do and where we need to catch the required information. Our
approach is to set on existing (open source) code to minimize errors.

Since we have the special purpose to log information thrown during
execution, we might go for LimpidLog, a logger that is using the JVMTI
and that does not need any code modification in the services themselves.

In the end we like to publish an easy to use open source toolkit that
enables process logging on remote systems by just adding two or three
modules.

Benedikt

---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@axis.apache.org
For additional commands, e-mail: java-user-help@axis.apache.org


Re: Modify Web Service Call

Posted by Glen Daniels <gl...@thoughtcraft.com>.
Hi Benedikt,

On 9/8/2010 10:20 AM, Benedikt Heintel wrote:
> If all web service instances are started in the same container, I need
> to find out how to separate them for logging.
> 
> Since we cannot change the web services (they are jared and will not
> contain source code), we need to find a way to enable the logging, based
> on the information we receive with the SOAP message.

It is certainly very easy (as Deepal has described) to use a Handler to
execute arbitrary code during the execution of a service request, so you just
need to figure out how to enable/disable your logging for particular threads
and you should be good to go.

Are you using a homegrown logging tool, or an open source framework?

--Glen

---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@axis.apache.org
For additional commands, e-mail: java-user-help@axis.apache.org


Re: Modify Web Service Call

Posted by Benedikt Heintel <he...@seceng.informatik.tu-darmstadt.de>.
Hi Glen,

Your information brings me a big step closer to my goal, however makes
it bit more complicate in logging issues. Now I understand the internal
behavior of Axis2. The whole issue was really based on misunderstanding.

If all web service instances are started in the same container, I need
to find out how to separate them for logging.

Since we cannot change the web services (they are jared and will not
contain source code), we need to find a way to enable the logging, based
on the information we receive with the SOAP message.

Let me try something out and I come back with questions when they encounter.

Thank you for the insight,
Benedikt


On 08.09.2010 15:43, Glen Daniels wrote:
> Hi Benedikt,
> 
> On 9/8/2010 5:57 AM, Benedikt Heintel wrote:
>> If there is no id in the header, Axis will proceed its normal procedure
>> and in the end call the service with "java -cp
>> de.tud.informatik.seceng.calc.Calculator.class add 40 10".
>>
>> Else if the id parameter is set, it should call the same service with
>> "java -javaagent:agent.jar=200 -cp
>> de.tud.informatik.seceng.calc.Calculator.class add 40 10".
> 
> This is the misunderstanding here, I think.  Axis2 does not actually spawn a
> separate process/JVM for each invocation.  All Axis2 processing happens in a
> single JVM, and the "end of the road" as far as we're concerned is something
> called a MessageReceiver - a special Handler whose job is to do the "real
> work" (i.e. the business logic) of the service.  Of course, nothing prevents
> the MessageReceiver from invoking another process itself, but then we come to
> our second issue.
> 
> Service classes are called directly by Axis2, without a command-line
> interface.  So rather than "java Calculator add 40 10" (which calls
> Calculator.main()), we end up invoking calculator.add(40, 10) on an instance
> of Calculator.
> 
> So... if your service class (Calculator in the example here) is already set
> up to process command line arguments, you can certainly write a custom
> MessageReceiver which unpacks the SOAP request into string arguments and then
> invokes your class with or without the -javaagent argument depending on the
> presence or absence of the header.
> 
> While this would work, it does lose a lot of the convenience and power of the
> Axis2 framework, not to mention that spawning a separate JVM for each and
> every web service invocation would be quite expensive and slow.  Have you
> considered alternatives to the need for the -javaagent argument?  I believe
> you said you needed this for custom logging.... is there some way you can
> either use another logging framework, or modify the one you've got to have
> finer-grained control inside a JVM (so you can still run in-process but have
> the logs configured on a per-request basis, perhaps with a thread-local)?
> 
> Thanks,
> --Glen
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: java-user-unsubscribe@axis.apache.org
> For additional commands, e-mail: java-user-help@axis.apache.org
> 
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@axis.apache.org
For additional commands, e-mail: java-user-help@axis.apache.org


Re: Modify Web Service Call

Posted by Glen Daniels <gl...@thoughtcraft.com>.
Hi Benedikt,

On 9/8/2010 5:57 AM, Benedikt Heintel wrote:
> If there is no id in the header, Axis will proceed its normal procedure
> and in the end call the service with "java -cp
> de.tud.informatik.seceng.calc.Calculator.class add 40 10".
> 
> Else if the id parameter is set, it should call the same service with
> "java -javaagent:agent.jar=200 -cp
> de.tud.informatik.seceng.calc.Calculator.class add 40 10".

This is the misunderstanding here, I think.  Axis2 does not actually spawn a
separate process/JVM for each invocation.  All Axis2 processing happens in a
single JVM, and the "end of the road" as far as we're concerned is something
called a MessageReceiver - a special Handler whose job is to do the "real
work" (i.e. the business logic) of the service.  Of course, nothing prevents
the MessageReceiver from invoking another process itself, but then we come to
our second issue.

Service classes are called directly by Axis2, without a command-line
interface.  So rather than "java Calculator add 40 10" (which calls
Calculator.main()), we end up invoking calculator.add(40, 10) on an instance
of Calculator.

So... if your service class (Calculator in the example here) is already set
up to process command line arguments, you can certainly write a custom
MessageReceiver which unpacks the SOAP request into string arguments and then
invokes your class with or without the -javaagent argument depending on the
presence or absence of the header.

While this would work, it does lose a lot of the convenience and power of the
Axis2 framework, not to mention that spawning a separate JVM for each and
every web service invocation would be quite expensive and slow.  Have you
considered alternatives to the need for the -javaagent argument?  I believe
you said you needed this for custom logging.... is there some way you can
either use another logging framework, or modify the one you've got to have
finer-grained control inside a JVM (so you can still run in-process but have
the logs configured on a per-request basis, perhaps with a thread-local)?

Thanks,
--Glen

---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@axis.apache.org
For additional commands, e-mail: java-user-help@axis.apache.org


Re: Modify Web Service Call

Posted by Benedikt Heintel <he...@seceng.informatik.tu-darmstadt.de>.
I'm sorry, I forgot to mention two important things:

1) I'm not able to change the java class (the actual web service),
otherwise it would be easy to get the ID inside and start a class.

2) I need to start a logger that runs in the same JVM instance as the
web service. As far as I know it is only possible, if the logger is
started with the -javaagent option. The agent needs the ID for
identification of the called service (the ID will be part of the log
file's name).

Actually I was only thinking in this direction. Maybe there are other
ways to start a logging service in the same JVM instance as the service
itself. The ID is generated at client side and will be used for logging
on both sides. It should make sure one can join the remote and the local
log thereafter.

Benedikt

On 08.09.2010 15:07, Deepal Jayasinghe wrote:
>  Now I understand what you want to do. You can achieve this very easily
> by doing the following.
>  - Using your handler extract the value of ID and add as a property (in
> MessageContext)
>  - At the Java class you can get the MessageContext and look for the
> property
>  - If the property is there then you can do the same thing when you do
> the java call
> 
> you java class will have something like below;
> 
> public int add(int a, int b){
>     String value =
> MessageContext.getCurrentMessageContext().getProperty("ID");
>     if(value !=null){
> 
>    } else {
> 
>   }
> }
> 
> Deepal
> 
> On 9/8/2010 5:57 AM, Benedikt Heintel wrote:
>> I actually think it must be more easy than this. Let me give an example.
>> In my humble opinion Axis2 is working like this:
>>
>> --SOAP-->|--Check-->--Do something-->--call WS-->|--Java call-->
>>
>> let's assume the following SOAP message, calling a service that should
>> add 40 and 10:
>>
>> <soapenv:Envelope
>> xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
>>    <soapenv:Header>
>>      <ns1:add xmlns:ns1="http://schemas.xmlsoap.org/soap/envelope/">
>>        <id>200<id/>
>>      </ns1:add>
>>    </soapenv:Header>
>>    <soapenv:Body>
>>      <ns2:add xmlns:ns2="http://calc.seceng.informatik.tud.de">
>>        <a>40</a>
>>        <b>10</b>
>>      </ns2:add>
>>    </soapenv:Body>
>> </soapenv:Envelope>
>>
>> Now Axis2 receives the SOAP messages and checks whether the header
>> contains an id tag or not (this can be done by a .mar module).
>>
>> If there is no id in the header, Axis will proceed its normal procedure
>> and in the end call the service with "java -cp
>> de.tud.informatik.seceng.calc.Calculator.class add 40 10".
>>
>> Else if the id parameter is set, it should call the same service with
>> "java -javaagent:agent.jar=200 -cp
>> de.tud.informatik.seceng.calc.Calculator.class add 40 10".
>>
>> The only modification in the call I need to do is to set the -javaagent
>> option and add the ID given in the header.
>>
>> I hope I gave a insight into the idea that is broad enough.
>>
>> Benedikt
>>
>> On 07.09.2010 19:48, wrote Deepal Jayasinghe:
>>>> I'm not sure about the property usage. Did you mean I should let the
>>>> handler process (e.g. start a service) the information?
>>>> In my special case this is not wanted. I really need to start a so
>>>> called java agent for special logging purposes. The Agent and the web
>>>> service need to run in the same instance. That's the reason why I need
>>>> to process the information directly to the JVM.
>>> I thought you need to pass the jvmargs in to the handler. If not you
>>> need to have your own code to process jvmargs and use the appropriate
>>> classes to achieve what you want.
>>>
>>> Thanks,
>>> Deepal
>>>> I would be glad if you have an useful idea.
>>>>
>>>> Thanks,
>>>> Benedikt
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: java-user-unsubscribe@axis.apache.org
>> For additional commands, e-mail: java-user-help@axis.apache.org
>>
>>
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: java-user-unsubscribe@axis.apache.org
> For additional commands, e-mail: java-user-help@axis.apache.org
> 
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@axis.apache.org
For additional commands, e-mail: java-user-help@axis.apache.org


Re: Modify Web Service Call

Posted by Deepal Jayasinghe <de...@opensource.lk>.
  Now I understand what you want to do. You can achieve this very easily 
by doing the following.
  - Using your handler extract the value of ID and add as a property (in 
MessageContext)
  - At the Java class you can get the MessageContext and look for the 
property
  - If the property is there then you can do the same thing when you do 
the java call

you java class will have something like below;

public int add(int a, int b){
     String value = 
MessageContext.getCurrentMessageContext().getProperty("ID");
     if(value !=null){

    } else {

   }
}

Deepal

On 9/8/2010 5:57 AM, Benedikt Heintel wrote:
> I actually think it must be more easy than this. Let me give an example.
> In my humble opinion Axis2 is working like this:
>
> --SOAP-->|--Check-->--Do something-->--call WS-->|--Java call-->
>
> let's assume the following SOAP message, calling a service that should
> add 40 and 10:
>
> <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
>    <soapenv:Header>
>      <ns1:add xmlns:ns1="http://schemas.xmlsoap.org/soap/envelope/">
>        <id>200<id/>
>      </ns1:add>
>    </soapenv:Header>
>    <soapenv:Body>
>      <ns2:add xmlns:ns2="http://calc.seceng.informatik.tud.de">
>        <a>40</a>
>        <b>10</b>
>      </ns2:add>
>    </soapenv:Body>
> </soapenv:Envelope>
>
> Now Axis2 receives the SOAP messages and checks whether the header
> contains an id tag or not (this can be done by a .mar module).
>
> If there is no id in the header, Axis will proceed its normal procedure
> and in the end call the service with "java -cp
> de.tud.informatik.seceng.calc.Calculator.class add 40 10".
>
> Else if the id parameter is set, it should call the same service with
> "java -javaagent:agent.jar=200 -cp
> de.tud.informatik.seceng.calc.Calculator.class add 40 10".
>
> The only modification in the call I need to do is to set the -javaagent
> option and add the ID given in the header.
>
> I hope I gave a insight into the idea that is broad enough.
>
> Benedikt
>
> On 07.09.2010 19:48, wrote Deepal Jayasinghe:
>>> I'm not sure about the property usage. Did you mean I should let the
>>> handler process (e.g. start a service) the information?
>>> In my special case this is not wanted. I really need to start a so
>>> called java agent for special logging purposes. The Agent and the web
>>> service need to run in the same instance. That's the reason why I need
>>> to process the information directly to the JVM.
>> I thought you need to pass the jvmargs in to the handler. If not you
>> need to have your own code to process jvmargs and use the appropriate
>> classes to achieve what you want.
>>
>> Thanks,
>> Deepal
>>> I would be glad if you have an useful idea.
>>>
>>> Thanks,
>>> Benedikt
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: java-user-unsubscribe@axis.apache.org
> For additional commands, e-mail: java-user-help@axis.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@axis.apache.org
For additional commands, e-mail: java-user-help@axis.apache.org


Re: Modify Web Service Call

Posted by Benedikt Heintel <he...@seceng.informatik.tu-darmstadt.de>.
I actually think it must be more easy than this. Let me give an example.
In my humble opinion Axis2 is working like this:

--SOAP-->|--Check-->--Do something-->--call WS-->|--Java call-->

let's assume the following SOAP message, calling a service that should
add 40 and 10:

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
  <soapenv:Header>
    <ns1:add xmlns:ns1="http://schemas.xmlsoap.org/soap/envelope/">
      <id>200<id/>
    </ns1:add>
  </soapenv:Header>
  <soapenv:Body>
    <ns2:add xmlns:ns2="http://calc.seceng.informatik.tud.de">
      <a>40</a>
      <b>10</b>
    </ns2:add>
  </soapenv:Body>
</soapenv:Envelope>

Now Axis2 receives the SOAP messages and checks whether the header
contains an id tag or not (this can be done by a .mar module).

If there is no id in the header, Axis will proceed its normal procedure
and in the end call the service with "java -cp
de.tud.informatik.seceng.calc.Calculator.class add 40 10".

Else if the id parameter is set, it should call the same service with
"java -javaagent:agent.jar=200 -cp
de.tud.informatik.seceng.calc.Calculator.class add 40 10".

The only modification in the call I need to do is to set the -javaagent
option and add the ID given in the header.

I hope I gave a insight into the idea that is broad enough.

Benedikt

On 07.09.2010 19:48, wrote Deepal Jayasinghe:
> 
>> I'm not sure about the property usage. Did you mean I should let the
>> handler process (e.g. start a service) the information?
>> In my special case this is not wanted. I really need to start a so
>> called java agent for special logging purposes. The Agent and the web
>> service need to run in the same instance. That's the reason why I need
>> to process the information directly to the JVM.
> I thought you need to pass the jvmargs in to the handler. If not you
> need to have your own code to process jvmargs and use the appropriate
> classes to achieve what you want.
> 
> Thanks,
> Deepal
>> I would be glad if you have an useful idea.
>>
>> Thanks,
>> Benedikt

---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@axis.apache.org
For additional commands, e-mail: java-user-help@axis.apache.org


Re: Modify Web Service Call

Posted by Deepal Jayasinghe <de...@opensource.lk>.
> I'm not sure about the property usage. Did you mean I should let the
> handler process (e.g. start a service) the information?
> In my special case this is not wanted. I really need to start a so
> called java agent for special logging purposes. The Agent and the web
> service need to run in the same instance. That's the reason why I need
> to process the information directly to the JVM.
I thought you need to pass the jvmargs in to the handler. If not you 
need to have your own code to process jvmargs and use the appropriate 
classes to achieve what you want.

Thanks,
Deepal
> I would be glad if you have an useful idea.
>
> Thanks,
> Benedikt
>
> On 07.09.2010 15:59, wrote Deepal Jayasinghe:
>>
>> On 9/7/2010 9:32 AM, Benedikt Heintel wrote:
>>> Thanks Deepal for the information provided. Adding a handler works, I
>>> can access the data and work on it. Great.
>>> I meant Axis2 modules, right.
>>>
>>> However, I think my first question is wrong or wrongly asked. I try to
>>> rewrite it:
>>> Which class does "translate" the SOAP call into a java executable
>>> command? Means, in which class the java command line call is assembled?
>> There is a class called AxisConfigurator which does some kind of jvmargs
>> processing, but it only looks for two or three paramters. It does not
>> search for custom paramters.
>>
>> You can do something like following.
>>    - Create a main class, and get your jvmargs or program paramters
>>    - Then create a ServiceClient (I believe you want this at the client
>> side)
>>    - Add a property (Options) representing your jvmargs
>>    - Then use that property inside your handler (you can access all the
>> properties using MessageContext)
>>
>> Deepal
>>> Additionally I wonder if I just can use the module (.mar) created to
>>> pass-through the client command.
>>>
>>> Cheers,
>>> Benedikt
>>>
>>> On 07.09.2010 15:13, wrote Deepal jayasinghe:
>>>>> Dear List,
>>>>>
>>>>> I'm on a project that needs to change a web service call based on the
>>>>> header of a SOAP message. The goal is to implement a switch in axis,
>>>>> that enables an additional "-javaagent" call if a special header is
>>>>> set.
>>>>> I thought about using the module architecture if possible.
>>>>>
>>>>> I need to understand:
>>>>> o Which class handles the start-up information to the JVM?
>>>> It is the ConfigurationContextFactory, staring Axis2 is creating a
>>>> ConfigurationContext
>>>>> o Where and how can I change the parameter based on the header
>>>>> information?
>>>> You should be able to achieve this by adding a handler.
>>>>> o Is it a good idea to use the module architecture?
>>>> Its depend, if you are asking Axis2 module (.mar) then answer is yes.
>>>>> Thank you for your help,
>>>>> Benedikt
>>>>>
>>>>>
>>>>> ---------------------------------------------------------------------
>>>>> To unsubscribe, e-mail: java-user-unsubscribe@axis.apache.org
>>>>> For additional commands, e-mail: java-user-help@axis.apache.org
>>>>>
>>>>>
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: java-user-unsubscribe@axis.apache.org
>>>> For additional commands, e-mail: java-user-help@axis.apache.org
>>>>
>>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: java-user-unsubscribe@axis.apache.org
>>> For additional commands, e-mail: java-user-help@axis.apache.org
>>>
>>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: java-user-unsubscribe@axis.apache.org
>> For additional commands, e-mail: java-user-help@axis.apache.org
>>
>>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: java-user-unsubscribe@axis.apache.org
> For additional commands, e-mail: java-user-help@axis.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@axis.apache.org
For additional commands, e-mail: java-user-help@axis.apache.org


Re: Modify Web Service Call

Posted by Benedikt Heintel <he...@seceng.informatik.tu-darmstadt.de>.
Alright,

What I have so far is a WS client that sends a SOAP message with a
"special" header and a handler (as module) that reads the header and
searches for the argument.

I'm not sure about the property usage. Did you mean I should let the
handler process (e.g. start a service) the information?
In my special case this is not wanted. I really need to start a so
called java agent for special logging purposes. The Agent and the web
service need to run in the same instance. That's the reason why I need
to process the information directly to the JVM.

I would be glad if you have an useful idea.

Thanks,
Benedikt

On 07.09.2010 15:59, wrote Deepal Jayasinghe:
> 
> 
> On 9/7/2010 9:32 AM, Benedikt Heintel wrote:
>> Thanks Deepal for the information provided. Adding a handler works, I
>> can access the data and work on it. Great.
>> I meant Axis2 modules, right.
>>
>> However, I think my first question is wrong or wrongly asked. I try to
>> rewrite it:
>> Which class does "translate" the SOAP call into a java executable
>> command? Means, in which class the java command line call is assembled?
> There is a class called AxisConfigurator which does some kind of jvmargs
> processing, but it only looks for two or three paramters. It does not
> search for custom paramters.
> 
> You can do something like following.
>   - Create a main class, and get your jvmargs or program paramters
>   - Then create a ServiceClient (I believe you want this at the client
> side)
>   - Add a property (Options) representing your jvmargs
>   - Then use that property inside your handler (you can access all the
> properties using MessageContext)
> 
> Deepal
>> Additionally I wonder if I just can use the module (.mar) created to
>> pass-through the client command.
>>
>> Cheers,
>> Benedikt
>>
>> On 07.09.2010 15:13, wrote Deepal jayasinghe:
>>>> Dear List,
>>>>
>>>> I'm on a project that needs to change a web service call based on the
>>>> header of a SOAP message. The goal is to implement a switch in axis,
>>>> that enables an additional "-javaagent" call if a special header is
>>>> set.
>>>> I thought about using the module architecture if possible.
>>>>
>>>> I need to understand:
>>>> o Which class handles the start-up information to the JVM?
>>> It is the ConfigurationContextFactory, staring Axis2 is creating a
>>> ConfigurationContext
>>>> o Where and how can I change the parameter based on the header
>>>> information?
>>> You should be able to achieve this by adding a handler.
>>>> o Is it a good idea to use the module architecture?
>>> Its depend, if you are asking Axis2 module (.mar) then answer is yes.
>>>> Thank you for your help,
>>>> Benedikt
>>>>
>>>>
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: java-user-unsubscribe@axis.apache.org
>>>> For additional commands, e-mail: java-user-help@axis.apache.org
>>>>
>>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: java-user-unsubscribe@axis.apache.org
>>> For additional commands, e-mail: java-user-help@axis.apache.org
>>>
>>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: java-user-unsubscribe@axis.apache.org
>> For additional commands, e-mail: java-user-help@axis.apache.org
>>
>>
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: java-user-unsubscribe@axis.apache.org
> For additional commands, e-mail: java-user-help@axis.apache.org
> 
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@axis.apache.org
For additional commands, e-mail: java-user-help@axis.apache.org


Re: Modify Web Service Call

Posted by Deepal Jayasinghe <de...@opensource.lk>.

On 9/7/2010 9:32 AM, Benedikt Heintel wrote:
> Thanks Deepal for the information provided. Adding a handler works, I
> can access the data and work on it. Great.
> I meant Axis2 modules, right.
>
> However, I think my first question is wrong or wrongly asked. I try to
> rewrite it:
> Which class does "translate" the SOAP call into a java executable
> command? Means, in which class the java command line call is assembled?
There is a class called AxisConfigurator which does some kind of jvmargs 
processing, but it only looks for two or three paramters. It does not 
search for custom paramters.

You can do something like following.
   - Create a main class, and get your jvmargs or program paramters
   - Then create a ServiceClient (I believe you want this at the client 
side)
   - Add a property (Options) representing your jvmargs
   - Then use that property inside your handler (you can access all the 
properties using MessageContext)

Deepal
> Additionally I wonder if I just can use the module (.mar) created to
> pass-through the client command.
>
> Cheers,
> Benedikt
>
> On 07.09.2010 15:13, wrote Deepal jayasinghe:
>>> Dear List,
>>>
>>> I'm on a project that needs to change a web service call based on the
>>> header of a SOAP message. The goal is to implement a switch in axis,
>>> that enables an additional "-javaagent" call if a special header is set.
>>> I thought about using the module architecture if possible.
>>>
>>> I need to understand:
>>> o Which class handles the start-up information to the JVM?
>> It is the ConfigurationContextFactory, staring Axis2 is creating a
>> ConfigurationContext
>>> o Where and how can I change the parameter based on the header
>>> information?
>> You should be able to achieve this by adding a handler.
>>> o Is it a good idea to use the module architecture?
>> Its depend, if you are asking Axis2 module (.mar) then answer is yes.
>>> Thank you for your help,
>>> Benedikt
>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: java-user-unsubscribe@axis.apache.org
>>> For additional commands, e-mail: java-user-help@axis.apache.org
>>>
>>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: java-user-unsubscribe@axis.apache.org
>> For additional commands, e-mail: java-user-help@axis.apache.org
>>
>>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: java-user-unsubscribe@axis.apache.org
> For additional commands, e-mail: java-user-help@axis.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@axis.apache.org
For additional commands, e-mail: java-user-help@axis.apache.org


Re: Modify Web Service Call

Posted by Benedikt Heintel <he...@seceng.informatik.tu-darmstadt.de>.
Thanks Deepal for the information provided. Adding a handler works, I
can access the data and work on it. Great.
I meant Axis2 modules, right.

However, I think my first question is wrong or wrongly asked. I try to
rewrite it:
Which class does "translate" the SOAP call into a java executable
command? Means, in which class the java command line call is assembled?

Additionally I wonder if I just can use the module (.mar) created to
pass-through the client command.

Cheers,
Benedikt

On 07.09.2010 15:13, wrote Deepal jayasinghe:
> 
>> Dear List,
>>
>> I'm on a project that needs to change a web service call based on the
>> header of a SOAP message. The goal is to implement a switch in axis,
>> that enables an additional "-javaagent" call if a special header is set.
>> I thought about using the module architecture if possible.
>>
>> I need to understand:
>> o Which class handles the start-up information to the JVM?
> It is the ConfigurationContextFactory, staring Axis2 is creating a
> ConfigurationContext
>> o Where and how can I change the parameter based on the header
>> information?
> You should be able to achieve this by adding a handler.
>> o Is it a good idea to use the module architecture?
> Its depend, if you are asking Axis2 module (.mar) then answer is yes.
>> Thank you for your help,
>> Benedikt
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: java-user-unsubscribe@axis.apache.org
>> For additional commands, e-mail: java-user-help@axis.apache.org
>>
>>
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: java-user-unsubscribe@axis.apache.org
> For additional commands, e-mail: java-user-help@axis.apache.org
> 
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@axis.apache.org
For additional commands, e-mail: java-user-help@axis.apache.org


Re: Modify Web Service Call

Posted by Deepal jayasinghe <de...@gmail.com>.
> Dear List,
>
> I'm on a project that needs to change a web service call based on the
> header of a SOAP message. The goal is to implement a switch in axis,
> that enables an additional "-javaagent" call if a special header is set.
> I thought about using the module architecture if possible.
>
> I need to understand:
> o Which class handles the start-up information to the JVM?
It is the ConfigurationContextFactory, staring Axis2 is creating a 
ConfigurationContext
> o Where and how can I change the parameter based on the header information?
You should be able to achieve this by adding a handler.
> o Is it a good idea to use the module architecture?
Its depend, if you are asking Axis2 module (.mar) then answer is yes.
> Thank you for your help,
> Benedikt
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: java-user-unsubscribe@axis.apache.org
> For additional commands, e-mail: java-user-help@axis.apache.org
>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@axis.apache.org
For additional commands, e-mail: java-user-help@axis.apache.org