axis-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Benedikt Heintel <hein...@seceng.informatik.tu-darmstadt.de>
Subject Re: Modify Web Service Call
Date Wed, 08 Sep 2010 13:39:58 GMT
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


Mime
View raw message