use of javax.wsdl.extensions.soap.SOAPOperation in project tdi-studio-se by Talend.
the class ComponentBuilder method buildOperation.
private OperationInfo buildOperation(OperationInfo operationInfo, BindingOperation bindingOper) {
Operation oper = bindingOper.getOperation();
operationInfo.setTargetMethodName(oper.getName());
Vector operElems = findExtensibilityElement(bindingOper.getExtensibilityElements(), "operation");
ExtensibilityElement operElem = (ExtensibilityElement) operElems.elementAt(0);
if (operElem != null && operElem instanceof SOAPOperation) {
SOAPOperation soapOperation = (SOAPOperation) operElem;
operationInfo.setSoapActionURI(soapOperation.getSoapActionURI());
} else if (operElem != null && operElem instanceof SOAP12Operation) {
SOAP12Operation soapOperation = (SOAP12Operation) operElem;
operationInfo.setSoapActionURI(soapOperation.getSoapActionURI());
}
BindingInput bindingInput = bindingOper.getBindingInput();
BindingOutput bindingOutput = bindingOper.getBindingOutput();
Vector bodyElems = findExtensibilityElement(bindingInput.getExtensibilityElements(), "body");
ExtensibilityElement bodyElem = (ExtensibilityElement) bodyElems.elementAt(0);
if (bodyElem != null && bodyElem instanceof SOAPBody) {
SOAPBody soapBody = (SOAPBody) bodyElem;
List styles = soapBody.getEncodingStyles();
String encodingStyle = null;
if (styles != null) {
encodingStyle = styles.get(0).toString();
}
if (encodingStyle == null) {
encodingStyle = DEFAULT_SOAP_ENCODING_STYLE;
}
operationInfo.setEncodingStyle(encodingStyle.toString());
operationInfo.setTargetObjectURI(soapBody.getNamespaceURI());
} else if (bodyElem != null && bodyElem instanceof SOAP12Body) {
SOAP12Body soapBody = (SOAP12Body) bodyElem;
String encodingStyle = null;
if (soapBody.getEncodingStyle() != null) {
encodingStyle = soapBody.getEncodingStyle().toString();
}
if (encodingStyle == null) {
encodingStyle = DEFAULT_SOAP_ENCODING_STYLE;
}
operationInfo.setEncodingStyle(encodingStyle.toString());
operationInfo.setTargetObjectURI(soapBody.getNamespaceURI());
}
Input inDef = oper.getInput();
if (inDef != null) {
Message inMsg = inDef.getMessage();
if (inMsg != null) {
operationInfo.setInputMessageName(inMsg.getQName().getLocalPart());
getParameterFromMessage(operationInfo, inMsg, 1);
operationInfo.setInmessage(inMsg);
}
}
Output outDef = oper.getOutput();
if (outDef != null) {
Message outMsg = outDef.getMessage();
if (outMsg != null) {
operationInfo.setOutputMessageName(outMsg.getQName().getLocalPart());
getParameterFromMessage(operationInfo, outMsg, 2);
operationInfo.setOutmessage(outMsg);
}
}
return operationInfo;
}
use of javax.wsdl.extensions.soap.SOAPOperation in project cxf by apache.
the class SOAPBindingUtil method isMixedStyle.
public static boolean isMixedStyle(Binding binding) {
String bindingStyle = "";
String previousOpStyle = "";
String style = "";
for (Object obj : binding.getExtensibilityElements()) {
if (isSOAPBinding(obj)) {
SOAPBinding soapBinding = getSoapBinding(obj);
bindingStyle = soapBinding.getStyle();
if (bindingStyle == null) {
bindingStyle = "";
}
}
}
for (Object bobj : binding.getBindingOperations()) {
BindingOperation bop = (BindingOperation) bobj;
for (Object obj : bop.getExtensibilityElements()) {
if (isSOAPOperation(obj)) {
SOAPOperation soapOperation = getSoapOperation(obj);
style = soapOperation.getStyle();
if (style == null) {
style = "";
}
if ("".equals(bindingStyle) && "".equals(previousOpStyle) || "".equals(bindingStyle) && previousOpStyle.equalsIgnoreCase(style)) {
previousOpStyle = style;
} else if (!"".equals(bindingStyle) && "".equals(previousOpStyle) && bindingStyle.equalsIgnoreCase(style) || bindingStyle.equalsIgnoreCase(previousOpStyle) && bindingStyle.equalsIgnoreCase(style)) {
previousOpStyle = style;
} else if (!"".equals(bindingStyle) && "".equals(style) && "".equals(previousOpStyle)) {
continue;
} else {
return true;
}
}
}
}
return false;
}
use of javax.wsdl.extensions.soap.SOAPOperation in project teiid by teiid.
the class WSDLMetadataProcessor method buildSoapOperation.
private void buildSoapOperation(MetadataFactory mf, BindingOperation bindingOperation) {
Operation operation = bindingOperation.getOperation();
// add input
String inputXML = null;
Input input = operation.getInput();
if (input != null) {
Message message = input.getMessage();
if (message != null) {
inputXML = message.getQName().getLocalPart();
}
}
// add output
String outXML = null;
Output output = operation.getOutput();
if (output != null) {
Message message = output.getMessage();
if (message != null) {
outXML = message.getQName().getLocalPart();
}
}
// $NON-NLS-1$
ExtensibilityElement operationExtension = getExtensibilityElement(bindingOperation.getExtensibilityElements(), "operation");
if (!(operationExtension instanceof SOAPOperation) && !(operationExtension instanceof SOAP12Operation)) {
return;
}
if (operationExtension instanceof SOAPOperation) {
// soap:operation
SOAPOperation soapOperation = (SOAPOperation) operationExtension;
String style = soapOperation.getStyle();
if (style.equalsIgnoreCase("rpc")) {
// $NON-NLS-1$
LogManager.logInfo(LogConstants.CTX_CONNECTOR, WSExecutionFactory.UTIL.gs(WSExecutionFactory.Event.TEIID15004, operation.getName()));
return;
}
} else if (operationExtension instanceof SOAP12Operation) {
// soap:operation
SOAP12Operation soapOperation = (SOAP12Operation) operationExtension;
String style = soapOperation.getStyle();
if (style.equalsIgnoreCase("rpc")) {
// $NON-NLS-1$
LogManager.logInfo(LogConstants.CTX_CONNECTOR, WSExecutionFactory.UTIL.gs(WSExecutionFactory.Event.TEIID15004, operation.getName()));
return;
}
}
Procedure procedure = mf.addProcedure(operation.getName());
procedure.setVirtual(false);
procedure.setNameInSource(operation.getName());
mf.addProcedureParameter(inputXML, TypeFacility.RUNTIME_NAMES.XML, Type.In, procedure);
// $NON-NLS-1$
ProcedureParameter param = mf.addProcedureParameter("stream", TypeFacility.RUNTIME_NAMES.BOOLEAN, Type.In, procedure);
// $NON-NLS-1$
param.setAnnotation("If the result should be streamed.");
param.setNullType(NullType.Nullable);
// $NON-NLS-1$
param.setDefaultValue("false");
mf.addProcedureParameter(outXML, TypeFacility.RUNTIME_NAMES.XML, Type.ReturnValue, procedure);
}
use of javax.wsdl.extensions.soap.SOAPOperation in project tdi-studio-se by Talend.
the class ComponentBuilder method buildOperations.
private List buildOperations(Binding binding) {
List operationInfos = new ArrayList();
List operations = binding.getBindingOperations();
if (operations != null && !operations.isEmpty()) {
Vector soapBindingElems = findExtensibilityElement(binding.getExtensibilityElements(), "binding");
// default
String style = "document";
ExtensibilityElement soapBindingElem = (ExtensibilityElement) soapBindingElems.elementAt(0);
if (soapBindingElem != null && soapBindingElem instanceof SOAPBinding) {
SOAPBinding soapBinding = (SOAPBinding) soapBindingElem;
style = soapBinding.getStyle();
} else if (soapBindingElem != null && soapBindingElem instanceof SOAP12Binding) {
SOAP12Binding soapBinding = (SOAP12Binding) soapBindingElem;
style = soapBinding.getStyle();
}
Iterator opIter = operations.iterator();
while (opIter.hasNext()) {
alldExtendtion.clear();
BindingOperation oper = (BindingOperation) opIter.next();
Vector operElems = findExtensibilityElement(oper.getExtensibilityElements(), "operation");
ExtensibilityElement operElem = (ExtensibilityElement) operElems.elementAt(0);
if (operElem != null && operElem instanceof SOAPOperation) {
OperationInfo operationInfo = new OperationInfo(style);
buildOperation(operationInfo, oper);
operationInfos.add(operationInfo);
} else if (operElem != null && operElem instanceof SOAP12Operation) {
OperationInfo operationInfo = new OperationInfo(style);
buildOperation(operationInfo, oper);
operationInfos.add(operationInfo);
}
}
}
return operationInfos;
}
use of javax.wsdl.extensions.soap.SOAPOperation in project cxf by apache.
the class PartialWSDLProcessor method setSoapOperationExtElement.
private static void setSoapOperationExtElement(BindingOperation bo, ExtensionRegistry extReg) throws Exception {
SOAPOperation soapOperation = SOAPBindingUtil.createSoapOperation(extReg, false);
soapOperation.setStyle(style);
soapOperation.setSoapActionURI("");
bo.addExtensibilityElement(soapOperation);
}
Aggregations