Java Code Examples for javax.wsdl.BindingOperation#setOperation()
The following examples show how to use
javax.wsdl.BindingOperation#setOperation() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: AttributeVisitor.java From cxf with Apache License 2.0 | 6 votes |
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; }
Example 2
Source File: OperationVisitor.java From cxf with Apache License 2.0 | 6 votes |
private BindingOperation generateBindingOperation(Binding wsdlBinding, Operation op, String corbaOpName) { BindingOperation bindingOperation = definition.createBindingOperation(); //OperationType operationType = null; try { corbaOperation = (OperationType)extReg.createExtension(BindingOperation.class, CorbaConstants.NE_CORBA_OPERATION); } catch (WSDLException ex) { throw new RuntimeException(ex); } corbaOperation.setName(corbaOpName); bindingOperation.addExtensibilityElement((ExtensibilityElement)corbaOperation); bindingOperation.setOperation(op); bindingOperation.setName(op.getName()); binding.addBindingOperation(bindingOperation); return bindingOperation; }
Example 3
Source File: WSDLToXMLProcessor.java From cxf with Apache License 2.0 | 6 votes |
@SuppressWarnings("unchecked") private void addBindingOperation() throws ToolException { List<Operation> ops = portType.getOperations(); for (Operation op : ops) { BindingOperation bindingOperation = wsdlDefinition.createBindingOperation(); bindingOperation.setName(op.getName()); if (op.getInput() != null) { bindingOperation.setBindingInput(getBindingInput(op.getInput(), op.getName())); } if (op.getOutput() != null) { bindingOperation.setBindingOutput(getBindingOutput(op.getOutput(), op.getName())); } if (op.getFaults() != null && op.getFaults().size() > 0) { addXMLFaults(op, bindingOperation); } bindingOperation.setOperation(op); binding.addBindingOperation(bindingOperation); } }
Example 4
Source File: ServiceWSDLBuilder.java From cxf with Apache License 2.0 | 6 votes |
protected void buildBindingOperation(Definition def, Binding binding, Collection<BindingOperationInfo> bindingOperationInfos) { BindingOperation bindingOperation = null; for (BindingOperationInfo bindingOperationInfo : bindingOperationInfos) { bindingOperation = def.createBindingOperation(); addDocumentation(bindingOperation, bindingOperationInfo.getDocumentation()); bindingOperation.setName(bindingOperationInfo.getName().getLocalPart()); for (Operation operation : CastUtils.cast(binding.getPortType().getOperations(), Operation.class)) { if (operation.getName().equals(bindingOperation.getName())) { bindingOperation.setOperation(operation); break; } } buildBindingInput(def, bindingOperation, bindingOperationInfo.getInput()); buildBindingOutput(def, bindingOperation, bindingOperationInfo.getOutput()); buildBindingFault(def, bindingOperation, bindingOperationInfo.getFaults()); addExtensibilityAttributes(def, bindingOperation, bindingOperationInfo.getExtensionAttributes()); addExtensibilityElements(def, bindingOperation, getWSDL11Extensors(bindingOperationInfo)); binding.addBindingOperation(bindingOperation); } }
Example 5
Source File: PartialWSDLProcessor.java From cxf with Apache License 2.0 | 6 votes |
@SuppressWarnings("unchecked") private static void addBindingOperation(Definition wsdlDefinition, PortType portType, Binding binding, ExtensionRegistry extReg) throws Exception { List<Operation> ops = portType.getOperations(); for (Operation op : ops) { BindingOperation bindingOperation = wsdlDefinition.createBindingOperation(); setSoapOperationExtElement(bindingOperation, extReg); bindingOperation.setName(op.getName()); if (op.getInput() != null) { bindingOperation.setBindingInput(getBindingInput(op.getInput(), wsdlDefinition, extReg)); } if (op.getOutput() != null) { bindingOperation.setBindingOutput(getBindingOutput(op.getOutput(), wsdlDefinition, extReg)); } if (op.getFaults() != null && op.getFaults().size() > 0) { addSoapFaults(op, bindingOperation, wsdlDefinition, extReg); } bindingOperation.setOperation(op); binding.addBindingOperation(bindingOperation); } }
Example 6
Source File: WSDLToCorbaBinding.java From cxf with Apache License 2.0 | 5 votes |
private void addBindingOperations(Definition definition, PortType portType, Binding binding) throws Exception { List<Operation> ops = CastUtils.cast(portType.getOperations()); for (Operation op : ops) { try { BindingOperation bindingOperation = definition.createBindingOperation(); addCorbaOperationExtElement(bindingOperation, op); bindingOperation.setName(op.getName()); if (op.getInput() != null) { BindingInput bindingInput = definition.createBindingInput(); bindingInput.setName(op.getInput().getName()); bindingOperation.setBindingInput(bindingInput); } if (op.getOutput() != null) { BindingOutput bindingOutput = definition.createBindingOutput(); bindingOutput.setName(op.getOutput().getName()); bindingOperation.setBindingOutput(bindingOutput); } // add Faults if (op.getFaults() != null && op.getFaults().size() > 0) { Collection<Fault> faults = CastUtils.cast(op.getFaults().values()); for (Fault fault : faults) { BindingFault bindingFault = definition.createBindingFault(); bindingFault.setName(fault.getName()); bindingOperation.addBindingFault(bindingFault); } } bindingOperation.setOperation(op); binding.addBindingOperation(bindingOperation); } catch (Exception ex) { LOG.warning("Operation " + op.getName() + " not mapped to CORBA binding."); } } }
Example 7
Source File: WSDLToSoapProcessor.java From cxf with Apache License 2.0 | 5 votes |
@SuppressWarnings("unchecked") private void addBindingOperation() throws ToolException { /** * This method won't do unique operation name checking on portType The * WS-I Basic Profile[17] R2304 requires that operations within a * wsdl:portType have unique values for their name attribute so mapping * of WS-I compliant WSDLdescriptions will not generate Java interfaces * with overloaded methods. However, for backwards compatibility, JAX-WS * supports operation name overloading provided the overloading does not * cause conflicts (as specified in the Java Language Specification[25]) * in the mapped Java service endpoint interface declaration. */ List<Operation> ops = portType.getOperations(); for (Operation op : ops) { BindingOperation bindingOperation = wsdlDefinition.createBindingOperation(); setSoapOperationExtElement(bindingOperation); bindingOperation.setName(op.getName()); if (op.getInput() != null) { bindingOperation.setBindingInput(getBindingInput(op.getInput())); } if (op.getOutput() != null) { bindingOperation.setBindingOutput(getBindingOutput(op.getOutput())); } if (op.getFaults() != null && op.getFaults().size() > 0) { addSoapFaults(op, bindingOperation); } bindingOperation.setOperation(op); binding.addBindingOperation(bindingOperation); } }
Example 8
Source File: WSDLDocCreator.java From jolie with GNU Lesser General Public License v2.1 | 4 votes |
private void addOperationSOAPBinding( Definition localDef, Operation wsdlOp, Binding bind ) { try { // creating operation binding BindingOperation bindOp = localDef.createBindingOperation(); bindOp.setName( wsdlOp.getName() ); // adding soap extensibility elements SOAPOperation soapOperation = (SOAPOperation) extensionRegistry.createExtension( BindingOperation.class, new QName( NameSpacesEnum.SOAP.getNameSpaceURI(), "operation" ) ); soapOperation.setStyle( "document" ); // NOTA-BENE: Come settare SOAPACTION? jolie usa SOAP1.1 o 1.2? COme usa la SoapAction? soapOperation.setSoapActionURI( wsdlOp.getName() ); bindOp.addExtensibilityElement( soapOperation ); bindOp.setOperation( wsdlOp ); // adding input BindingInput bindingInput = localDef.createBindingInput(); SOAPBody body = (SOAPBody) extensionRegistry.createExtension( BindingInput.class, new QName( NameSpacesEnum.SOAP.getNameSpaceURI(), "body" ) ); body.setUse( "literal" ); bindingInput.addExtensibilityElement( body ); bindOp.setBindingInput( bindingInput ); // adding output BindingOutput bindingOutput = localDef.createBindingOutput(); bindingOutput.addExtensibilityElement( body ); bindOp.setBindingOutput( bindingOutput ); // adding fault if( !wsdlOp.getFaults().isEmpty() ) { for( Object o : wsdlOp.getFaults().entrySet() ) { BindingFault bindingFault = localDef.createBindingFault(); SOAPFault soapFault = (SOAPFault) extensionRegistry.createExtension( BindingFault.class, new QName( NameSpacesEnum.SOAP.getNameSpaceURI(), "fault" ) ); soapFault.setUse( "literal" ); String faultName = ((Entry) o).getKey().toString(); bindingFault.setName( faultName ); soapFault.setName( faultName ); bindingFault.addExtensibilityElement( soapFault ); bindOp.addBindingFault( bindingFault ); } } bind.addBindingOperation( bindOp ); } catch( WSDLException ex ) { ex.printStackTrace(); } }