use of javax.wsdl.BindingOutput 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.BindingOutput in project carbon-business-process by wso2.
the class SOAPUtils method parseSOAPResponseFromPartner.
public static org.apache.ode.bpel.iapi.Message parseSOAPResponseFromPartner(BPELMessageContext partnerInvocationContext, MessageExchange partnerRoleMessageExchange) throws BPELFault {
org.apache.ode.bpel.iapi.Message messageToODE = partnerRoleMessageExchange.createMessage(partnerRoleMessageExchange.getOperation().getOutput().getMessage().getQName());
BindingOperation bindingOp = getBindingOperation(partnerInvocationContext, partnerRoleMessageExchange.getOperationName());
BindingOutput bindingOutPut = getBindingOutPut(bindingOp);
SOAPEnvelope responseFromPartnerService = partnerInvocationContext.getOutMessageContext().getEnvelope();
if (partnerInvocationContext.isSoap12()) {
javax.wsdl.extensions.soap12.SOAP12Body soapBodyDefinition = getSOAP12Body(bindingOutPut);
if (soapBodyDefinition != null) {
if (responseFromPartnerService.getBody() != null) {
extractSOAPBodyParts(partnerRoleMessageExchange, messageToODE, responseFromPartnerService.getBody(), soapBodyDefinition.getParts(), soapBodyDefinition.getNamespaceURI(), partnerInvocationContext.isRPCStyleOperation());
} else {
throw new BPELFault("SOAP Body cannot be null for WSDL operation which " + "requires SOAP Body.");
}
}
} else {
javax.wsdl.extensions.soap.SOAPBody soapBodyDefinition = getSOAP11Body(bindingOutPut);
if (soapBodyDefinition != null) {
if (responseFromPartnerService.getBody() != null) {
extractSOAPBodyParts(partnerRoleMessageExchange, messageToODE, responseFromPartnerService.getBody(), soapBodyDefinition.getParts(), soapBodyDefinition.getNamespaceURI(), partnerInvocationContext.isRPCStyleOperation());
} else {
throw new BPELFault("SOAP Body cannot be null for WSDL operation which " + "requires SOAP Body.");
}
}
}
if (getSOAPHeaders(bindingOutPut) != null && responseFromPartnerService.getHeader() != null) {
extractSoapHeaderParts(messageToODE, partnerInvocationContext.getBpelServiceWSDLDefinition(), responseFromPartnerService.getHeader(), getSOAPHeaders(bindingOutPut), partnerRoleMessageExchange.getOperation().getOutput().getMessage());
}
return messageToODE;
}
use of javax.wsdl.BindingOutput in project cxf by apache.
the class SOAPBindingUtil method getBindingOutputSOAPHeaders.
public static List<SoapHeader> getBindingOutputSOAPHeaders(BindingOperation bop) {
List<SoapHeader> headers = new ArrayList<>();
BindingOutput bindingOutput = bop.getBindingOutput();
if (bindingOutput != null) {
for (Object obj : bindingOutput.getExtensibilityElements()) {
if (isSOAPHeader(obj)) {
headers.add(getProxy(SoapHeader.class, obj));
}
}
}
return headers;
}
use of javax.wsdl.BindingOutput in project cxf by apache.
the class OperationVisitor method generateOutputMessage.
public Message generateOutputMessage(Operation operation, BindingOperation bindingOperation) {
Message msg = definition.createMessage();
QName msgName;
if (!mapper.isDefaultMapping()) {
// mangle the message name
// REVISIT, do we put in the entire scope for mangling
msgName = new QName(definition.getTargetNamespace(), getScope().tail() + "." + operation.getName() + RESPONSE_SUFFIX);
} else {
msgName = new QName(definition.getTargetNamespace(), operation.getName() + RESPONSE_SUFFIX);
}
msg.setQName(msgName);
msg.setUndefined(false);
String outputName = operation.getName() + RESPONSE_SUFFIX;
Output output = definition.createOutput();
output.setName(outputName);
output.setMessage(msg);
BindingOutput bindingOutput = definition.createBindingOutput();
bindingOutput.setName(outputName);
bindingOperation.setBindingOutput(bindingOutput);
operation.setOutput(output);
definition.addMessage(msg);
return msg;
}
use of javax.wsdl.BindingOutput in project cxf by apache.
the class AttributeVisitor method generateCorbaBindingOperation.
private BindingOperation generateCorbaBindingOperation(Binding wsdlBinding, Operation op, OperationType corbaOp) {
BindingInput bindingInput = definition.createBindingInput();
bindingInput.setName(op.getInput().getName());
BindingOutput bindingOutput = definition.createBindingOutput();
bindingOutput.setName(op.getOutput().getName());
BindingOperation bindingOperation = definition.createBindingOperation();
bindingOperation.addExtensibilityElement((ExtensibilityElement) corbaOp);
bindingOperation.setOperation(op);
bindingOperation.setName(op.getName());
bindingOperation.setBindingInput(bindingInput);
bindingOperation.setBindingOutput(bindingOutput);
binding.addBindingOperation(bindingOperation);
return bindingOperation;
}
Aggregations