follow me on Twitter

    Subscribe to
    Posts [Atom]


    Maintaining a session with Axis2 client

    Thursday, September 04, 2008

    This took me a little while to track down. It seems that there are many different ways to accomplish maintaining a session cookie with the Axis2 client generated stubs. I saw many variations as I googled for the solution but I ended up having to tweak what I found for my own purpose. You can add the following code in your client class that calls your Axis2 stub:

    yourstub._getServiceClient().getOptions().setProperty(org.apache.axis2.transport.http.HTTPConstants.REUSE_HTTP_CLIENT,
    Boolean.TRUE);


    This is a way of manually turning on Axis2 session management. From my searching it seems that most often this needs to be done when connecting to a ASP.net server. Microsoft . . . really?

    Axis2 Soap Message Error

    Tuesday, September 02, 2008

    I get the error: Exception in thread "main" org.apache.axis2.AxisFault: First Element must contain the local name, Envelope , but found html

    I did some packet sniffing and found out that in the header a chunked attribute is going out in the soap message. I'm not sure what this chunking is but you can turn it off by adding the following code to the client:

    stub._getServiceClient().getOptions().setProperty(org.apache.axis2.transport.http.HTTPConstants.CHUNKED,
    Boolean.FALSE);

    Enabling WireShark on Mac OS X


    change permissions on file /dev/bpf0