| Validate WSDL Ant Task [message #1065073] |
Mon, 24 June 2013 04:49  |
Jakob Braeuchi Messages: 69 Registered: July 2009 Location: Switzerland |
Member |
|
|
hi,
i have the following ant-script to validate a WSDL
<path id="validation.class.path">
<fileset dir="${eclipse.home}/plugins">
<include name="**/*.jar"/>
</fileset>
</path>
<taskdef name="wsdl.validate" classname="org.eclipse.wst.wsdl.validation.internal.ui.ant.WSDLValidate">
<classpath refid="validation.class.path" />
</taskdef>
<target name="validate.wsdl">
<property name="wsdl.file" value="${wsdl.name}" />
<echo message="Validate WSDL: ${wsdl.file}"/>
<wsdl.validate file="${wsdl.file}"/>
</target>
This ant script is called from a Buckminster Action.
When invoking the action i get this error:
[ant] ERROR 13:62:cvc-elt.1: Cannot find the declaration of element 'wsdl:definitions'.
When i validate the WSDL using Context Menu->Validate it works.
I also wrote a Buckminster Actor in Java to validate the WSDL using org.eclipse.wst.wsdl.validation.internal.eclipse.WSDLValidator .
Invoking this actor from an action also works.
What's wrong with the ant actor here ?
thanks
jakob
see http://www.eclipse.org/forums/index.php/t/489318/
|
|
|
|
| Re: Validate WSDL Ant Task [message #1065113 is a reply to message #1065101] |
Mon, 24 June 2013 08:17   |
Jakob Braeuchi Messages: 69 Registered: July 2009 Location: Switzerland |
Member |
|
|
hi thomas,
this is at the beginning of the WSDL:
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<wsdl:definitions xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
xmlns:tns="http://www.example.org/NewWSDLFile/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="NewWSDLFile"
targetNamespace="http://www.example.org/NewWSDLFile/">
...
additional hint:
when i was debugging my java-actor (started an eclipse within an eclipse) i also got the cvc-elt error. same happened when i was debugging the context-menu action.
after exporting the bundle containing the java-actor into the dropins-folder the WSDL validated fine.
jakob
[Updated on: Mon, 24 June 2013 08:29] Report message to a moderator
|
|
|
|
| Re: Validate WSDL Ant Task [message #1065136 is a reply to message #1065128] |
Mon, 24 June 2013 09:26   |
Jakob Braeuchi Messages: 69 Registered: July 2009 Location: Switzerland |
Member |
|
|
this is the output:
[start ch.rtc.jabas.esb.test.srv2.interfaces:osgi.bundle$1.0.0.qualifier#ws.validate.ant]
[ant] Validate WSDL: src/java/ch/rtc/jabas/esb/test/srv2/neutral/impl/NewWSDLFile.wsdl
[ant] ---------------------------------------
[ant] Validating file:///C:/Eclipse_Workspaces/Jabas_ESB/plugins/ch.rtc.jabas.esb.test.srv2.interfaces/src/java/ch/rtc/jabas/esb/test/srv2/neutral/impl/NewWSDLFile.wsdl - INVALID
[ant] ---------------------------------------
[ant] ERROR 5:56:cvc-elt.1: Cannot find the declaration of element 'wsdl:definitions'.
[ant]
[end ch.rtc.jabas.esb.test.srv2.interfaces:osgi.bundle$1.0.0.qualifier#ws.validate.ant]
"Validate WDSL" comes from my ANT-Actor, "Validating file" from the ANT-Task i suppose.
The file can be found. I slightly modified it (replaced "wsdl:definitions" with "Xwsdl:definitions"), then I get the following errors:
[start ch.rtc.jabas.esb.test.srv2.interfaces:osgi.bundle$1.0.0.qualifier#ws.validate.ant]
[ant] Validate WSDL: src/java/ch/rtc/jabas/esb/test/srv2/neutral/impl/NewWSDLFile.wsdl
[ant] ---------------------------------------
[ant] Validating file:///C:/Eclipse_Workspaces/Jabas_ESB/plugins/ch.rtc.jabas.esb.test.srv2.interfaces/src/java/ch/rtc/jabas/esb/test/srv2/neutral/impl/NewWSDLFile.wsdl - INVALID
[ant] ---------------------------------------
[ant] ERROR 5:56:The prefix "Xwsdl" for element "Xwsdl:definitions" is not bound.
[ant]
[end ch.rtc.jabas.esb.test.srv2.interfaces:osgi.bundle$1.0.0.qualifier#ws.validate.ant]
[Updated on: Mon, 24 June 2013 09:27] Report message to a moderator
|
|
|
|
|
| Re: Validate WSDL Ant Task [message #1065269 is a reply to message #1065164] |
Tue, 25 June 2013 04:03  |
Jakob Braeuchi Messages: 69 Registered: July 2009 Location: Switzerland |
Member |
|
|
hi thomas,
i can reproduce the problem with a plain ANT-script (no Buckminster involved). So I'll try to get an answer from WTP.
the idea was to validate the WSDL before generating the artifacts. This does not work because of the ANT problems; so I decided to force validation of the WSDL whenever it is saved with a builder defined in .project.
jakob
|
|
|
Powered by
FUDForum. Page generated in 0.02095 seconds