FaqWSDLExternalSchema

(Difference between revisions)
m
m
Line 1: Line 1:
__NOTOC__
__NOTOC__
-
==How to enable parsing of WSDL with an external schema?==
 
-
If an external schema is imported from a WSDL file when you create a web service client or test client you need to enable access to external schema. By default in JDK8, access is restricted. To enable access you need to modify the configuration files of the IDE and the GlassFish Server.  
+
If an external schema is imported from a WSDL file when you create a web service client or test client you need to enable access to external schema. JAXP 1.5 specifies that access is restricted by default. JAXP 1.5 is included with JDK8 (JAXP 1.5 was added to the JDK JDK7u40).  
When access is not enabled you might see a message similar to the following when attempting to create a web service client or test client.
When access is not enabled you might see a message similar to the following when attempting to create a web service client or test client.
Line 9: Line 8:
For additional details, see [http://docs.oracle.com/javase/7/docs/api/javax/xml/XMLConstants.html#ACCESS_EXTERNAL_SCHEMA ACCESS_EXTERNAL_SCHEMA] and [http://docs.oracle.com/javase/tutorial/jaxp/properties/scope.html Scope and Order of JAXP Properties].
For additional details, see [http://docs.oracle.com/javase/7/docs/api/javax/xml/XMLConstants.html#ACCESS_EXTERNAL_SCHEMA ACCESS_EXTERNAL_SCHEMA] and [http://docs.oracle.com/javase/tutorial/jaxp/properties/scope.html Scope and Order of JAXP Properties].
-
===Enabling access in the IDE===
+
==How to enable parsing of WSDL with an external schema?==
 +
 
 +
To enable access you need to modify the configuration files of the IDE and the GlassFish Server.
 +
 
 +
===Enabling access in the IDE (Ant)===
 +
For Ant-based projects, you can modify the IDE configuration file to enable the IDE to access external schema.
 +
 
The Web Service Client wizard in the IDE parses the WSDL file when generating a web service client from a web service or WSDL file. You need to modify the IDE configuration file (<code>netbeans.conf</code>) to add the following switch to the <code>netbeans_default_options</code>. You will need to restart the IDE for the change to take effect.  
The Web Service Client wizard in the IDE parses the WSDL file when generating a web service client from a web service or WSDL file. You need to modify the IDE configuration file (<code>netbeans.conf</code>) to add the following switch to the <code>netbeans_default_options</code>. You will need to restart the IDE for the change to take effect.  
     <pre class="examplecode">-J-Djavax.xml.accessExternalSchema=all</pre>
     <pre class="examplecode">-J-Djavax.xml.accessExternalSchema=all</pre>
      
      
For more about locating and modifying the <code>netbeans.conf</code> configuration file, see [[FaqNetbeansConf]].
For more about locating and modifying the <code>netbeans.conf</code> configuration file, see [[FaqNetbeansConf]].
 +
 +
===Enabling access in the IDE (Ant)===
===Enabling access on GlassFish===
===Enabling access on GlassFish===

Revision as of 08:11, 1 July 2014


If an external schema is imported from a WSDL file when you create a web service client or test client you need to enable access to external schema. JAXP 1.5 specifies that access is restricted by default. JAXP 1.5 is included with JDK8 (JAXP 1.5 was added to the JDK JDK7u40).

When access is not enabled you might see a message similar to the following when attempting to create a web service client or test client.

schema_reference: Failed to read schema document 'xjc.xsd', because 'file' access is not allowed due to restriction set by the accessExternalSchema property.

For additional details, see ACCESS_EXTERNAL_SCHEMA and Scope and Order of JAXP Properties.

How to enable parsing of WSDL with an external schema?

To enable access you need to modify the configuration files of the IDE and the GlassFish Server.

Enabling access in the IDE (Ant)

For Ant-based projects, you can modify the IDE configuration file to enable the IDE to access external schema.

The Web Service Client wizard in the IDE parses the WSDL file when generating a web service client from a web service or WSDL file. You need to modify the IDE configuration file (netbeans.conf) to add the following switch to the netbeans_default_options. You will need to restart the IDE for the change to take effect.

-J-Djavax.xml.accessExternalSchema=all

For more about locating and modifying the netbeans.conf configuration file, see FaqNetbeansConf.

Enabling access in the IDE (Ant)

Enabling access on GlassFish

When deploying to GlassFish you need to enable access to external schema to generate a test client for a web service. To enable access you need to modify the configuration file of the GlassFish Server (GLASSFISH_INSTALL/glassfish/domains/domain1/config/domain.xml) and add the following JVM option element. You will need to restart the server for the change to take effect.

</java-config>
  ...
  <jvm-options>-Djavax.xml.accessExternalSchema=all</jvm-options>
</java-config>

Applies to: NetBeans IDE 7.4, 8.0

Platforms: All


Links

Not logged in. Log in, Register

By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2012, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo