The WSDL validator, available in all WTP downloads, is located in plug-in org.eclipse.wst.wsdl.validation. The current version of the WSDL validator will only compile against Eclipse 3.2, WTP 1.5 and later. If you'd like to compile the validator with an older version of Eclipse or outside of Eclipse you should be able to by removing the package org.eclipse.wst.wsdl.validation.internal.eclipse, which contains all of the Eclipse and WTP dependencies. You may also have to make changes to the manifest if it causes you problems.

Corrections and additions to this page can be made by anyone with an Eclipse bugzilla account or can be reported [https://bugs.eclipse.org/bugs/enter_bug.cgi?product=Web%20Tools&product=Web%Tools&component=website&bug_file_loc=http://wiki.eclipse.org/index.php?title=Using_the_WSDL_Validator_Outside_of_Eclipse here].

+

+

== Requirements For WSDL Validation ==

+

+

The following are the list of libraries that must be on the classpath in order to call WSDL validation outside of Eclipse. (These libraries are already included when using WTP.)

+

+

* '''Apache Xerces (resolver.jar, xercesImpl.jar, xml-apis.jar)''' - The Xerces XML parser is required for schema validation and error location information. Xerces is bundled in the org.apache.xerces plug-in distributed with WTP, which can be obtained from the [http://download.eclipse.org/webtools/downloads/ WTP downloads page], or can be downloaded from the [http://xerces.apache.org Xerces website]. The WSDL validator has been tested and is known to work with Xerces 2.8.0.

+

+

* '''WSDL4J (qname.jar, wsdl4j.jar)''' - This lightweight WSDL model and parser are used for validation as a representation of a WSDL document tree. WSDL4J is bundled in the org.wsdl4j plug-in distributed with WTP, which can be obtained from the [http://download.eclipse.org/webtools/downloads/ WTP downloads page], or can be downloaded from the [http://sourceforge.net/projects/wsdl4j WSDL4J project page]. The WSDL validator requires WSDL4J 1.4 and is known NOT to work with later versions of WSDL4J.

+

+

* '''org.eclipse.wst.wsdl.validation_VERSION.jar''' - This is the WSDL validator plug-in, which can also be used standalone outside of Eclipse. The WSDL validator can be obtained from any WTP build on the [http://download.eclipse.org/webtools/downloads/ WTP downloads page].

+

+

* '''org.eclipse.wst.wsi_VERSION.jar''' (optional) - This is the WS-I extension for the WSDL validator, which contains validation logic for the WS-I BP 1.1, SSBP 1.0 and AP 1.0. The WS-I extension validator can be obtained from any WTP build on the [http://download.eclipse.org/webtools/downloads/ WTP downloads page].

== Validating WSDL Documents Programmatically ==

== Validating WSDL Documents Programmatically ==

−

The WSDL validator can be used programmatically both within and outside of Eclipse.

+

'''Note: As of WTP 1.5, the classes discussed in this section have not been declared as API and are therefore subject to change.

+

'''

+

+

The WSDL validator can be used programmatically both within and outside of Eclipse.

+

+

=== Prerequisite to using the WSDL validator programmatically ===

+

The WSDL validator has a prerequisite to validating WSDL 1.1 documents: It must be able to locate the WSDL 1.1 schemas ([http://schemas.xmlsoap.org/wsdl/ WSDL], [http://schemas.xmlsoap.org/wsdl/soap/ SOAP], [http://schemas.xmlsoap.org/wsdl/http/ HTTP], [http://schemas.xmlsoap.org/wsdl/mime/ MIME]). The WSDL validator provides the method

Using this method you can add a resolver to locate the schemas. The resolver can be as simple as a pointer to the local or remote location of the schemas or can be more complex such as the URI resolution framework included in WTP. An example URI resolver that wraps the WTP URI resolution framework and registers it with the WSDL validator can be seen [http://dev.eclipse.org/viewcvs/index.cgi/wst/components/wsdl/plugins/org.eclipse.wst.wsdl.validation/src/org/eclipse/wst/wsdl/validation/internal/eclipse/URIResolverWrapper.java?rev=HEAD&cvsroot=WebTools_Project&content-type=text/vnd.viewcvs-markup here].

The URI is actually a URL location representing the location of the document. The WSDL validator won't read from this location if an INPUTSTREAM is provided.<br/>

+

The INPUTSTREAM is an optional inputstream that represents the URI location.<br/>

+

The CONFIGURATION is a [http://dev.eclipse.org/viewcvs/index.cgi/wst/components/wsdl/plugins/org.eclipse.wst.wsdl.validation/src/org/eclipse/wst/wsdl/validation/internal/WSDLValidationConfiguration.java?rev=1.2&cvsroot=WebTools_Project&content-type=text/vnd.viewcvs-markup WSDLValidationConfiguration], which can be used to pass properties (see [[Using_the_WSDL_Validator_Outside_of_Eclipse#Configuring_the_WSDL_Validator|Configuring the WSDL Validator]] for more information about the properties) to the validator and extension validators.<br/>

+

The validator returns an [http://dev.eclipse.org/viewcvs/index.cgi/wst/components/wsdl/plugins/org.eclipse.wst.wsdl.validation/src/org/eclipse/wst/wsdl/validation/internal/IValidationReport.java?rev=1.1&cvsroot=WebTools_Project&content-type=text/vnd.viewcvs-markup IValidationReport] that contains validation messages (errors and warnings) produced during validation.

which allows you to register a validator for an extension WSDL 1.1 namespace. Validators for HTTP 1.1 GET and POST and SOAP 1.1 are already provided. When working outside of Eclipse you'll likely want to create a [http://dev.eclipse.org/viewcvs/index.cgi/wst/components/wsdl/plugins/org.eclipse.wst.wsdl.validation/src/org/eclipse/wst/wsdl/validation/internal/wsdl11/ClassloaderWSDL11ValidatorDelegate.java?revision=HEAD&cvsroot=WebTools_Project&content-type=text/vnd.viewcvs-markup ClassloaderWSDL11ValidatorDelegate] as follows:

which allows you to register a custom validator, such as the WS-I validator. The WS-I validator is already provided in WTP in the plug-in <code>org.eclipse.wst.wsi</code>. When working outside of Eclipse you'll likely want to create a [http://dev.eclipse.org/viewcvs/index.cgi/wst/components/wsdl/plugins/org.eclipse.wst.wsdl.validation/src/org/eclipse/wst/wsdl/validation/internal/ClassloaderWSDLValidatorDelegate.java?revision=HEAD&cvsroot=WebTools_Project&content-type=text/vnd.viewcvs-markup ClassloaderWSDLValidatorDelegate] as follows:

The WSDL validator can be configured using the [http://dev.eclipse.org/viewcvs/index.cgi/wst/components/wsdl/plugins/org.eclipse.wst.wsdl.validation/src/org/eclipse/wst/wsdl/validation/internal/WSDLValidationConfiguration.java?rev=HEAD&cvsroot=WebTools_Project&content-type=text/vnd.viewcvs-markup WSDLValidationConfiguration].

+

+

The WSDL validator currently accepts the following properties:

+

+

'''Note: As of WTP 1.5, the properties listed below have not been declared as API and are therefor subject to change.'''

+

+

=== WSDL validator properties ===

+

The properties listed below are those that can be set on the WSDL validator itself. Extension validator properties are listed under the section [[Using_the_WSDL_Validator_Outside_of_Eclipse#Other_properties|Other properties]].

This property allows you to set a cache to be used for XML processing of WSDL documents. The WSDL validator first processes and validates WSDL documents as XML documents. A cache can significantly reduce the processing time required to read and validate the XML representation of WSDL documents. This property must be set for an object of type [http://xerces.apache.org/xerces2-j/javadocs/xni/org/apache/xerces/xni/grammars/XMLGrammarPool.html org.apache.xerces.xni.grammars.XMLGrammarPool]. A sample XML grammar pool can be seen [http://xerces.apache.org/xerces2-j/javadocs/xerces2/org/apache/xerces/util/XMLGrammarPoolImpl.html here].

This property allows you to set a cache to be used for inline and external schemas. A cache can significantly reduce the processing time required to read and validate inline and external schemas. This property must be set for an object of type [http://xerces.apache.org/xerces2-j/javadocs/xni/org/apache/xerces/xni/grammars/XMLGrammarPool.html org.apache.xerces.xni.grammars.XMLGrammarPool]. A sample schema grammar pool can be seen [http://dev.eclipse.org/viewcvs/index.cgi/wst/components/wsdl/plugins/org.eclipse.wst.wsdl.validation/src/org/eclipse/wst/wsdl/validation/internal/eclipse/InlineSchemaModelGrammarPoolImpl.java?cvsroot=WebTools_Project&only_with_tag=MAIN here].

+

+

=== Other properties ===

+

The properties listed below are those that are known for extension WSDL validators. (Please add the properties for your extension validators below.)

This property for the WS-I extension WSDL validator allows you to set the compliance level of the basic profile and the simple soap binding profile. This property can be set to IGNORE to turn off this validation, SUGGEST to produce warnings for WS-I problems, or REQUIRE to produce errors for WS-I problems.

This property for the WS-I extension WSDL validator allows you to set the compliance level of the basic profile and the attachments profile. This property can be set to IGNORE to turn off this validation, SUGGEST to produce warnings for WS-I problems, or REQUIRE to produce errors for WS-I problems. Note, if this property is set the setting for the <nowiki>http://ws-i.org/profiles/Basic/ComplianceLevel</nowiki> property will be ignored.

+

+

== Additional Help ==

+

+

The WTP [http://www.eclipse.org/newsgroups/main.html#wtp newsgroup] is a great source of information and is open to the community.

The WSDL validator, available in all WTP downloads, is located in plug-in org.eclipse.wst.wsdl.validation. The current version of the WSDL validator will only compile against Eclipse 3.2, WTP 1.5 and later. If you'd like to compile the validator with an older version of Eclipse or outside of Eclipse you should be able to by removing the package org.eclipse.wst.wsdl.validation.internal.eclipse, which contains all of the Eclipse and WTP dependencies. You may also have to make changes to the manifest if it causes you problems.

Reporting Problems

Corrections and additions to this page can be made by anyone with an Eclipse bugzilla account or can be reported here.

Requirements For WSDL Validation

The following are the list of libraries that must be on the classpath in order to call WSDL validation outside of Eclipse. (These libraries are already included when using WTP.)

Apache Xerces (resolver.jar, xercesImpl.jar, xml-apis.jar) - The Xerces XML parser is required for schema validation and error location information. Xerces is bundled in the org.apache.xerces plug-in distributed with WTP, which can be obtained from the WTP downloads page, or can be downloaded from the Xerces website. The WSDL validator has been tested and is known to work with Xerces 2.8.0.

WSDL4J (qname.jar, wsdl4j.jar) - This lightweight WSDL model and parser are used for validation as a representation of a WSDL document tree. WSDL4J is bundled in the org.wsdl4j plug-in distributed with WTP, which can be obtained from the WTP downloads page, or can be downloaded from the WSDL4J project page. The WSDL validator requires WSDL4J 1.4 and is known NOT to work with later versions of WSDL4J.

org.eclipse.wst.wsdl.validation_VERSION.jar - This is the WSDL validator plug-in, which can also be used standalone outside of Eclipse. The WSDL validator can be obtained from any WTP build on the WTP downloads page.

org.eclipse.wst.wsi_VERSION.jar (optional) - This is the WS-I extension for the WSDL validator, which contains validation logic for the WS-I BP 1.1, SSBP 1.0 and AP 1.0. The WS-I extension validator can be obtained from any WTP build on the WTP downloads page.

Validating WSDL Documents Programmatically

Note: As of WTP 1.5, the classes discussed in this section have not been declared as API and are therefore subject to change.

The WSDL validator can be used programmatically both within and outside of Eclipse.

Prerequisite to using the WSDL validator programmatically

The WSDL validator has a prerequisite to validating WSDL 1.1 documents: It must be able to locate the WSDL 1.1 schemas (WSDL, SOAP, HTTP, MIME). The WSDL validator provides the method

public void addURIResolver(IExtensibleURIResolver uriResolver)

Using this method you can add a resolver to locate the schemas. The resolver can be as simple as a pointer to the local or remote location of the schemas or can be more complex such as the URI resolution framework included in WTP. An example URI resolver that wraps the WTP URI resolution framework and registers it with the WSDL validator can be seen here.

Invoking WSDL validation

The URI is actually a URL location representing the location of the document. The WSDL validator won't read from this location if an INPUTSTREAM is provided.
The INPUTSTREAM is an optional inputstream that represents the URI location.
The CONFIGURATION is a WSDLValidationConfiguration, which can be used to pass properties (see Configuring the WSDL Validator for more information about the properties) to the validator and extension validators.
The validator returns an IValidationReport that contains validation messages (errors and warnings) produced during validation.

Registering additional WSDL 1.1 validators

which allows you to register a validator for an extension WSDL 1.1 namespace. Validators for HTTP 1.1 GET and POST and SOAP 1.1 are already provided. When working outside of Eclipse you'll likely want to create a ClassloaderWSDL11ValidatorDelegate as follows:

Registering custom WSDL validators

which allows you to register a custom validator, such as the WS-I validator. The WS-I validator is already provided in WTP in the plug-in org.eclipse.wst.wsi. When working outside of Eclipse you'll likely want to create a ClassloaderWSDLValidatorDelegate as follows:

Validating WSDL Documents from the Command Line

Configuring the WSDL Validator

Note: As of WTP 1.5, the properties listed below have not been declared as API and are therefor subject to change.

WSDL validator properties

The properties listed below are those that can be set on the WSDL validator itself. Extension validator properties are listed under the section Other properties.

http://www.eclipse.org/webtools/wsdl/xmlcache

This property allows you to set a cache to be used for XML processing of WSDL documents. The WSDL validator first processes and validates WSDL documents as XML documents. A cache can significantly reduce the processing time required to read and validate the XML representation of WSDL documents. This property must be set for an object of type org.apache.xerces.xni.grammars.XMLGrammarPool. A sample XML grammar pool can be seen here.

http://www.eclipse.org/webtools/wsdl/schemacache

This property allows you to set a cache to be used for inline and external schemas. A cache can significantly reduce the processing time required to read and validate inline and external schemas. This property must be set for an object of type org.apache.xerces.xni.grammars.XMLGrammarPool. A sample schema grammar pool can be seen here.

Other properties

The properties listed below are those that are known for extension WSDL validators. (Please add the properties for your extension validators below.)

http://ws-i.org/profiles/Basic/ComplianceLevel

This property for the WS-I extension WSDL validator allows you to set the compliance level of the basic profile and the simple soap binding profile. This property can be set to IGNORE to turn off this validation, SUGGEST to produce warnings for WS-I problems, or REQUIRE to produce errors for WS-I problems.

http://ws-i.org/profiles/BasicWithAttachments/ComplianceLevel

This property for the WS-I extension WSDL validator allows you to set the compliance level of the basic profile and the attachments profile. This property can be set to IGNORE to turn off this validation, SUGGEST to produce warnings for WS-I problems, or REQUIRE to produce errors for WS-I problems. Note, if this property is set the setting for the http://ws-i.org/profiles/Basic/ComplianceLevel property will be ignored.

Additional Help

The WTP newsgroup is a great source of information and is open to the community.