Menu

plugins

redmitry

Extension mechanism

tinyWSDL supports standard WSDL 2.0 extensions defined in WSDL 2.0 Adjuncts (RPC, SOAP, HTTP).
Extensions are implemented through a Java 6 service-provider loading facility.
Using this mechanism it is easy to implement other than standard WSDL 2.0 extensions.

The extension class must implement an ExtensionAdapter interface

public class MyExtensionAdapter implements ExtensionAdapter<ElementExtensible> 

and register it as a service in
META-INF/services/org.inb.bsc.wsdl20.extensions.ExtensionAdapter
file by specifying the implementation adapter class:
org.inb.bsc.wsdl20.impl.ext.my.MyExtensionAdapter # My WSDL 2.0 Extension


The implementation class implements three methods:

public URI getElementExtensionURI()

returns a namespace that this extension belongs to (for instance "http://www.w3.org/ns/wsdl/soap")

public Element marshal(ElementExtensible extension) throws Exception
public ElementExtensible unmarshal(Element element) throws Exception

these methods implement actual marshalling/unmarshalling of DOM elements.

Because tinyWSDL intensively uses JAXB API it is also possible to use an abstract AbstractExtensionAdapter class.

public class MyExtensionAdapter extends AbstractExtensionAdapter

In this case instead of implementing marshalling/unmarshalling methods,

protected JAXBContext getJAXBContext() throws JAXBException

method must be implemented. This way marshalling/unmarshalling is done by JAXB and all extension elements must be annotated with JAXB annotations (take a look into SOAPExtensionAdapter class).


Related

Wiki: Home

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.