|Using JET on WSDL and XSD [message #535281]
||Fri, 21 May 2010 19:59
| Herat Acharya
Registered: May 2010
I have a WSDL and its corresponding XSD.
I have to create a JET transformation project on it. While i know some amount of basics of Jet on XMLs , its tough to find a resource of JET on WSDLs on the net. Can any one point me to the correct resource so that i can learn this.
[Updated on: Fri, 21 May 2010 20:30]
Report message to a moderator
|Re: JET [message #535823 is a reply to message #535281]
||Tue, 25 May 2010 19:54
| Paul Elder
Registered: July 2009
If you have Web Tools installed, JET will automatically load a WSDL file
using the Web Tools WSDL EMF Model:
http://help.eclipse.org/galileo/index.jsp?topic=/org.eclipse .wst.wsdl.doc.isv/reference/api/org/eclipse/wst/wsdl/package -summary.html
You should also look at the EMF model for XSD's which is used by the
WSDL EMF Model:
The JET XPath engine can navigate these modesl much like any EMF-based
model. (EReference features are treated like XML child elements,
EAttribute features are treated like XML attributes.)
However, from experience, this model has methods that are not declared
in the Ecore meta-model for WSDL. As a result, some things that look
like they might be normal EMF features are invisible to the XPath
engine. To get at those, you'll have to drop into Java.
A WSDL file loads with a Service object at the root, so you could access
that object like this:
<c:setVariable var="service" select="/Service"/>
You can access things like QName in an XPath expression:
And, you can get the ports in an expression like:
<c:iterate select="$service/ePorts" var="port">
Some things, however, confuse the XPath engine. Service has a method
getDocumentationElement() which is defined in EMF as an EAttribute. So,
an XPath expression such as
tries to return the string value of the org.w3c.dom.Element object - I'm
not sure it does what you'd expect.
As a workaround, you can pick up the object in Java code...
<%-- assuming $service is an XPath variable refering to a Service object
Service service =
(Service)XPathContextExtender.getInstance(context).resolveAs Single( "$service");
You can then access the service variable the way you like in Java
scriptlets or expressions. Also, you could find appropriate objects that
JET can reflect on, and set JET variables for these:
<%-- assuming the above 'service' variable is defined in Java --%>
Then, JET tags can access $docElement in XPath expressions:
Although all of the above can seem painful, the WSDL EMF Model is worth
using. It does all the work to resolve XML schema elements/types.
Hope this helps,
On 2010-05-21 3:59 PM, Herat Acharya wrote:
> I have a WSDL and its corresponding XSD. I have to create a JET
> transformation project on it. While i know some amount of basics of Jet
> on XMLs , its tough to find a resource of JET on WSDLs on the net. Can
> any one point me to the correct resource so that i can learn this.
Powered by FUDForum
. Page generated in 0.04262 seconds