Skip to main content

Test results from Fast Infoset comarison to SOAP not as expected

No replies
Joined: 2012-09-11

We are building a high-throughput back-end system that will be sending and retrieving variably sized byte[]. The bindings are critical for this project so we have been testing SOAP, REST, and Fast Infoset and using a Memcached client as our baseline.

Our tests don't reveal any difference between the round trip times of the SOAP and Fast Infoset clients. It was my expectation that Fast Infoset would improve the transmission times.

Am I doing something wrong? Is there a better solution?

Glassfish 3.1.2
jdk 1.7

Our client:
The two clients are the same accept for one line of code.

(( _port).getRequestContext().put(JAXWSProperties.CONTENT_NEGOTIATION_PROPERTY, "pessimistic");

It is my understanding that including that line of code with my client will enable Fast Infoset protocol between the client and the service. Below is the Fastinfo Set client. You can imagine the regular SOAP client without the above line of code.

public EpCacheFiClient(long period) {
try {
_service = new EpCacheService(new URL(WSDL_URL_KEY), QNAME);
_port = _service.getEpCachePort();
(( _port).getRequestContext().put(JAXWSProperties.CONTENT_NEGOTIATION_PROPERTY, "pessimistic");

if (_port != null) {
System.out.println("Found service port!");
} else {
} catch (MalformedURLException e) {

Here is the service code. We use the same endpoint on the instruction that the client will engage the Glassfish server in using Fastinfo set, which is supposed to be on by default.

@WebService(name = "EpCache", serviceName = "EpCacheService", portName = "EpCachePort", targetNamespace = "")
public class EpWsCacheService {

private IServiceLogger _logger;

private IEpService _epCacheService;


* @param cacheItemId
* @param cacheItemData
* @return
* @throws EpServiceException
@WebMethod(operationName = "processEpCacheSet", action = "urn:ProcessEpCacheSet")
public String processEpCacheSet(
@WebParam(name = "id") String cacheItemId,
@WebParam(name = "data") byte[] cacheItemData)
throws EpServiceException {

String epCacheItemId = null;
try {
epCacheItemId = _epCacheService.asyncSetRequest(cacheItemId, cacheItemData);
} catch (Exception e) {
"Error calling syncGet() for cacheItemId {0}. {1}",
new Object[] { cacheItemId, e.getMessage() });

throw new WebApplicationException(e,
return epCacheItemId + " added to cache!";


Finally here is our data random generator.

Random rand = new Random( seed );
//Test 100,000 requests
for(int i = 0; i != requests; i++){
int randomNum = rand.nextInt(max - min + 1) + min;

byte[] byteArray = new byte[randomNum];

Random randBytes = new Random();

// set cache item
long time = -1;
time = sgcI.measureSet("" + randomNum, byteArray);//abstraction on service call
setResults.put(randomNum, time);