Arun Gupta, Miles to go ...

Arun Gupta is a technology enthusiast, a passionate runner, and a community guy who works for Sun Microsystems.
« JSR 261 and JAX-WSA... | Main | Final push for marat... »

http://blogs.sun.com/arungupta/date/20060906 Wednesday September 06, 2006

wsmonitor 1.1 and Fast Infoset

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 1.5.2.2.2.1
diff -r1.5.2.2.2.1 build.xml
125a126,127
> <sysproperty key="wsmonitor" value="${wsmonitor}"/>
> <sysproperty key="com.sun.xml.ws.client.ContentNegotiation" value="${fi}"/>
cvs server: Diffing etc
Index: etc/build.properties
===================================================================
RCS file: /cvs/jax-ws-sources/jaxws-ri/samples/annotations/etc/build.properties,v
retrieving revision 1.5
diff -r1.5 build.properties
9a10,11
> wsmonitor=false
> fi=none
cvs server: Diffing src
cvs server: Diffing src/annotations
cvs server: Diffing src/annotations/client
Index: src/annotations/client/AddNumbersClient.java
===================================================================
RCS file: /cvs/jax-ws-sources/jaxws-ri/samples/annotations/src/annotations/client/AddNumbersClient.java,v
retrieving revision 1.5.12.1
diff -r1.5.12.1 AddNumbersClient.java
23a24,25
> import javax.xml.ws.BindingProvider;
>
27a30
> log(port);
42a46,53
> }
> }
>
> 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 sources project.

After making the above mentioned changes in the files, download, install and run wsmonitor v1.1. 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.

Technorati: Web-services JAX-WS SOAP HTTP Fast Infoset

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

对讲机

Posted by gerrge on September 12, 2006 at 08:43 PM PDT #

Post a Comment:
  • HTML Syntax: NOT allowed
« JSR 261 and JAX-WSA... | Main | Final push for marat... »

Valid HTML! Valid CSS!

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