public int compare(Object o1, Object o2) {
return (-1 * ((Comparable) o1).compareTo(o2));
}
});
// StockServiceHttpBinding for StockService
AxisBinding binding = new AxisBinding();
binding.setName(new QName("StockServiceHttpBinding"));
binding.setType("http://www.w3.org/ns/wsdl/http");
binding.setProperty(WSDL2Constants.ATTR_WHTTP_METHOD_DEFAULT,
Constants.Configuration.HTTP_METHOD_GET);
// AxisBindingOperation for addStock
AxisBindingOperation bindingOperation1 = new AxisBindingOperation();
bindingOperation1.setAxisOperation(axisService.getOperation(new QName("addStock")));
bindingOperation1.setName(axisService.getOperation(new QName("addStock")).getName());
bindingOperation1.setParent(binding);
bindingOperation1.setProperty(WSDL2Constants.ATTR_WHTTP_METHOD,
Constants.Configuration.HTTP_METHOD_GET);
bindingOperation1.setProperty(WSDL2Constants.ATTR_WHTTP_LOCATION,
"add/{name}/value/{value}");
httpLocationTable.put(Constants.Configuration.HTTP_METHOD_GET + "/add/",
axisService.getOperation(new QName("addStock")));
bindingOperation1.setProperty(WSDL2Constants.ATTR_WHTTP_INPUT_SERIALIZATION,
Constants.MIME_CT_APPLICATION_URL_ENCODED);
bindingOperation1.setProperty(WSDL2Constants.ATTR_WHTTP_OUTPUT_SERIALIZATION,
Constants.MIME_CT_APPLICATION_XML);
binding.addChild(bindingOperation1);
assertNotNull(binding.getChild(bindingOperation1.getName()));
// AxisBindingOperation for getStockValue
AxisBindingOperation bindingOperation2 = new AxisBindingOperation();
bindingOperation2.setAxisOperation(axisService.getOperation(new QName("getStockValue")));
bindingOperation2.setName(axisService.getOperation(new QName("getStockValue")).getName());
bindingOperation2.setParent(binding);
bindingOperation2.setProperty(WSDL2Constants.ATTR_WHTTP_METHOD,
Constants.Configuration.HTTP_METHOD_GET);
bindingOperation2.setProperty(WSDL2Constants.ATTR_WHTTP_LOCATION, "get/{name}");
httpLocationTable.put(Constants.Configuration.HTTP_METHOD_GET + "/get/",
axisService.getOperation(new QName("getStockValue")));
bindingOperation2.setProperty(WSDL2Constants.ATTR_WHTTP_INPUT_SERIALIZATION,
Constants.MIME_CT_APPLICATION_URL_ENCODED);
bindingOperation2.setProperty(WSDL2Constants.ATTR_WHTTP_OUTPUT_SERIALIZATION,
Constants.MIME_CT_APPLICATION_XML);
binding.addChild(bindingOperation2);
assertNotNull(binding.getChild(bindingOperation2.getName()));
binding.setProperty(WSDL2Constants.HTTP_LOCATION_TABLE, httpLocationTable);
// adding Http AxisEndpoint, HttpBinding to service
AxisEndpoint axisEndpoint = new AxisEndpoint();
axisEndpoint.setBinding(binding);
axisEndpoint.setName("StockServiceHttpEndpoint");