// Capture all the binding operation specific properties
BindingOperation[] bindingOperations = binding.getBindingOperations();
for (int i = 0; i < bindingOperations.length; i++) {
BindingOperationImpl bindingOperation = (BindingOperationImpl) bindingOperations[i];
AxisBindingOperation axisBindingOperation = new AxisBindingOperation();
InterfaceOperation interfaceOperation = serviceInterface.getFromAllInterfaceOperations(bindingOperation.getRef());
AxisOperation axisOperation =
axisService.getOperation(interfaceOperation.getName());
axisBindingOperation.setAxisOperation(axisOperation);
axisBindingOperation.setParent(axisBinding);
axisBindingOperation.setName(axisOperation.getName());
addDocumentation(axisBindingOperation, bindingOperation.toElement());
SOAPBindingOperationExtensions soapBindingOperationExtensions;
try {
soapBindingOperationExtensions = ((SOAPBindingOperationExtensions)
bindingOperation.getComponentExtensionContext(
new URI(WSDL2Constants.URI_WSDL2_SOAP)));
} catch (URISyntaxException e) {
throw new AxisFault("Soap Binding Extention not found");
}
URI soapAction = soapBindingOperationExtensions.getSoapAction();
if (soapAction != null && !"\"\"".equals(soapAction.toString())) {
axisBindingOperation.setProperty(WSDL2Constants.ATTR_WSOAP_ACTION,
soapAction.toString());
}
axisBindingOperation.setProperty(WSDL2Constants.ATTR_WSOAP_MODULE,
createSoapModules(
soapBindingOperationExtensions.getSoapModules()));
URI soapMep = soapBindingOperationExtensions.getSoapMep();
if (soapMep != null) {
axisBindingOperation.setProperty(WSDL2Constants.ATTR_WSOAP_MEP,
soapMep.toString());
}
HTTPLocation httpLocation = soapBindingOperationExtensions.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, HTTPConstants.HEADER_POST);
}
httpLocationTable.put(httpLocationString, axisOperation);
axisBindingOperation.setProperty(WSDL2Constants.ATTR_WHTTP_CONTENT_ENCODING,
soapBindingOperationExtensions.getHttpContentEncodingDefault());
axisBindingOperation.setProperty(WSDL2Constants.ATTR_WHTTP_QUERY_PARAMETER_SEPARATOR,
soapBindingOperationExtensions.getHttpQueryParameterSeparator());
BindingMessageReference[] bindingMessageReferences =
bindingOperation.getBindingMessageReferences();
for (int j = 0; j < bindingMessageReferences.length; j++) {
BindingMessageReference bindingMessageReference = bindingMessageReferences[j];
AxisBindingMessage axisBindingMessage = new AxisBindingMessage();
axisBindingMessage.setParent(axisBindingOperation);
addDocumentation(axisBindingMessage, bindingMessageReference.toElement());
AxisMessage axisMessage = axisOperation.getMessage(bindingMessageReference
.getInterfaceMessageReference().getMessageLabel().toString());
axisBindingMessage.setAxisMessage(axisMessage);
axisBindingMessage.setName(axisMessage.getName());
axisBindingMessage.setDirection(axisMessage.getDirection());
SOAPBindingMessageReferenceExtensions soapBindingMessageReferenceExtensions;
try {
soapBindingMessageReferenceExtensions =
(SOAPBindingMessageReferenceExtensions) bindingMessageReference
.getComponentExtensionContext(
new URI(WSDL2Constants.URI_WSDL2_SOAP));
} catch (URISyntaxException e) {
throw new AxisFault("Soap Binding Extention not found");
}
axisBindingMessage.setProperty(WSDL2Constants.ATTR_WHTTP_HEADER,
createHttpHeaders(
soapBindingMessageReferenceExtensions.getHttpHeaders()));
axisBindingMessage.setProperty(WSDL2Constants.ATTR_WHTTP_CONTENT_ENCODING,
soapBindingMessageReferenceExtensions.getHttpContentEncoding());
axisBindingMessage.setProperty(WSDL2Constants.ATTR_WSOAP_HEADER,
createSoapHeaders(
soapBindingMessageReferenceExtensions.getSoapHeaders()));
axisBindingMessage.setProperty(WSDL2Constants.ATTR_WSOAP_MODULE,
createSoapModules(
soapBindingMessageReferenceExtensions.getSoapModules()));
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();
addDocumentation(axisBindingMessageFault, bindingFaultReference.toElement());