if (isServerSide) {
if (null != wsdl4jInputMessage) {
AxisMessage inMessage = axisOperation
.getMessage(WSDLConstants.MESSAGE_LABEL_IN_VALUE);
Message message = wsdl4jInputMessage.getMessage();
if (null != message) {
inMessage.setName(message.getQName().getLocalPart());
copyExtensionAttributes(wsdl4jInputMessage.getExtensionAttributes(),
inMessage, PORT_TYPE_OPERATION_INPUT);
}
// Check if the action is already set as we don't want to
// override it
// with the Default Action Pattern
ArrayList inputActions = axisOperation.getWSAMappingList();
String action = null;
if (inputActions == null || inputActions.size() == 0) {
action = WSDL11ActionHelper
.getActionFromInputElement(dif, wsdl4jPortType,
wsdl4jOperation, wsdl4jInputMessage);
}
if (action != null) {
if (inputActions == null) {
inputActions = new ArrayList();
axisOperation.setWsamappingList(inputActions);
}
inputActions.add(action);
axisService.mapActionToOperation(action, axisOperation);
}
}
// Create an output message and add
Output wsdl4jOutputMessage = wsdl4jOperation.getOutput();
if (null != wsdl4jOutputMessage) {
AxisMessage outMessage = axisOperation
.getMessage(WSDLConstants.MESSAGE_LABEL_OUT_VALUE);
Message message = wsdl4jOutputMessage.getMessage();
if (null != message) {
outMessage.setName(message.getQName().getLocalPart());
copyExtensionAttributes(wsdl4jOutputMessage.getExtensionAttributes(),
outMessage, PORT_TYPE_OPERATION_OUTPUT);
// wsdl:portType -> wsdl:operation -> wsdl:output
}
// Check if the action is already set as we don't want to
// override it
// with the Default Action Pattern
String action = axisOperation.getOutputAction();
if (action == null) {
action = WSDL11ActionHelper.getActionFromOutputElement(dif,
wsdl4jPortType,
wsdl4jOperation,
wsdl4jOutputMessage);
}
if (action != null) {
axisOperation.setOutputAction(action);
}
}
} else {
// for the client side we have to do something that is a bit
// weird. The in message is actually taken from the output
// and the output is taken from the in
if (null != wsdl4jInputMessage) {
AxisMessage inMessage = axisOperation
.getMessage(WSDLConstants.MESSAGE_LABEL_OUT_VALUE);
Message message = wsdl4jInputMessage.getMessage();
if (null != message) {
inMessage.setName(message.getQName().getLocalPart());
copyExtensionAttributes(wsdl4jInputMessage.getExtensionAttributes(),
inMessage, PORT_TYPE_OPERATION_OUTPUT);
}
// Check if the action is already set as we don't want to
// override it
// with the Default Action Pattern
String action = axisOperation.getOutputAction();
if (action == null) {
action = WSDL11ActionHelper
.getActionFromInputElement(dif, wsdl4jPortType,
wsdl4jOperation, wsdl4jInputMessage);
}
if (action != null) {
axisOperation.setOutputAction(action);
}
}
// Create an output message and add
Output wsdl4jOutputMessage = wsdl4jOperation.getOutput();
if (null != wsdl4jOutputMessage) {
AxisMessage outMessage = axisOperation
.getMessage(WSDLConstants.MESSAGE_LABEL_IN_VALUE);
Message message = wsdl4jOutputMessage.getMessage();
if (null != message) {
outMessage.setName(message.getQName().getLocalPart());
copyExtensionAttributes(wsdl4jOutputMessage.getExtensionAttributes(),
outMessage, PORT_TYPE_OPERATION_INPUT);
// wsdl:portType -> wsdl:operation -> wsdl:output
}
// Check if the action is already set as we don't want to
// override it
// with the Default Action Pattern
ArrayList inputActions = axisOperation.getWSAMappingList();
String action = null;
if (inputActions == null || inputActions.size() == 0) {
action = WSDL11ActionHelper.getActionFromOutputElement(dif,
wsdl4jPortType,
wsdl4jOperation,
wsdl4jOutputMessage);
}
if (action != null) {
if (inputActions == null) {
inputActions = new ArrayList();
axisOperation.setWsamappingList(inputActions);
}
inputActions.add(action);
}
}
}
Map faults = wsdl4jOperation.getFaults();
Iterator faultKeyIterator = faults.keySet().iterator();
while (faultKeyIterator.hasNext()) {
Fault fault = (Fault) faults.get(faultKeyIterator.next());
AxisMessage axisFaultMessage = new AxisMessage();
addDocumentation(axisFaultMessage,fault.getDocumentationElement());
axisFaultMessage.addParameter(FAULT_NAME, fault.getName());
Message faultMessage = fault.getMessage();
if (null != faultMessage) {
axisFaultMessage
.setName(faultMessage.getQName().getLocalPart());
copyExtensibleElements(faultMessage.getExtensibilityElements(),
dif, axisFaultMessage, PORT_TYPE_OPERATION_FAULT);
}
// Check if the action is already set as we don't want to override