Miles to go …

December 4, 2006

Message Logging in WSIT Updated

Filed under: webservices — arungupta @ 6:45 pm

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.transp
    ort
    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

Share and Enjoy:
  • Print
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Google Bookmarks
  • DZone
  • email
  • StumbleUpon
  • Technorati
  • Twitter
  • Slashdot
Related posts:
  1. Message Logging in WSIT
  2. TOTD #1: SOAP Messaging Logging in Metro
  3. SOAP Message Logging in Metro and WCF
  4. How WS-Addressing Action header is calculated ?
  5. WSIT Blog Aggregator

25 Comments »

  1. [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…

    Comment by Arun Gupta's Blog — July 10, 2007 @ 12:20 pm

  2. [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…

    Comment by Arun Gupta's Blog — August 1, 2007 @ 11:14 am

  3. [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…

    Comment by Arun Gupta's Blog — August 16, 2007 @ 11:18 am

  4. 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

    Comment by Eric Dubuis — October 12, 2007 @ 12:23 pm

  5. 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 ?

    Comment by Arun Gupta — October 12, 2007 @ 3:11 pm

  6. 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).

    Comment by Eric Dubuis — October 13, 2007 @ 11:18 am

  7. 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

    Comment by Arun Gupta — October 19, 2007 @ 5:02 pm

  8. 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)

    Comment by Meghnath Sharma — December 3, 2007 @ 3:13 pm

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

    Comment by Arun Gupta — December 3, 2007 @ 5:39 pm

  10. [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…

    Comment by Arun Gupta's Blog — January 25, 2008 @ 7:20 am

  11. 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.

    Comment by Marshal — January 30, 2008 @ 8:53 pm

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

    Comment by Arun Gupta — January 30, 2008 @ 9:11 pm

  13. 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

    Comment by jack — February 13, 2008 @ 6:28 pm

  14. 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.

    Comment by Arun Gupta — February 14, 2008 @ 5:59 pm

  15. 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

    Comment by Jack — February 16, 2008 @ 6:34 pm

  16. 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

    Comment by Jack — February 18, 2008 @ 4:33 pm

  17. 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.

    Comment by Ozmen Adibelli — April 1, 2008 @ 12:01 pm

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

    Comment by Nadia — April 23, 2008 @ 10:00 am

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

    Comment by Fabian Ritzmann — June 27, 2008 @ 2:06 am

  20. Great stuff.. Thanks a ton for sharing this.

    Comment by Yarn — September 1, 2008 @ 2:17 am

  21. 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!!!

    Comment by Chris_rvm — May 26, 2009 @ 12:09 pm

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

    Comment by Arun Gupta — May 26, 2009 @ 1:34 pm

  23. Arun,
    How is WSIT message logging with GlassFish V3 achieved?

    -Eric

    Comment by Eric Dubuis — April 16, 2010 @ 5:04 am

  24. Eric,

    If these properties do not work, please send a message to users@metro.dev.java.net.

    Comment by Arun Gupta — April 19, 2010 @ 3:17 pm

  25. I want to log raw soap post requests if there are any errors , I am using JAX-WS. Any help will be appreciated.

    Is there an easy way (aka: not using a proxy) to get access to the raw request/response XML for a webservice published with JAX-WS reference implementation (the one included in JDK 1.5 and better) only when exception occurs in response? I want to log raw SOAP reuest so that I can test it thorugh any webservice client at a later stage

    Comment by praveen — March 18, 2011 @ 9:46 am

RSS feed for comments on this post. TrackBack URL

Leave a comment

The views expressed on this blog are my own and do not necessarily reflect the views of Oracle.
Powered by WordPress