You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by Tony Dean <To...@sas.com> on 2008/01/04 16:26:58 UTC

wsdl/schema import

Hi,

I am importing a schema as follows:

<definitions ...>
   <types>
      <schema ...>
         <import namespace="some URI" schemaLocation="http://www.sas.com/testSchema.xsd/" />
...

This fails with error message: Unable to locate with a locator the schema referenced at '...' relative to document base 'meta-inf/mywsdl.wsdl.

It appears that the Axis2 wsdl processor can only reference schemas relative to the location of the wsdl itself.  If I change the import to:

         <import namespace="some URI" schemaLocation="testSchema.xsd" />

and add testSchema.xsd to meta-inf/ directory in the AAR, it works.


I checked WS-I Basic Profile 1.1 and didn't see any limitation on schemaLocation.  The XML Schema spec does say that this attribute is only a hint.  Is it possible to reference a schema that is not relative to the wsdl?  Is this an Axis2 shortfall or is this the way it works for all webservice stacks?

If you did support such an absolute reference, how would you specify credentials to access the testSchema.xsd if the example site: http://www.sas.com  was secured.  You wouldn't want to specify clear text credentials in the wsdl:
http://username:password@www.sas.com/testSchema.xsd.

FYI: You can't use a file URI either: file:///c:/testSchema.xsd.

I'm thinking that a referenced schema must be relative to the wsdl by design, but I couldn't find any verbage to back up my suspicion.

Anyone else have any thoughts.

Thanks.

Tony Dean
SAS Institute Inc.
919.531.6704
tony.dean@sas.com

SAS... The Power to Know
http://www.sas.com



---------------------------------------------------------------------
To unsubscribe, e-mail: axis-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-dev-help@ws.apache.org


RE: wsdl/schema import

Posted by Martin Gainty <mg...@hotmail.com>.
taking a quick look at the include spec at w3c
http://www.w3schools.com/schema/el_redefine.asp




<import
id=ID
namespace=anyURI
schemaLocation=anyURI
any attributes
>
 
where anyURI is defined in
http://java.sun.com/j2se/1.5.0/docs/api/java/net/URI.html
some examples would be 
An opaque URI is an absolute URI whose scheme-specific part does not begin with a slash character ('/'). Opaque URIs are not subject to further parsing. Some examples of opaque URIs are: 




mailto:java-net@java.sun.com 


news:comp.lang.java 


urn:isbn:096139210x
A hierarchical URI is either an absolute URI whose scheme-specific part begins with a slash character, or a relative URI, that is, a URI that does not specify a scheme. Some examples of hierarchical URIs are: 
http://java.sun.com/j2se/1.3/docs/guide/collections/designfaq.html#28../../../demo/jfc/SwingSet2/src/SwingSet2.javafile:///~/calendar 
A hierarchical URI is subject to further parsing according to the syntax 

[scheme:][//authority][path][?query][#fragment] 
 
(noting the absence of drive specifier c: where file:///AbsolutePathToXSDFile)Martin ______________________________________________Disclaimer and confidentiality noteEverything in this e-mail and any attachments relates to the official business of Sender. This transmission is of a confidential nature and Sender does not endorse distribution to any party other than intended recipient. Sender does not necessarily endorse content contained within this transmission.> From: Tony.Dean@sas.com> To: axis-dev@ws.apache.org; axis-user@ws.apache.org> Date: Fri, 4 Jan 2008 10:26:58 -0500> Subject: wsdl/schema import> > Hi,> > I am importing a schema as follows:> > <definitions ...>> <types>> <schema ...>> <import namespace="some URI" schemaLocation="http://www.sas.com/testSchema.xsd/" />> ...> > This fails with error message: Unable to locate with a locator the schema referenced at '...' relative to document base 'meta-inf/mywsdl.wsdl.> > It appears that the Axis2 wsdl processor can only reference schemas relative to the location of the wsdl itself. If I change the import to:> > <import namespace="some URI" schemaLocation="testSchema.xsd" />> > and add testSchema.xsd to meta-inf/ directory in the AAR, it works.> > > I checked WS-I Basic Profile 1.1 and didn't see any limitation on schemaLocation. The XML Schema spec does say that this attribute is only a hint. Is it possible to reference a schema that is not relative to the wsdl? Is this an Axis2 shortfall or is this the way it works for all webservice stacks?> > If you did support such an absolute reference, how would you specify credentials to access the testSchema.xsd if the example site: http://www.sas.com was secured. You wouldn't want to specify clear text credentials in the wsdl:> http://username:password@www.sas.com/testSchema.xsd.> > FYI: You can't use a file URI either: file:///c:/testSchema.xsd.> > I'm thinking that a referenced schema must be relative to the wsdl by design, but I couldn't find any verbage to back up my suspicion.> > Anyone else have any thoughts.> > Thanks.> > Tony Dean> SAS Institute Inc.> 919.531.6704> tony.dean@sas.com> > SAS... The Power to Know> http://www.sas.com> > > > ---------------------------------------------------------------------> To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org> For additional commands, e-mail: axis-user-help@ws.apache.org> 
_________________________________________________________________
Make distant family not so distant with Windows Vista® + Windows Live™.
http://www.microsoft.com/windows/digitallife/keepintouch.mspx?ocid=TXT_TAGLM_CPC_VideoChat_distantfamily_012008