// Capture all the binding operation specific properties
BindingOperation[] bindingOperations = binding.getBindingOperations();
for (int i = 0; i < bindingOperations.length; i++) {
BindingOperation bindingOperation = bindingOperations[i];
AxisBindingOperation axisBindingOperation = new AxisBindingOperation();
AxisOperation axisOperation =
axisService.getOperation(bindingOperation.getInterfaceOperation().getName());
axisBindingOperation.setAxisOperation(axisOperation);
axisBindingOperation.setParent(axisBinding);
axisBindingOperation.setName(axisOperation.getName());
HTTPBindingOperationExtensions httpBindingOperationExtensions = null;
try {
httpBindingOperationExtensions = ((HTTPBindingOperationExtensions)
bindingOperation.getComponentExtensionsForNamespace(
new URI(WSDL2Constants.URI_WSDL2_HTTP)));
} catch (URISyntaxException e) {
throw new AxisFault("HTTP Binding Extention not found");
}
axisBindingOperation.setProperty(WSDL2Constants.ATTR_WHTTP_FAULT_SERIALIZATION,
httpBindingOperationExtensions.getHttpFaultSerialization());
axisBindingOperation.setProperty(WSDL2Constants.ATTR_WHTTP_INPUT_SERIALIZATION,
httpBindingOperationExtensions.getHttpInputSerialization());
HTTPLocation httpLocation = httpBindingOperationExtensions.getHttpLocation();
// If httpLocation is not null we should extract a constant part from it and add its value and the
// corresponding AxisOperation to a map in order to dispatch rest messages. If httpLocation is null we add
// the operation name into this map.
String httpLocationString = "";
if (httpLocation != null) {
String httpLocationTemplete = httpLocation.getOriginalLocation();
axisBindingOperation
.setProperty(WSDL2Constants.ATTR_WHTTP_LOCATION, httpLocationTemplete);
httpLocationString = RESTUtil.getConstantFromHTTPLocation(httpLocationTemplete);
}
httpLocationTable.put(httpLocationString, axisOperation);
axisBindingOperation.setProperty(WSDL2Constants.ATTR_WHTTP_IGNORE_UNCITED,
httpBindingOperationExtensions.
isHttpLocationIgnoreUncited());
axisBindingOperation
.setProperty(WSDL2Constants.ATTR_WHTTP_METHOD, httpBindingOperationExtensions.
getHttpMethod());
axisBindingOperation.setProperty(WSDL2Constants.ATTR_WHTTP_OUTPUT_SERIALIZATION,
httpBindingOperationExtensions.getHttpOutputSerialization());
axisBindingOperation.setProperty(WSDL2Constants.ATTR_WHTTP_QUERY_PARAMETER_SEPARATOR,
httpBindingOperationExtensions.getHttpQueryParameterSeparator());
axisBindingOperation.setProperty(WSDL2Constants.ATTR_WHTTP_CONTENT_ENCODING,
httpBindingOperationExtensions.getHttpContentEncodingDefault());
BindingMessageReference[] bindingMessageReferences =
bindingOperation.getBindingMessageReferences();
for (int j = 0; j < bindingMessageReferences.length; j++) {
BindingMessageReference bindingMessageReference = bindingMessageReferences[j];
AxisBindingMessage axisBindingMessage = new AxisBindingMessage();
axisBindingMessage.setParent(axisBindingOperation);
AxisMessage axisMessage = axisOperation.getMessage(bindingMessageReference
.getInterfaceMessageReference().getMessageLabel().toString());
axisBindingMessage.setAxisMessage(axisMessage);
axisBindingMessage.setName(axisMessage.getName());
axisBindingMessage.setDirection(axisMessage.getDirection());
HTTPBindingMessageReferenceExtensions httpBindingMessageReferenceExtensions = null;
try {
httpBindingMessageReferenceExtensions =
(HTTPBindingMessageReferenceExtensions) bindingMessageReference
.getComponentExtensionsForNamespace(
new URI(WSDL2Constants.URI_WSDL2_HTTP));
} catch (URISyntaxException e) {
throw new AxisFault("HTTP Binding Extention not found");
}
axisBindingMessage.setProperty(WSDL2Constants.ATTR_WHTTP_HEADER,
createHttpHeaders(
httpBindingMessageReferenceExtensions.getHttpHeaders()));
axisBindingMessage.setProperty(WSDL2Constants.ATTR_WHTTP_CONTENT_ENCODING,
httpBindingMessageReferenceExtensions.getHttpContentEncoding());
axisBindingOperation.addChild(axisMessage.getDirection(), axisBindingMessage);
}
BindingFaultReference[] bindingFaultReferences =
bindingOperation.getBindingFaultReferences();
for (int j = 0; j < bindingFaultReferences.length; j++) {
BindingFaultReference bindingFaultReference = bindingFaultReferences[j];
AxisBindingMessage axisBindingMessageFault = new AxisBindingMessage();
axisBindingMessageFault.setFault(true);