axis-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mcd99999 <>
Subject Axis2 - Client problem setting option for content type (fast-infoset)
Date Tue, 22 Jun 2010 23:18:50 GMT


I've been trying to enable fastinfoset compression on my web services.
However, I'm having a problem getting the content-type to change on the
request from the client. At least, I think that's why it's not compressing.

I've tried a lot of different things, but the content-type always remains
"text/xml". I'm pretty sure that it's supposed go through as
"application/soap+fastinfoset" the way I have it set up now. I'm running
Axis2 as a standalone, but again I think the problem is that the content
type header isn't changing.

I know the options themselves are getting set on the request because I was
able to change another option from "UTF-8" to "UTF-16", and it showed up in
the header. Here's the current header output from TCPMonitor:

POST /axis2/services/AddressBookService HTTP/1.1

Content-Type: text/xml; charset=UTF-16

SOAPAction: "urn:anonRobustOp"

User-Agent: Axis2


Transfer-Encoding: chunked

The client code is shown below. Any help much appreciated.

package sample.addressbook.rpcclient;

import javax.xml.namespace.QName;

import org.apache.axis2.AxisFault;

import org.apache.axis2.addressing.EndpointReference;

import org.apache.axis2.client.Options;

import org.apache.axis2.rpc.client.RPCServiceClient;

import org.apache.axis2.Constants;

import sample.addressbook.entry.Entry;

public class AddressBookRPCClient {

    public static void main(String[] args1) throws AxisFault {

        RPCServiceClient serviceClient = new RPCServiceClient();

        Options options = serviceClient.getOptions();





	//		"application/fastinfoset");

        System.out.println("set options to : " +

        EndpointReference targetEPR = new EndpointReference(



	System.out.println("changed port to " + targetEPR);



	System.out.println("set options to " + options);


         * Creates an Entry and stores it in the AddressBook.


        // QName of the target method 

        QName opAddEntry = new QName("http://service.addressbook.sample",


         * Constructing a new Entry


        Entry entry = new Entry();

        entry.setName("Abby Cadabby");

        entry.setStreet("Sesame Street");

        entry.setCity("Sesame City");

        entry.setState("Sesame State");


        // Constructing the arguments array for the method invocation

        Object[] opAddEntryArgs = new Object[] { entry };

        // Invoking the method

        serviceClient.invokeRobust(opAddEntry, opAddEntryArgs);







         * Fetching an Entry from the Address book



        // QName of the method to invoke 

        QName opFindEntry = new QName("http://service.addressbook.sample",


        String name = "Abby Cadabby";

        Object[] opFindEntryArgs = new Object[] { name };

        Class[] returnTypes = new Class[] { Entry.class };


        Object[] response = serviceClient.invokeBlocking(opFindEntry,

                opFindEntryArgs, returnTypes);


        Entry result = (Entry) response[0];


        if (result == null) {

            System.out.println("No entry found for " + name);




        System.out.println("Name   :" + result.getName());

        System.out.println("Street :" + result.getStreet());

        System.out.println("City   :" + result.getCity());

        System.out.println("State  :" + result.getState());

        System.out.println("Postal Code :" + result.getPostalCode());





View this message in context:
Sent from the Axis - User mailing list archive at

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message