}
private void processOperation(JavaModel model, BindingOperationInfo bop, BindingInfo binding)
throws ToolException {
boolean enableOpMime = false;
JAXWSBinding bind = binding.getExtensor(JAXWSBinding.class);
if (bind != null && bind.isEnableMime()) {
enableOpMime = true;
}
JAXWSBinding bopBinding = bop.getExtensor(JAXWSBinding.class);
if (bopBinding != null && bopBinding.isEnableMime()) {
enableOpMime = true;
if (bopBinding.getJaxwsPara() != null) {
jaxwsBinding.setJaxwsPara(bopBinding.getJaxwsPara());
}
}
JavaInterface jf = null;
for (JavaInterface jf2 : model.getInterfaces().values()) {
if (binding.getInterface().getName().getLocalPart()
.equals(jf2.getWebServiceName())) {
jf = jf2;
}
}
if (isSoapBinding()) {
SoapBinding soapBinding = (SoapBinding)bindingObj;
if (SOAPBindingUtil.getSoapStyle(soapBinding.getStyle()) == null) {
jf.setSOAPStyle(javax.jws.soap.SOAPBinding.Style.DOCUMENT);
} else {
jf.setSOAPStyle(SOAPBindingUtil.getSoapStyle(soapBinding.getStyle()));
}
} else {
// REVISIT: fix for xml binding
jf.setSOAPStyle(javax.jws.soap.SOAPBinding.Style.DOCUMENT);
}
Object[] methods = jf.getMethods().toArray();
for (int i = 0; i < methods.length; i++) {
JavaMethod jm = (JavaMethod)methods[i];
if (jm.getOperationName() != null && jm.getOperationName().equals(bop.getName().getLocalPart())) {
if (isSoapBinding()) {
// TODO: add customize here
//doCustomizeOperation(jf, jm, bop);
Map prop = getSoapOperationProp(bop);
String soapAction = prop.get(soapOPAction) == null ? "" : (String)prop.get(soapOPAction);
String soapStyle = prop.get(soapOPStyle) == null ? "" : (String)prop.get(soapOPStyle);
jm.setSoapAction(soapAction);
if (SOAPBindingUtil.getSoapStyle(soapStyle) == null && this.bindingObj == null) {
org.apache.cxf.common.i18n.Message msg =
new org.apache.cxf.common.i18n.Message("BINDING_STYLE_NOT_DEFINED",
LOG);
throw new ToolException(msg);
}
if (SOAPBindingUtil.getSoapStyle(soapStyle) == null) {
jm.setSoapStyle(jf.getSOAPStyle());
} else {
jm.setSoapStyle(SOAPBindingUtil.getSoapStyle(soapStyle));
}
} else {
// REVISIT: fix for xml binding
jm.setSoapStyle(jf.getSOAPStyle());
}
if (jm.getSoapStyle().equals(javax.jws.soap.SOAPBinding.Style.RPC)) {
jm.getAnnotationMap().remove("SOAPBinding");
}
OperationProcessor processor = new OperationProcessor(context);
int headerType = isNonWrappable(bop);
OperationInfo opinfo = bop.getOperationInfo();
JAXWSBinding opBinding = (JAXWSBinding)opinfo.getExtensor(JAXWSBinding.class);
if (opBinding != null) {
if (opBinding.isEnableWrapperStyle()) {
jaxwsBinding.setEnableWrapperStyle(true);
} else {
jaxwsBinding.setEnableWrapperStyle(false);
if (!opBinding.isEnableAsyncMapping()) {
jaxwsBinding.setEnableAsyncMapping(false);
}
}
if (opBinding.isEnableMime()) {
enableOpMime = true;
}
}
if (jaxwsBinding.isEnableMime() || enableOpMime) {
jm.setMimeEnable(true);