Arun Gupta, Miles to go ...

Arun Gupta is a technology enthusiast, a passionate runner, and a community guy who works for Sun Microsystems.
« WSIT defined in... | Main | What is Web 2.0 ? »

http://blogs.sun.com/arungupta/date/20061204 Monday December 04, 2006

Message Logging in WSIT Updated

An update to original set of properties is now available.

THE FOLLOWING PROPERTIES ARE PROPRIETARY.  THEY MAY CHANGE.

We are providing this information to help with development and debugging.  These properties should not be used in deployments.

WSIT Pipeline Assembler exposes multiple system properties to enable SOAP message logging using DumpPipe. Each property, if it's value is set to true, injects a DumpPipe before or after a WSIT component pipe in the pipeline. This allows the developer to monitor message dumps at several points through out the pipeline, for example before and after encryption. 

The legend that derives the property names is given below. A detailed list of property names and their injection points are given in the table further below. Example usages of these properties is given at the end. The table also shows a convenience property, com.sun.xml.ws.assembler.XXX.action, that displays only the wsa:To and wsa:Action header on XXX (client or server) inbound and outbound messages.  

Legend:

  1. com.sun.xml.ws.assembler.client prefix indicates client-side properties
  2. com.sun.xml.ws.assembler.server prefix indicates server-side properties
  3. .after suffix indicates after (before) on client outbound (inbound) and server inbound (outbound).
  4. .before suffix indicates before (after) on client outbound (inbound) and server inbound (outbound). 

Table 1: List of property names and injection points

Property Name Location
Client-side Properties
com.sun.xml.ws.assembler.client Right before (after) the message is sent (received) on client outbound (inbound)
com.sun.xml.ws.assembler.client.action wsa:To and wsa:Action header value on client outbound and inbound
com.sun.xml.ws.assembler.client.transport Right before (after) Transport pipe on client outbound (inbound)
com.sun.xml.ws.assembler.client.wss.after Right after (before) SecurityPipe on client outbound (inbound)
com.sun.xml.ws.assembler.client.wss.before Right before (after) SecurityPipe on client outbound (inbound)
com.sun.xml.ws.assembler.client.wsrm.after Right after (before) RMPipe on client outbound (inbound)
com.sun.xml.ws.assembler.client.wsrm.before Right before (after) RMPipe on client outbound (inbound)
com.sun.xml.ws.assembler.client.wstx.after Right after (before) TxPipe on client outbound (inbound)
com.sun.xml.ws.assembler.client.wstx.before Right before (after) TxPipe on client outbound (inbound)
com.sun.xml.ws.assembler.client.wsa.after Right after (before) WsaPipe on client outbound (inbound)
com.sun.xml.ws.assembler.client.wsa.before Right before (after) WsaPipe on client outbound (inbound)
Server-side Properties
com.sun.xml.ws.assembler.server Right after (before) the message is received (sent) on server inbound (outbound)
com.sun.xml.ws.assembler.server.action wsa:To and wsa:Action header value on server inbound and outbound
com.sun.xml.ws.assembler.server.transport Right after (before) Transport pipe on server inbound (outbound)
com.sun.xml.ws.assembler.server.wss.before Right before (after) SecurityPipe on server inbound (outbound)
com.sun.xml.ws.assembler.server.wss.after Right after (before) SecurityPipe on server inbound (outbound)
com.sun.xml.ws.assembler.server.wsa.before Right before (after) WsaPipe on server inbound (outbound)
com.sun.xml.ws.assembler.server.wsa.after Right after (before) WsaPipe on server inbound (outbound)
com.sun.xml.ws.assembler.server.wsmex.before Right before (after) MexPipe on server inbound (outbound)
com.sun.xml.ws.assembler.server.wsmex.after Right after (before) MexPipe on server inbound (outbound)
com.sun.xml.ws.assembler.server.wsrm.before Right before (after) RMPipe on server inbound (outbound)
com.sun.xml.ws.assembler.server.wsrm.after Right after (before) RMPipe on server inbound (outbound)
com.sun.xml.ws.assembler.server.wstx.before Right before (after) TxPipe on server inbound (outbound)
com.sun.xml.ws.assembler.server.wstx.after Right after (before) TxPipe on server inbound (outbound)

