Skip to main content

wsmonitor 1.1 and Fast Infoset

Posted by arungupta on September 6, 2006 at 1:17 PM PDT

As mentioned
in The Aquarium few weeks ago, Fast Infoset
support is now available in wsmonitor. Thanks to Joe Wang for all the work.

Given below is the CVS diff of JAX-WS
fromjava sample
that shows how to run the sample using wsmonitor and also how Fast Infoset
support can be enabled.

cvs server: Diffing .
Index: build.xml
RCS file: /cvs/jax-ws-sources/jaxws-ri/samples/annotations/build.xml,v
retrieving revision
diff -r1. build.xml
> <sysproperty key="wsmonitor" value="${wsmonitor}"/>
> <sysproperty key="" value="${fi}"/>
cvs server: Diffing etc
Index: etc/
RCS file: /cvs/jax-ws-sources/jaxws-ri/samples/annotations/etc/,v
retrieving revision 1.5
diff -r1.5
> wsmonitor=false
> fi=none
cvs server: Diffing src
cvs server: Diffing src/annotations
cvs server: Diffing src/annotations/client
Index: src/annotations/client/
RCS file: /cvs/jax-ws-sources/jaxws-ri/samples/annotations/src/annotations/client/,v
retrieving revision
diff -r1.5.12.1
> import;
> log(port);
> }
> }
> private static final void log(AddNumbers port) {
> if (Boolean.getBoolean("wsmonitor")) {
> String address = (String)((BindingProvider)port).getRequestContext().get(BindingProvider.ENDPOINT_ADDRESS_PROPERTY);
> address = address.replaceFirst("8080", "4040");
> ((BindingProvider)port).getRequestContext().put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY, address);
cvs server: Diffing src/annotations/server

This sample is available in JAX-WS
2.0.1 binary
or can be checked out along with the JAX-WS

After making the above mentioned changes in the files, download, install and
run wsmonitor
. Re-build the sample client (ant client) and run it with
the following additional properties: 

ant run -Dwsmonitor=true

This command will run the client and wsmonitor console will show the HTTP
headers and SOAP request and response messages.

ant run -Dfi=[optimistic | pessimistic | none ]

This command will run the client based upon the Fast Infoset content
negotiation defined
by the property values
. The wsmonitor console will show the HTTP headers and
SOAP request and response messages. Fast Infoset messages are identified by the
request and response encoding shown in the table at the top and also by the application/fastinfoset
value of Accept-Type HTTP header for the request message and Content-Type
HTTP header for the response message. The SOAP message, in this case, is
displayed as a binary dump using hexadecimal representation.

The various console dumps showing HTTP headers and request/response messages
using SOAP and Fast Infoset is available here.


Related Topics >>