public void introspectPortType(WSDLInterface wsdlInterface, PortType portType, WSDLDefinition wsdlDefinition, ModelResolver resolver, Monitor monitor) throws InvalidWSDLException { processIntents(wsdlInterface, portType); WSDLInterface callback = processCallbackAttribute( portType, resolver, monitor ); wsdlInterface.setPortType(portType); wsdlInterface.setCallbackInterface(callback); wsdlInterface.getOperations().addAll(introspectOperations(portType, wsdlDefinition, resolver, monitor)); }
/** * Process an extension @callback attribute on a WSDL portType declaration * - the callback attribute must contain the QName of another portType * @param portType the portType * @return */ private WSDLInterface processCallbackAttribute( PortType portType, ModelResolver resolver, Monitor monitor ) { Object o = portType.getExtensionAttribute(CALLBACK_ATTRIBUTE); if(o != null && o instanceof QName) { WSDLInterface wsdlInterface = wsdlFactory.createWSDLInterface(); wsdlInterface.setUnresolved(true); wsdlInterface.setName( (QName)o ); wsdlInterface = WSDLInterfaceProcessor.resolveWSDLInterface( wsdlInterface, resolver, monitor, wsdlFactory ); return wsdlInterface; } else { return null; } // end if } // end method processCallbackAttribute
public Object removeModel(Object resolved, ProcessorContext context) { WSDLDefinition definition = (WSDLDefinition)resolved; List<WSDLDefinition> list = map.get(definition.getNamespace()); if (list == null) { return null; } else { return list.remove(definition); } }
/** * Resolve a reference to a WSDL, given by a namespace and a location * @param wsdlLocation - a string containing the WSDL location * @param wsdlNamespace - a string containing the WSDL namespace * @param resolver - a model resolver * @param context * @return - a WSDLDefinition object for the referenced WSDL, or null if the WSDL cannot be resolved */ private WSDLDefinition resolveWSDLDefinition( String wsdlLocation, String wsdlNamespace, ModelResolver resolver, ProcessorContext context ) { // Resolve the WSDL definition WSDLDefinition proxy = wsdlFactory.createWSDLDefinition(); proxy.setUnresolved(true); proxy.setNamespace(wsdlNamespace); if (wsdlLocation != null) { proxy.setLocation(URI.create(wsdlLocation)); } WSDLDefinition resolved = resolver.resolveModel(WSDLDefinition.class, proxy, context); if (resolved != null && !resolved.isUnresolved()) { return resolved; } else { error(context.getMonitor(), "CannotResolveWSDLReference", resolver, wsdlLocation, wsdlNamespace); return null; } // end if } // end resolveWSDLDefinition
/** * Return the WSDL Definition for a given PortType * @param portTypeName - the QName of the PortType */ public Definition getDefinitionForPortType( QName portTypeName ) { //System.out.println("getDefinitionForPortType called for portType: " + portTypeName ); // Find the named PortType in the list of WSDL interfaces associated with this BPEL Process Collection<WSDLInterface> theInterfaces = implementation.getProcessDefinition().getInterfaces(); for( WSDLInterface wsdlInterface : theInterfaces ) { if ( wsdlInterface.getPortType().getQName().equals( portTypeName ) ) { // Extract and return the Definition associated with the WSDLDefinition... return wsdlInterface.getWsdlDefinition().getDefinition(); } // end if } // end for return null; } // end getDefinitionforPortType
Monitor monitor) { WSDLInterfaceContract wsdlContract = wsdlFactory.createWSDLInterfaceContract(); documentBuilderFactory, monitor); wsdlContract.setInterface(wsdlInterface); documentBuilderFactory, monitor); wsdlContract.setCallbackInterface(wsdlInterface);
error(monitor, "InvalidWSDLInterfaceAttr", wsdlFactory, uri); error(monitor, "InvalidWSDLInterfaceAttr", wsdlFactory, uri); return null; wsdlInterface = wsdlFactory.createWSDLInterface(); wsdlInterface.setUnresolved(true); wsdlInterface.setName(new QName(namespace, porttype));
private static void addSchemas(WSDLDefinition wsdlDef, AxisService axisService) { for (XSDefinition xsDef : wsdlDef.getXmlSchemas()) { if (xsDef.getSchema() != null) { axisService.addSchema(xsDef.getSchema()); updateSchemaRefs(xsDef.getSchema(), axisService.getName()); } } for (WSDLDefinition impDef : wsdlDef.getImportedDefinitions()) { addSchemas(impDef, axisService); } }
public void write(WSDLInterfaceContract wsdlInterfaceContract, XMLStreamWriter writer, ProcessorContext context) throws ContributionWriteException, XMLStreamException { // Write an <interface.wsdl> writer.writeStartElement(WSDLConstants.SCA11_NS, INTERFACE_WSDL); // Write interface name WSDLInterface wsdlInterface = (WSDLInterface)wsdlInterfaceContract.getInterface(); if (wsdlInterface != null) { QName qname = wsdlInterface.getName(); String uri = qname.getNamespaceURI() + "#wsdl.interface(" + qname.getLocalPart() + ")"; writer.writeAttribute(INTERFACE, uri); } WSDLInterface wsdlCallbackInterface = (WSDLInterface)wsdlInterfaceContract.getCallbackInterface(); if (wsdlCallbackInterface != null) { QName qname = wsdlCallbackInterface.getName(); String uri = qname.getNamespaceURI() + "#wsdl.interface(" + qname.getLocalPart() + ")"; writer.writeAttribute(CALLBACK_INTERFACE, uri); } // Write location if (wsdlInterfaceContract.getLocation() != null) { writer.writeAttribute(WSDLI_NS, WSDL_LOCATION, wsdlInterfaceContract.getLocation()); } policyProcessor.writePolicyAttributes(wsdlInterface, writer); writer.writeEndElement(); }
public WSDLDefinition read(URL contributionURL, URI artifactURI, URL artifactURL, ProcessorContext context) throws ContributionReadException { try { WSDLDefinition definition = indexRead(artifactURL); definition.setURI(artifactURI); return definition; } catch (Exception e) { ContributionReadException ce = new ContributionReadException(e); error(context.getMonitor(), "ContributionReadException", artifactURL, ce); //throw ce; return null; } }
public WSDLDefinition getUserSpecifiedWSDLDefinition() { if (userSpecifiedWSDLDefinition == null) { Interface iface = bindingInterfaceContract.getInterface(); if (iface instanceof WSDLInterface) { userSpecifiedWSDLDefinition = ((WSDLInterface)iface).getWsdlDefinition(); } } return userSpecifiedWSDLDefinition; }
public Binding getBinding() { if (binding == null) { if (getUserSpecifiedWSDLDefinition() != null && userSpecifiedWSDLDefinition.getBinding() != null) { binding = userSpecifiedWSDLDefinition.getBinding(); determineWSDLCharacteristics(); } } return binding; }
Monitor monitor) { WSDLInterfaceContract wsdlContract = wsdlFactory.createWSDLInterfaceContract(); documentBuilderFactory, monitor); wsdlContract.setInterface(wsdlInterface); documentBuilderFactory, monitor); wsdlContract.setCallbackInterface(wsdlInterface);
/** * Process an extension @callback attribute on a WSDL portType declaration * - the callback attribute must contain the QName of another portType * @param portType the portType * @return */ private WSDLInterface processCallbackAttribute( PortType portType, ModelResolver resolver, Monitor monitor ) { Object o = portType.getExtensionAttribute(CALLBACK_ATTRIBUTE); if(o != null && o instanceof QName) { WSDLInterface wsdlInterface = wsdlFactory.createWSDLInterface(); wsdlInterface.setUnresolved(true); wsdlInterface.setName( (QName)o ); wsdlInterface = WSDLInterfaceProcessor.resolveWSDLInterface( wsdlInterface, resolver, monitor, wsdlFactory ); return wsdlInterface; } else { return null; } // end if } // end method processCallbackAttribute
public void introspectPortType(WSDLInterface wsdlInterface, PortType portType, WSDLDefinition wsdlDefinition, ModelResolver resolver, Monitor monitor) throws InvalidWSDLException { processIntents(wsdlInterface, portType); WSDLInterface callback = processCallbackAttribute( portType, resolver, monitor ); wsdlInterface.setPortType(portType); wsdlInterface.setCallbackInterface(callback); wsdlInterface.getOperations().addAll(introspectOperations(portType, wsdlDefinition, resolver, monitor)); }
public void write(WSDLInterfaceContract wsdlInterfaceContract, XMLStreamWriter writer, ProcessorContext context) throws ContributionWriteException, XMLStreamException { // Write an <interface.wsdl> writer.writeStartElement(WSDLConstants.SCA11_NS, INTERFACE_WSDL); // Write interface name WSDLInterface wsdlInterface = (WSDLInterface)wsdlInterfaceContract.getInterface(); if (wsdlInterface != null) { QName qname = wsdlInterface.getName(); String uri = qname.getNamespaceURI() + "#wsdl.interface(" + qname.getLocalPart() + ")"; writer.writeAttribute(INTERFACE, uri); } WSDLInterface wsdlCallbackInterface = (WSDLInterface)wsdlInterfaceContract.getCallbackInterface(); if (wsdlCallbackInterface != null) { QName qname = wsdlCallbackInterface.getName(); String uri = qname.getNamespaceURI() + "#wsdl.interface(" + qname.getLocalPart() + ")"; writer.writeAttribute(CALLBACK_INTERFACE, uri); } // Write location if (wsdlInterfaceContract.getLocation() != null) { writer.writeAttribute(WSDLI_NS, WSDL_LOCATION, wsdlInterfaceContract.getLocation()); } policyProcessor.writePolicyAttributes(wsdlInterface, writer); writer.writeEndElement(); }
public WSDLDefinition read(URL contributionURL, URI artifactURI, URL artifactURL, ProcessorContext context) throws ContributionReadException { try { WSDLDefinition definition = indexRead(artifactURL); definition.setURI(artifactURI); return definition; } catch (Exception e) { ContributionReadException ce = new ContributionReadException(e); error(context.getMonitor(), "ContributionReadException", artifactURL, ce); //throw ce; return null; } }
public WSDLDefinition getUserSpecifiedWSDLDefinition() { if (userSpecifiedWSDLDefinition == null) { Interface iface = bindingInterfaceContract.getInterface(); if (iface instanceof WSDLInterface) { userSpecifiedWSDLDefinition = ((WSDLInterface)iface).getWsdlDefinition(); } } return userSpecifiedWSDLDefinition; }
public Binding getBinding() { if (binding == null) { if (getUserSpecifiedWSDLDefinition() != null && userSpecifiedWSDLDefinition.getBinding() != null) { binding = userSpecifiedWSDLDefinition.getBinding(); determineWSDLCharacteristics(); } } return binding; }
public Object removeModel(Object resolved, ProcessorContext context) { WSDLDefinition definition = (WSDLDefinition)resolved; List<WSDLDefinition> list = map.get(definition.getNamespace()); if (list == null) { return null; } else { return list.remove(definition); } }