Example:

  1. If a message dump is required before and after the message is processed by WS-A pipe on the client outbound, then the following properties need to be set:

    -Dcom.sun.xml.ws.assembler.client.wsa.before=true and -Dcom.sun.xml.ws.assembler.client.wsa.after=true
  2. If a message dump is required before the message is sent and after it is received on the client, then the following property need to be set:

    -Dcom.sun.xml.ws.assembler.client=true 
  3. If all messages received by the RM pipe on server-side needs to be captured, then the following property need to be set:

    -Dcom.sun.xml.ws.assembler.server.wsrm.before=true

Notes:

  1. com.sun.xml.ws.assembler.client and com.sun.xml.ws.assembler.client.transport produce identical message dumps but allows an extensibility point if any other processing is required after the Transport pipe. This is also true for com.sun.xml.ws.assembler.server and com.sun.xml.ws.assembler.server.transport.

Technorati: WSIT SOAP Web-services

del.icio.us | furl | simpy | slashdot | technorati | digg |
|
Comments:

[Trackback] GlassFish V2 beta3 is now available. I take this opportune moment for a follow up entry showing how a Reliable WSIT endpoint can be invoked from WCF client and vice versa. WSIT is already integrated in GlassFish V2. The first...

Posted by Arun Gupta's Blog on July 10, 2007 at 12:20 PM PDT #

