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: [email protected] > For additional commands, e-mail: [email protected] > > --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
