" /> Davanum Srinivas' weblog: August 2006 Archives

« June 2006 | Main | September 2006 »

August 22, 2006

Axis2 Tip - Logging HTTP Request/Response on the client

Question: How do i log all HTTP/HTTPS traffic from an Axis2 Client?

Answer: Axis2 uses Jakart Commons HTTPClient. So you can just use the Context / Wire logging facilities provided by HTTPClient. In example below i set up the Simple logger in an environment variable and use that when i run my client.

C:\TESTING> SET JAVA_OPTS-Dorg.apache.commons.logging.Log=org.apache.commons.logging.impl.SimpleLog -Dorg.apache.commons.logging.simplelog.showdatetime=true -Dorg.apache.commons.logging.simplelog.log.httpclient.wire=debug -Dorg.apache.commons.logging.simplelog.log.org.apache.commons.httpclient=debug
C:\TESTING> java %JAVA_OPTS% MyClient

And the output i got was as follows (munged a bit to protect the innocent):

2006/08/22 22:14:31:531 EDT [DEBUG] HttpConnection - Open connection to api.sandbox.ebay.com:443
2006/08/22 22:15:56:015 EDT [DEBUG] header - >> "POST /wsapi?siteid=0&callname=GeteBayOfficialTime&client=java&appid=XYZ1234 HTTP/1.0[\r][\n]"
2006/08/22 22:15:56:015 EDT [DEBUG] HttpMethodBase - Adding Host request header
2006/08/22 22:15:56:109 EDT [DEBUG] header - >> "SOAPAction: urn:GeteBayOfficialTime[\r][\n]"
2006/08/22 22:15:56:109 EDT [DEBUG] header - >> "User-Agent: Axis2[\r][\n]"
2006/08/22 22:15:56:109 EDT [DEBUG] header - >> "Host: api.sandbox.ebay.com[\r][\n]"
2006/08/22 22:15:56:109 EDT [DEBUG] header - >> "Content-Length: 1546[\r][\n]"
2006/08/22 22:15:56:109 EDT [DEBUG] header - >> "Content-Type: text/xml; charset=UTF-8[\r][\n]"
2006/08/22 22:15:56:109 EDT [DEBUG] header - >> "[\r][\n]"
2006/08/22 22:15:56:109 EDT [DEBUG] content - >> "<?xml version='1.0' encoding='UTF-8'?><soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"><soapenv:Header><ns1:RequesterCredentials xmlns:ns1="urn:ebay:apis:eBLBaseComponents"><ns1:eBayAuthToken>XYZ_ABCD</ns1:eBayAuthToken></ns1:RequesterCredentials></soapenv:Header><soapenv:Body><ns1:GeteBayOfficialTimeRequest xmlns:ns1="urn:ebay:apis:eBLBaseComponents" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ns1:GeteBayOfficialTimeRequestType"><ns1:DetailLevelCodeType>ReturnAll</ns1:DetailLevelCodeType><ns1:ErrorLanguage>en_US</ns1:ErrorLanguage><ns1:Version>427</ns1:Version></ns1:GeteBayOfficialTimeRequest></soapenv:Body></soapenv:Envelope>"
2006/08/22 22:15:56:453 EDT [DEBUG] EntityEnclosingMethod - Request body sent
2006/08/22 22:15:56:578 EDT [DEBUG] header - << "HTTP/1.1 200 OK[\r][\n]"
2006/08/22 22:15:56:578 EDT [DEBUG] header - << "Date: Wed, 23 Aug 2006 02:17:33 GMT[\r][\n]"
2006/08/22 22:15:56:578 EDT [DEBUG] header - << "Server: Microsoft-IIS/5.0[\r][\n]"
2006/08/22 22:15:56:578 EDT [DEBUG] header - << "X-EBAY-API-SERVER-NAME: ZXCVBA[\r][\n]"
2006/08/22 22:15:56:578 EDT [DEBUG] header - << "Content-Type: text/xml;charset=utf-8[\r][\n]"
2006/08/22 22:15:56:578 EDT [DEBUG] header - << "X-Cache: MISS from thrasher.sjc.ebay.com[\r][\n]"
2006/08/22 22:15:56:578 EDT [DEBUG] header - << "Connection: close[\r][\n]"
2006/08/22 22:15:56:609 EDT [DEBUG] content - << "<?xml version="1.0" encoding="UTF-8"?>[\n]"
2006/08/22 22:15:56:609 EDT [DEBUG] content - << "<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">[\n]"
2006/08/22 22:15:56:609 EDT [DEBUG] content - << " <soapenv:Body>[\n]"
2006/08/22 22:15:56:609 EDT [DEBUG] content - << " <GeteBayOfficialTimeResponse xmlns="urn:ebay:apis:eBLBaseComponents">[\n]"
2006/08/22 22:15:56:609 EDT [DEBUG] content - << " <Timestamp>2006-08-23T02:17:33.544Z</Timestamp>[\n]"
2006/08/22 22:15:56:609 EDT [DEBUG] content - << " <Ack>Success</Ack>[\n]"
2006/08/22 22:15:56:609 EDT [DEBUG] content - << " <Version>475</Version>[\n]"
2006/08/22 22:15:56:609 EDT [DEBUG] content - << " <Build>e475_core_Bundled_3434772_R1</Build>[\n]"
2006/08/22 22:15:56:609 EDT [DEBUG] content - << " </GeteBayOfficialTimeResponse>[\n]"
2006/08/22 22:15:56:609 EDT [DEBUG] content - << " </soapenv:Body>[\n]"
2006/08/22 22:15:56:609 EDT [DEBUG] content - << "</soapenv:Envelope>"
2006/08/22 22:15:56:781 EDT [DEBUG] HttpMethodBase - Should close connection in response to directive: close
2006/08/22 22:15:56:781 EDT [DEBUG] HttpConnection - Releasing connection back to connection manager.