[Trackback] Metro provides Secure, Reliable, Transactional and .NET 3.0 interoperable Web services stack in GlassFish. This entry explains how to enable SOAP message logging in Metro and .NET 3.0. The SOAP message logging in Metro is explained here. In WCF (the...

Posted by Arun Gupta's Blog on August 01, 2007 at 11:14 AM PDT #

[Trackback] I'm starting a new series today called Tip Of The Day. In this series I'll respond to technical questions asked directly to me, on forums or other aliases. These questions might have been answered else where and this will be...

Posted by Arun Gupta's Blog on August 16, 2007 at 11:18 AM PDT #

Hi

Very interesting to know. Question: How can I monitor WS-MEX and / or WS-Transfer messages occurring during the bootstrap phase in WSIT?

Regards,
Eric

Posted by Eric Dubuis on October 12, 2007 at 12:23 PM PDT #

Depending upon which logging property is used, you can view all the messages that are exchanged at the runtime. For example, if you use com.sun.xml.ws.assembler.server then all the messages are dumped on the console.

Are you looking for something else ?

Posted by Arun Gupta on October 12, 2007 at 03:11 PM PDT #

By using the com.sun.xml.ws.assembler.server I can see the SOAP request and response at the server side which helps me a lot, thank you.
Is there a logging property which allows to monitor the fetching of the WSDL description of the service? The HTTP monitor shows me the corresponding POST requeset, but I'd be interested in seeing the request's body (which I expect to be a WS-MEX request, but I'm not sure).

Posted by Eric Dubuis on October 13, 2007 at 11:18 AM PDT #

There are no properties available to do that. Although we may add it in the future. Can you try redirecting your tool request via a tool like wsmonitor (wsmonitor.dev.java.net) and then look at the messages ?

-Arun

Posted by Arun Gupta on October 19, 2007 at 05:02 PM PDT #

Hi Arun,
I have one issue w.r.t to the SOAP message logging. I am using Weblogic workshop 8.1. I want to log the SOAP message (in HTTP form) to a specific file. And also I don't want the server console to contain the messages. How can i do this?
One more condition is that - on the given weblogic server , there are arnd 12 webservices deployed, but i want the logging to be done only for a particular service (logging should be configurable; the code should not be modified again and again to turn the logging on and off)

Posted by Meghnath Sharma on December 03, 2007 at 03:13 PM PST #

Meghnath, are you using the Metro stack in Weblogic ? Otherwise you'll need to post your question to Weblogic forums.

Posted by Arun Gupta on December 03, 2007 at 05:39 PM PST #

[Trackback] Metro is the Web services stack in GlassFish. It is your one-stop shop from a simple Hello World to Secure, Reliable,  Transactional and .NET 3.0 interoperable endpoint. Metro Tooling is provided by NetBeans and other options are explained here. S...

Posted by Arun Gupta's Blog on January 25, 2008 at 07:20 AM PST #

Hi Arun,

As we already have such a good logging mechanism in Metro, why can't we improve it and open some APIs for developer for SOAP/HTTP dumping? Currently this system property only allows us to dump to System.out, and developers have to redirect that message to other streams they want. This is very coarse controlled and not good enough. For example, if she wants to save that message to a Database , under current mechanism, she still has to do quite a lot of work. An API will make things much neat and convenient.

Posted by Marshal on January 30, 2008 at 08:53 PM PST #

Marshal, This is a good suggestion. Please file an RFE at https://wsit.dev.java.net/servlets/ProjectIssues

Posted by Arun Gupta on January 30, 2008 at 09:11 PM PST #

Hi, Am trying to enable glassfish to view soap message for debugging. I tried locating the variable (eg. Dcom.sun.xml.ws.assembler.client.wsa.before) u place above in domain.xml but can't seem to find it.

I have installed Netbeans 6.01 which came with glassfish v2. Do i need to install metro on to glassfish for me to pick this variable. DO let me know if i may miss anything out

regards,
Jack

Posted by jack on February 13, 2008 at 06:28 PM PST #

Jack,

Metro is already baked into GlassFish so you don't need to download anything additional. You need to add this variable in domain.xml, it is not pre-configured.

Posted by Arun Gupta on February 14, 2008 at 05:59 PM PST #

Thanks Arun for your reply. I check the documentation on domain.xml http://docs.sun.com/app/docs/doc/819-4723/abhar?a=view
on adding the variables http://docs.sun.com/app/docs/doc/819-4723/6n6rtcrnb?a=view#abhau but kind of got lost when locating where to insert this for logging purposes.

I tried to find which element in the domain (i.e. there was application,resources,config ..etc to insert this variable for logging purpose. Would you be able to tell which element I need to insert this variable and what xml sytnax is the jvm option correct i.e. I thought had to place a variable as jvm <jvm-option>-Dport-number=5500</jvm-option>

Pls correct me if I am wrong. Any help is great appreciated.
regards,
jack

Posted by Jack on February 16, 2008 at 06:34 PM PST #

Hi Arun, Pls ignore my question above; managed to find the element (config) to insert this as a <jvm-option>-DXXXXX</jvm-option>. Work super fine.

regards,
Jack

Posted by Jack on February 18, 2008 at 04:33 PM PST #

Hi Mr. Gupta,
I am a member of thesis project(www.singleantelope.com) in my university in Turkey . We selected WSIT project for web services security. We try to implement a STS sample.
My question is simple but I couldn't find the answer.
Q: Is it possible to handle SOAP messages in WSIT steps?
for example: (in calculator application in netbeans 6.1)
in clientservlet file:

org.me.calculator.client.CalculatorWS port = service.getCalculatorWSPort();
int result=port.add(1,2);

I want to show SOAP messages(request and response) to user in my servlet. Not only in Netbeans IDE glassfish console. My target aim is showing SOAP messages and SAMLs to user in a simple Client-STS-Service system.

It will be great , if u help me.
thanks.

Posted by Ozmen Adibelli on April 01, 2008 at 12:01 PM PDT #

I’ve been reading your blog for quite a while. Thank you for sharing your thoughts. It is very useful

Posted by Nadia on April 23, 2008 at 10:00 AM PDT #

Ozmen Adibelli, this blog entry explains how to do what you need:
http://blogs.sun.com/ritzmann/entry/printing_soap_messages

Posted by Fabian Ritzmann on June 27, 2008 at 02:06 AM PDT #

Great stuff.. Thanks a ton for sharing this.

Posted by Yarn on September 01, 2008 at 02:17 AM PDT #

Arun,
Can you please help me find a solution to the following problem? I tried looking online but none of the posts were helpful.

Requirement: We have a system where WCF Client communicates to Glassfish Server. For each WCF request that is sent to the Glassfish webservice, we want to send the username and password from WCF Client via SSL (using WS* Standards) and then retrieve the username/password on the WSIT services so that we can perform our own authentication.

Is this possible? If so, can you please provide the steps to do so asap?

Thanks!!!

Posted by Chris_rvm on May 26, 2009 at 12:09 PM PDT #

Have you tried posting question to users@metro.dev.java.net ?

Posted by Arun Gupta on May 26, 2009 at 01:34 PM PDT #

Post a Comment:
  • HTML Syntax: NOT allowed
« WSIT defined in... | Main | What is Web 2.0 ? »

Valid HTML! Valid CSS!

This is a personal weblog, I do not speak for my employer.