new WSIFOperation_ApacheSOAP(
this,
bop.getOperation(),
wsifTypeMap);
if (operation == null) {
throw new WSIFException(
"Operation not found from binding operation: "
+ bop.getName());
}
operation.setStyle(this.style);
operation.setPartSerializerName(this.partSerializerName);
if (jmsAddressPropVals != null
&& jmsAddressPropVals.size() > 0) {
if (st instanceof SOAPJMSConnection)
operation.addInputJmsPropertyValues(jmsAddressPropVals);
else
throw new WSIFException("jms:propertyValue found in non-jms address");
}
// get soapActionURI and style from soap:operation
SOAPOperation soapOperation =
(SOAPOperation) getExtElem(bop,
SOAPOperation.class,
bop.getExtensibilityElements());
if (soapOperation == null) {
throw new WSIFException(
"soapAction must be specified in "
+ " required by WSDL 1.1 soap:operation binding for "
+ bop.getName());
}
String soapActionURI = soapOperation.getSoapActionURI();
operation.setSoapActionURI(soapActionURI);
Trc.event(
this,
"setting actionURI ",
soapActionURI,
" for op ",
operation.getName());
String opStyle = soapOperation.getStyle();
// try to get soap:body for input message
BindingInput binpt = bop.getBindingInput();
SOAPBody soapInputBody =
(SOAPBody) getExtElem(binpt,
SOAPBody.class,
binpt.getExtensibilityElements());
if (soapInputBody != null) {
String namespaceURI = soapInputBody.getNamespaceURI();
Trc.event(
this,
"setting namespace ",
namespaceURI,
" for op ",
operation.getName());
operation.setInputNamespace(namespaceURI);
String use = soapInputBody.getUse();
operation.setInputUse(use);
List encodingStyles = soapInputBody.getEncodingStyles();
if (encodingStyles != null) {
if (encodingStyles.size() == 0) {
}
operation.setInputEncodingStyle(
(String) encodingStyles.get(0));
// quietly ignore if encodingStyles.size() > 1 ...
}
List parts = soapInputBody.getParts();
if (parts != null)
operation.setPartNames(parts);
}
SOAPHeader soapHeader =
(SOAPHeader) getExtElem(binpt,
SOAPHeader.class,
binpt.getExtensibilityElements());
if (soapHeader != null) {
throw new WSIFException(
"not supported input soap:header " + soapHeader);
}
List inJmsProps =
getExtElems(
binpt,
JMSProperty.class,
binpt.getExtensibilityElements());
if (inJmsProps != null && inJmsProps.size() > 0) {
if (st instanceof SOAPJMSConnection)
operation.setInputJmsProperties(inJmsProps);
else
throw new WSIFException("jms:properties found in non-jms binding");
}
List inJmsPropVals =
getExtElems(
binpt,
JMSPropertyValue.class,
binpt.getExtensibilityElements());
if (inJmsPropVals != null && inJmsPropVals.size() > 0) {
if (st instanceof SOAPJMSConnection)
operation.addInputJmsPropertyValues(inJmsPropVals);
else
throw new WSIFException("jms:propertyValue found in non-jms binding");
}
// try to get soap:body for output message
BindingOutput boutpt = bop.getBindingOutput();
if (boutpt != null) {
SOAPBody soapOutputBody =
(SOAPBody) getExtElem(boutpt,
SOAPBody.class,
boutpt.getExtensibilityElements());
if (soapOutputBody != null) {
// NOTE: element ignored
//String namespaceURI = soapOutputBody.getNamespaceURI();
String use = soapOutputBody.getUse();
operation.setOutputUse(use);
// NOTE: element ignored
//List encodingStyles = soapInputBody.getEncodingStyles();
List parts = soapOutputBody.getParts();
if (parts != null && parts.size() > 0) {
operation.setReturnName((String) parts.get(0));
}
}
soapHeader =
(SOAPHeader) getExtElem(boutpt,
SOAPHeader.class,
boutpt.getExtensibilityElements());
if (soapHeader != null) {
throw new WSIFException(
"not supported output soap:header " + soapHeader);
}
List outJmsProps =
getExtElems(
boutpt,
JMSProperty.class,
boutpt.getExtensibilityElements());
if (outJmsProps != null && outJmsProps.size() > 0) {
if (st instanceof SOAPJMSConnection)
operation.setOutputJmsProperties(outJmsProps);
else
throw new WSIFException("jms:properties found in non-jms binding");
}
}
// Only now the operation has enough information to initialize itself
// operation.prepare();