use of javax.wsdl.BindingInput 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.BindingInput in project carbon-business-process by wso2.
the class SOAPUtils method createSOAPRequest.
/**
* Create SOAP Request message from request submitted by ODE engine.
*
* @param bpelMessageContext DTO containing details about current message flow
* @param odePartnerMessageExchange ODE PartnerRoleMessageExchange containing information about
* current external service invocation.
* @throws AxisFault If an error occurred while creating the SOAP request
*/
public static void createSOAPRequest(final BPELMessageContext bpelMessageContext, final PartnerRoleMessageExchange odePartnerMessageExchange) throws AxisFault {
checkForNullValuesInRequest(bpelMessageContext, odePartnerMessageExchange);
BindingOperation bindingOp = getBindingOperation(bpelMessageContext, odePartnerMessageExchange.getOperationName());
BindingInput bindingInput = getBindingInput(bindingOp);
SOAPEnvelope soapEnvelope = bpelMessageContext.getInMessageContext().getEnvelope();
if (soapEnvelope == null) {
soapEnvelope = bpelMessageContext.getSoapFactoryForCurrentMessageFlow().getDefaultEnvelope();
bpelMessageContext.getInMessageContext().setEnvelope(soapEnvelope);
}
populateSOAPHeaders(odePartnerMessageExchange.getRequest(), soapEnvelope, bpelMessageContext.getSoapFactoryForCurrentMessageFlow(), getSOAPHeaders(bindingInput), odePartnerMessageExchange.getOperation());
populateSOAPBody(soapEnvelope, bindingInput, bpelMessageContext.isSoap12(), bpelMessageContext.getSoapFactoryForCurrentMessageFlow(), odePartnerMessageExchange.getOperation(), odePartnerMessageExchange.getOperation().getInput().getMessage(), odePartnerMessageExchange.getRequest(), bpelMessageContext.isRPCStyleOperation(), true);
}
use of javax.wsdl.BindingInput in project cxf by apache.
the class SOAPBindingUtil method getBindingInputSOAPHeaders.
public static List<SoapHeader> getBindingInputSOAPHeaders(BindingOperation bop) {
List<SoapHeader> headers = new ArrayList<>();
BindingInput bindingInput = bop.getBindingInput();
if (bindingInput != null) {
for (Object obj : bindingInput.getExtensibilityElements()) {
if (isSOAPHeader(obj)) {
headers.add(getProxy(SoapHeader.class, obj));
}
}
}
return headers;
}
use of javax.wsdl.BindingInput 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;
}
use of javax.wsdl.BindingInput in project cxf by apache.
the class JAXWSDefinitionBuilderTest method testBuildDefinitionWithXMLBinding.
@Test
public void testBuildDefinitionWithXMLBinding() {
String qname = "http://apache.org/hello_world_xml_http/bare";
String wsdlUrl = getClass().getResource("resources/hello_world_xml_bare.wsdl").toString();
JAXWSDefinitionBuilder builder = new JAXWSDefinitionBuilder();
builder.setBus(BusFactory.getDefaultBus());
builder.setContext(env);
Definition def = builder.build(wsdlUrl);
assertNotNull(def);
Map<?, ?> services = def.getServices();
assertNotNull(services);
assertEquals(1, services.size());
Service service = (Service) services.get(new QName(qname, "XMLService"));
assertNotNull(service);
Map<?, ?> ports = service.getPorts();
assertNotNull(ports);
assertEquals(1, ports.size());
Port port = service.getPort("XMLPort");
assertNotNull(port);
assertEquals(1, port.getExtensibilityElements().size());
Object obj = port.getExtensibilityElements().get(0);
if (obj instanceof JAXBExtensibilityElement) {
obj = ((JAXBExtensibilityElement) obj).getValue();
}
assertTrue(obj.getClass().getName() + " is not an AddressType", obj instanceof AddressType);
Binding binding = port.getBinding();
assertNotNull(binding);
assertEquals(new QName(qname, "Greeter_XMLBinding"), binding.getQName());
BindingOperation operation = binding.getBindingOperation("sayHi", null, null);
assertNotNull(operation);
BindingInput input = operation.getBindingInput();
assertNotNull(input);
assertEquals(1, input.getExtensibilityElements().size());
obj = input.getExtensibilityElements().get(0);
if (obj instanceof JAXBExtensibilityElement) {
obj = ((JAXBExtensibilityElement) obj).getValue();
}
assertTrue(obj.getClass().getName() + " is not an XMLBindingMessageFormat", obj instanceof XMLBindingMessageFormat);
}
Aggregations