August 21, 2006

Java.next

Dear Sun folks,

I hope you have taken the time to digest the input from my friends - Stefano, Dalibor, Geir, Tromey, mjw to name a few.

Let me layout a scenario / use case: In the future, I (either an individual or a company) should be able to pick pieces from various projects to "assemble" a JVM/JDK for my custom use or for my customers, exactly like the folks doing linux distro's assemble pieces that fit together. The Classpath project has shown how well the classlib can be center of a multi-vm  eco system. We should make more choices available for all parts of the JDK/JVM, so that people can mix and match what they need.

Already there are a lot of choices. Kaffe or Harmony' DRLVM or JamVM or SableVM as the base VM, Bouncy Castle or GNU Crypto  for the crypto bits, Eclipse JDT compiler as javac equivalent, *unmodified* latest Xerces and Xalan. MX4J for the JMX stuff. Not to forget the beginnings of a AWT/SWING implementation in Harmony and an almost full implementation of the same in classpath. etc. The community is testing its bits using Mauve in addition to their own test suites and Gump is helping a bit in testing coverage as well. If you followed some of the discussions on harmony-dev, we started by talking about breaking stuff down to make the bricks for the building blocks.

Why am i pointing to all these items? Because, i'd like SUN to participate in some if not all the current efforts. I'd like SUN folks to build bridges between their code and code from others in the ecosystem. Having a long term vision of say a OSGi based ecosystem where components can be custom assembled is a grand and worthwhile goal, but i'd like to propose small steps to make the grand vision happen as well. For example, Since the plan is to roll the dice with Hotspot VM. One possible bridge is for the Hotspot team to review the Classpath VM Interface  and/or the Harmony VM Interface and come up with a way for Hotspot VM to work with the Harmony Class Library or Classpath. Code is important, no doubt. But it is equivally important for say the Hotspot VM team to start working closely with other efforts in the area. It will pay off in the long run for everyone. When you open source Javac, don't forget to open up the code APT as well :) I know a few projects who can benefit from that.

Oh, regarding the license? *Please* don't use CDDL, MIT/X will do just fine. Though i'd push for ASL 2.0. I think opening up the JCP and access to the TCK is as important as the license for the code. More on that later.

Thanks for asking us for the feedback. Glad to chime in with my 2 cents.

August 20, 2006

Apache Neethi in JBossWS

Just spotted this snippet in JBossWS's build-thirdparty.xml

<get src="${jboss.repository}/wscommons-policy/${wscommons-policy}/lib/policy-1.0.jar" dest="${thirdparty.dir}/policy-1.0.jar" usetimestamp="true" verbose="true"/>

Looks like the JBossWS folks are using WS-Commons project named Apache Neethi for their WS-Policy support. Thanks for the endorsement :)

August 16, 2006

Statistics for Apache Axis2

Thanks a ton to Vadim for setting up some statistics for Axis2 project. Here's a sample:

 

DISCLAIMER: The statistics only counts downloads from ASF servers, not from the mirrors. Most folks download from the mirror and not the main ASF servers.

August 15, 2006

Axis2 changelog for last 1 week

If you need to see the changes that happened in the last week in Axis2 SVN and want to dig into each svn revision / look at the diff's of the files etc. Here's where you can start:

http://ws.zones.apache.org/~dims/axis2/

Keeping track of bugs in Axis2 and WS-Commons

Here are the RSS feeds for keeping track of Axis2 bugs:

Axis2 JIRA - Outstanding bugs

and the corresponding one for WS-Commons bugs:

WS-Commons JIRA - Outstanding bugs

Axis2 Nightly builds

Folks who need Nightly builds of Axis2 can pick them up from here:

http://people.apache.org/dist/axis2/nightly/