public InterfaceContract getBindingInterfaceContract() { return wsBinding.getBindingInterfaceContract(); }
if (wsBinding.getName() != null) { writer.writeAttribute(NAME, wsBinding.getName()); if (wsBinding.getURI() != null) { writer.writeAttribute(URI, wsBinding.getURI()); if (wsBinding.getPortName() != null) { wsBinding.getServiceName().getNamespaceURI() + "#wsdl.port(" + wsBinding.getServiceName().getLocalPart() + "/" + wsBinding.getPortName() + ")"; writer.writeAttribute(WSDL_ELEMENT, wsdlElement); } else if (wsBinding.getEndpointName() != null) { wsBinding.getServiceName().getNamespaceURI() + "#wsdl.endpoint(" + wsBinding.getServiceName().getLocalPart() + "/" + wsBinding.getEndpointName() + ")"; writer.writeAttribute(WSDL_ELEMENT, wsdlElement); } else if (wsBinding.getBindingName() != null) { wsBinding.getBindingName().getNamespaceURI() + "#wsdl.binding(" + wsBinding.getBindingName().getLocalPart() + ")";
private void validateWSDL(ProcessorContext context, WebServiceBinding model) { WSDLDefinition wsdlDefinition = model.getUserSpecifiedWSDLDefinition(); Port port = model.getPort(); if (port != null){ validateWSDLPort(context, model, port); } Binding binding = model.getBinding(); if (binding != null){ validateWSDLBinding(context, model, binding); } }
private Dispatch<SOAPMessage> createDispatchFromWSDL(URL wsdlLocation) { QName serviceName = wsBinding.getServiceName(); QName portName = new QName(serviceName.getNamespaceURI(), wsBinding.getPortName()); Service service = Service.create(wsdlLocation, serviceName); return service.createDispatch(portName, SOAPMessage.class, Service.Mode.MESSAGE); }
private PortType getPortType(WebServiceBinding model) { PortType portType = null; if (model.getPort() != null) { portType = model.getPort().getBinding().getPortType(); } else if (model.getEndpoint() != null) { portType = model.getPort().getBinding().getPortType(); } else if (model.getBinding() != null) { portType = model.getBinding().getPortType(); } else if (model.getService() != null) { // FIXME: How to find the compatible port? Map ports = model.getService().getPorts(); if (!ports.isEmpty()) { Port port = (Port)ports.values().iterator().next(); portType = port.getBinding().getPortType(); } } return portType; }
if (model == null || !model.isUnresolved()) return; Monitor monitor = context.getMonitor(); WSDLDefinition wsdlDefinition = wsdlFactory.createWSDLDefinition(); wsdlDefinition.setUnresolved(true); wsdlDefinition.setNamespace(model.getNamespace()); wsdlDefinition.setNameOfBindingToResolve(model.getBindingName()); wsdlDefinition.setNameOfServiceToResolve(model.getServiceName()); wsdlDefinition.getWsdliLocations().putAll(model.getWsdliLocations()); wsdlDefinition.getXmlSchemas().addAll(resolved.getXmlSchemas()); wsdlDefinition.setUnresolved(false); model.setUserSpecifiedWSDLDefinition(wsdlDefinition); if (model.getBindingName() != null) { WSDLObject<Binding> binding = wsdlDefinition.getWSDLObject(Binding.class, model.getBindingName()); if (binding != null) { wsdlDefinition.setDefinition(binding.getDefinition()); model.setBinding(binding.getElement()); } else { error(monitor, "WsdlBindingDoesNotMatch", wsdlDefinition, model.getBindingName()); if (model.getServiceName() != null) { WSDLObject<Service> service = wsdlDefinition.getWSDLObject(Service.class, model.getServiceName()); if (service != null) { wsdlDefinition.setDefinition(service.getDefinition()); model.setService(service.getElement()); if (model.getPortName() != null) { port = service.getElement().getPort(model.getPortName());
WSDLDefinition wsdlDefinition = wsBinding.getUserSpecifiedWSDLDefinition(); if (wsdlDefinition == null) { error(monitor, "NoWsdlInterface", wsBinding, component.getName(), contract.getName()); Interface interfaze = wsBinding.getBindingInterfaceContract().getInterface(); if (interfaze instanceof WSDLInterface) { PortType portType = ((WSDLInterface)interfaze).getPortType(); Binding binding = wsBinding.getBinding(); if (binding != null) { boolean ok = importBinding(binding, wsdlDefinition, newDef, imports); QName serviceQName = wsBinding.getServiceName(); String portName = wsBinding.getPortName(); if (serviceQName != null) { Service service = def.getService(serviceQName); WSDLInterface wi = (WSDLInterface)wsBinding.getBindingInterfaceContract().getInterface(); PortType portType = wi.getPortType(); if (wsBinding.getBinding() == null && ports.size() == 0) { Binding binding = helper.createBinding(def, portType); if (BindingWSDLGenerator.requiresSOAP12(wsBinding)) { wsBinding.setService(service); wsBinding.setPort(port); } else { if (ports.size() > 0) {
String targetNamespace = wsBinding.getUserSpecifiedWSDLDefinition().getDefinition().getTargetNamespace(); try { WSDLWriter writer = WSDLFactory.newInstance().newWSDLWriter(); writer.writeWSDL(wsBinding.getUserSpecifiedWSDLDefinition().getDefinition(), outStream); } catch (Exception ex){ ex.printStackTrace(); wsBinding.getPort().getName()); properties.put(Endpoint.WSDL_PORT, portName); QName bindingServiceName = wsBinding.getServiceName() == null ? wsBinding.getService().getQName() : wsBinding.getServiceName(); QName serviceName = new QName(targetNamespace, bindingServiceName.getLocalPart()); wsEndpoint.publish(wsBinding.getURI()); endpoint.setDeployedURI(wsBinding.getURI());
if (wsBinding.getGeneratedWSDLDocument() == null) { throw new ServiceRuntimeException("No WSDL document for " + endpoint.getURI()); InterfaceContract contract = wsBinding.getBindingInterfaceContract(); contract.getInterface().resetDataBinding(Node.class.getName()); if (!wsBinding.getURI().startsWith("http://")) { String serviceURI = null; List wsdlPortExtensions = wsBinding.getPort().getExtensibilityElements(); for (final Object extension : wsdlPortExtensions) { if (extension instanceof SOAPAddress) { serviceURI = "http://localhost:" + defaultPort + wsBinding.getURI(); wsBinding.setURI(serviceURI); System.out.println("Binding.ws JAXWS provider - Service URI: " + wsBinding.getURI());
if (wsBinding.getEndPointReference() != null) { eprURI = getEPR(wsBinding); if (wsBinding.getServiceName() != null && wsBinding.getBindingName() == null) { String actualURI = wsBinding.getURI(); if (eprURI != null && eprURI.toString().length() != 0) {
if (wsBinding.getGeneratedWSDLDocument() == null) { throw new ServiceRuntimeException("No WSDL document for " + component.getName() + "/" + service.getName()); contract = wsBinding.getBindingInterfaceContract(); contract.getInterface().resetDataBinding(OMElement.class.getName()); wsdlPort = (Port)wsBinding.getService().getPorts().values().iterator().next(); wsBinding.setURI(deployedURI); if (wsBinding.isRpcEncoded()){ throw new ServiceRuntimeException("rpc/encoded WSDL style not supported. Component " + endpoint.getComponent().getName() + " Service " + endpoint.getService() + if (wsBinding.isDocEncoded()){ throw new ServiceRuntimeException("doc/encoded WSDL style not supported. Component " + endpoint.getComponent().getName() + " Service " + endpoint.getService() +
if (wsBinding.getGeneratedWSDLDocument() == null) { throw new ServiceRuntimeException("No WSDL document for " + component.getName() + "/" + reference.getName()); InterfaceContract contract = wsBinding.getBindingInterfaceContract(); if (contract.getInterface() != null) { contract.getInterface().resetDataBinding(OMElement.class.getName()); if (wsBinding.isRpcEncoded()){ throw new ServiceRuntimeException("rpc/encoded WSDL style not supported. Component " + endpointReference.getComponent().getName() + " Reference " + endpointReference.getReference() + if (wsBinding.isDocEncoded()){ throw new ServiceRuntimeException("doc/encoded WSDL style not supported. Component " + endpointReference.getComponent().getName() + " Reference " + endpointReference.getReference() + if (wsBinding.isDocLiteralUnwrapped()){ wsBinding.getBinding() != null) { Definition def = wsBinding.getGeneratedWSDLDocument(); Binding binding = def.getBinding(wsBinding.getBinding().getQName()); for ( Object ext : binding.getExtensibilityElements() ) { if ( ext instanceof SOAP12Binding ) wsBinding.getBinding() != null) { Definition def = wsBinding.getGeneratedWSDLDocument(); Binding binding = def.getBinding(wsBinding.getBinding().getQName()); for ( Object ext : binding.getExtensibilityElements() ) { if ( ext instanceof SOAPBinding )
InterfaceContract icontract = wsBinding.getBindingInterfaceContract(); if (icontract == null) { icontract = ((Contract)contract).getInterfaceContract(wsBinding).makeUnidirectional(false); wsBinding.setBindingInterfaceContract(icontract); Definition definition = wsBinding.getGeneratedWSDLDocument(); if (definition == null) { definition = WSDLServiceGenerator.configureWSDLDefinition(wsBinding, component, contract, monitor); wsBinding.setGeneratedWSDLDocument(definition);
if (args != null && args.length > 0) { if (wsBinding.isRpcLiteral()){ if (wsBinding.getBinding() != null){ Iterator iter = wsBinding.getBinding().getBindingOperations().iterator(); loopend: while(iter.hasNext()){ wrapperNamespace = wsBinding.getUserSpecifiedWSDLDefinition().getNamespace(); body.addChild(operationNameElement); } else if (wsBinding.isRpcEncoded()){ throw new ServiceRuntimeException("rpc/encoded WSDL style not supported for endpoint reference " + endpointReference); } else if (wsBinding.isDocEncoded()){ throw new ServiceRuntimeException("doc/encoded WSDL style not supported for endpoint reference " + endpointReference); } else if (wsBinding.isDocLiteralWrapped() || wsBinding.isDocLiteralUnwrapped()){
private void addWSAActionHeader( SOAPHeader sh ) { // Create wsa:Action header which is required by ws-addressing spec String action = options.getAction(); if (action == null) { PortType portType = ((WSDLInterface)wsBinding.getBindingInterfaceContract().getInterface()).getPortType(); Operation op = portType.getOperation(wsdlOperationName.getLocalPart(), null, null); action = WSDL11ActionHelper.getActionFromInputElement(wsBinding.getGeneratedWSDLDocument(), portType, op, op.getInput()); } OMElement actionOM = sh.getOMFactory().createOMElement(QNAME_WSA_ACTION); actionOM.setText(action == null ? "" : action); sh.addChild(actionOM); } // end method addWSAActionHeader
Object[] args = (Object[])msg.getBody(); if (wsBinding.isRpcLiteral()) { if (wsBinding.getBinding() != null){ Iterator iter = wsBinding.getBinding().getBindingOperations().iterator(); loopend: while(iter.hasNext()){ wrapperNamespace = wsBinding.getUserSpecifiedWSDLDefinition().getNamespace(); } else if (wsBinding.isRpcEncoded()) { throw new ServiceRuntimeException("rpc/encoded WSDL style not supported for endpoint reference " + endpointReference); } else if (wsBinding.isDocEncoded()){ throw new ServiceRuntimeException("doc/encoded WSDL style not supported for endpoint reference " + endpointReference); } else {
WebServiceBinding wsBinding) throws AxisFault { Definition definition = wsBinding.getGeneratedWSDLDocument(); QName serviceQName = wsBinding.getService().getQName(); Definition def = getDefinition(definition, serviceQName); addSchemas(wsBinding.getUserSpecifiedWSDLDefinition(), axisService);
Definition definition = wsBinding.getGeneratedWSDLDocument(); QName serviceQName = wsBinding.getService().getQName(); Port port = wsBinding.getPort(); if (port == null) { Collection<Port> ports = wsBinding.getService().getPorts().values(); for (Port p : ports) {
OMElement responseOM = response.getBody(); if (wsBinding.isRpcLiteral()){ if (wsBinding.getBinding() != null){ Iterator iter = wsBinding.getBinding().getBindingOperations().iterator(); loopend: while(iter.hasNext()){ wrapperNamespace = wsBinding.getUserSpecifiedWSDLDefinition().getNamespace();
protected org.apache.axis2.addressing.EndpointReference getPortLocationEPR(WebServiceBinding binding) { String ep = null; if (binding.getPort() != null) { List<?> wsdlPortExtensions = binding.getPort().getExtensibilityElements(); for (final Object extension : wsdlPortExtensions) { if (extension instanceof SOAPAddress) { ep = ((SOAPAddress)extension).getLocationURI(); break; } if (extension instanceof SOAP12Address) { SOAP12Address address = (SOAP12Address)extension; ep = address.getLocationURI(); break; } } } if(ep == null || ep.equals("")) { ep = binding.getURI(); } return ep == null || "".equals(ep) ? null : new org.apache.axis2.addressing.EndpointReference(ep); }