You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by Christopher Moesel <Ch...@avid.com> on 2007/04/16 14:50:38 UTC

Importing XSDs in a WSDL

Hello,

I would prefer to keep my schema types in a separate XSD file rather
than define them inside the WSDL file.  So, I use an xsd:import to
accomplish this.

This appears to work well in CXF with one exception:
When I view the wsdl at
http://localhost:8080/myapp/services/MyService?wsdl the import doesn't
resolve correctly, since it is a relative import.

I want to avoid using an absolute address for the import, since this
will be deployed on several different servers.  I suppose I could use
"../MyService.xsd" as a relative address, but then that affects my
project's file structure so that I can't have the XSD and WSDL in the
same directory.

Any ideas or work-arounds?

Thanks,
Chris

RE: Importing XSDs in a WSDL

Posted by Christopher Moesel <Ch...@avid.com>.
Hi James,

Thanks for the reply.  I'm sorry-- when I said it works with CXF "with
one exception", I meant "exception" in the literal, plain English sense
of the word-- as in "it works in CXF except for this one thing..."

Sorry for the confusion.  It sounds like Dan Kulp is aware of the
"restriction" I'm referring to and is planning on resolving it-- so I'll
assume it's on the roadmap for now.

Thanks!
Chris

-----Original Message-----
From: James Mao [mailto:james.mao@iona.com] 
Sent: Monday, April 16, 2007 9:41 AM
To: cxf-user@incubator.apache.org
Subject: Re: Importing XSDs in a WSDL

Hi,

> Hello,
>
> I would prefer to keep my schema types in a separate XSD file rather
> than define them inside the WSDL file.  So, I use an xsd:import to
> accomplish this.
>
> This appears to work well in CXF with one exception:
> When I view the wsdl at
> http://localhost:8080/myapp/services/MyService?wsdl the import doesn't
> resolve correctly, since it is a relative import.
>   

Do you have the exception stacktrace? you start with WSDL or start with 
Java? when you say exception, is it runtime exception? or CodeGen
exception?

> I want to avoid using an absolute address for the import, since this
> will be deployed on several different servers.  I suppose I could use
> "../MyService.xsd" as a relative address, but then that affects my
> project's file structure so that I can't have the XSD and WSDL in the
> same directory.
>   

Is it possible to deploy the schema in just one place, e.g 
http://localhost:8080/myapp/schemas/yourschema, and define the url in 
the xsd:import?


If you feel that it's a bug, feel free to log an issue on [1], just 
provide more detail information.

[1] https://issues.apache.org/jira/browse/CXF
> Any ideas or work-arounds?
>
> Thanks,
> Chris
>
>   


Re: Importing XSDs in a WSDL

Posted by James Mao <ja...@iona.com>.
Hi,

> Hello,
>
> I would prefer to keep my schema types in a separate XSD file rather
> than define them inside the WSDL file.  So, I use an xsd:import to
> accomplish this.
>
> This appears to work well in CXF with one exception:
> When I view the wsdl at
> http://localhost:8080/myapp/services/MyService?wsdl the import doesn't
> resolve correctly, since it is a relative import.
>   

Do you have the exception stacktrace? you start with WSDL or start with 
Java? when you say exception, is it runtime exception? or CodeGen exception?

> I want to avoid using an absolute address for the import, since this
> will be deployed on several different servers.  I suppose I could use
> "../MyService.xsd" as a relative address, but then that affects my
> project's file structure so that I can't have the XSD and WSDL in the
> same directory.
>   

Is it possible to deploy the schema in just one place, e.g 
http://localhost:8080/myapp/schemas/yourschema, and define the url in 
the xsd:import?


If you feel that it's a bug, feel free to log an issue on [1], just 
provide more detail information.

[1] https://issues.apache.org/jira/browse/CXF
> Any ideas or work-arounds?
>
> Thanks,
> Chris
>
>   


Re: Importing XSDs in a WSDL

Posted by Daniel Kulp <dk...@apache.org>.
Sergey,

The JAX-WS spec MANDATES that the ?wsdl form MUST work.   Thus, we have 
to get that form working regardless of whatever other forms we think 
would be nice.

Dan

On Monday 16 April 2007 10:15, Sergey Beryozkin wrote:
> Hi
>
> IMHO the easiest strategy would be to support
> http://localhost:8080/myapp/services/MyService/wsdl queries,
>
> with ?wsdl the only way to serve relative imports is to overwrite
> importing entities to use absolute URLs.  '/wsdl' allows for the
> composability on the client side while giving the server two options :
> * overwrite the url (the only option with ?wsdl)
> * map MyService/wsdl to some folder keeping the imports or some query
> handler and let the client runtime compose the relative URL with the
> original one, most ones can do it easily. Assuming the wsdl retrieved
> from the http://localhost:8080/myapp/services/MyService/wsdl imports
> two more schemas using relative paths then the client can compose the
> paths like this
> http://localhost:8080/myapp/services/MyService/wsdl/imported.xsd
> http://localhost:8080/myapp/services/MyService/wsdl/bar/imported.xsd
>
> Inlining won't really work for wsdl imports due to different
> namespaces...
>
> What would be your opinion on /wsdl like queries as opposed to ?wsdl
> ones ?
>
> Cheers, Sergey
>
> ----- Original Message -----
> From: "Daniel Kulp" <dk...@apache.org>
> To: <cx...@incubator.apache.org>
> Cc: "Christopher Moesel" <Ch...@avid.com>
> Sent: Monday, April 16, 2007 2:50 PM
> Subject: Re: Importing XSDs in a WSDL
>
> > Just FYI:  this is a known "restriction" at this point.   However,
> > I'm going to be working on fixing it this week.   It is a big hold
> > up for some of the work I need done.
> >
> > Dan
> >
> > On Monday 16 April 2007 08:50, Christopher Moesel wrote:
> >> Hello,
> >>
> >> I would prefer to keep my schema types in a separate XSD file
> >> rather than define them inside the WSDL file.  So, I use an
> >> xsd:import to accomplish this.
> >>
> >> This appears to work well in CXF with one exception:
> >> When I view the wsdl at
> >> http://localhost:8080/myapp/services/MyService?wsdl the import
> >> doesn't resolve correctly, since it is a relative import.
> >>
> >> I want to avoid using an absolute address for the import, since
> >> this will be deployed on several different servers.  I suppose I
> >> could use "../MyService.xsd" as a relative address, but then that
> >> affects my project's file structure so that I can't have the XSD
> >> and WSDL in the same directory.
> >>
> >> Any ideas or work-arounds?
> >>
> >> Thanks,
> >> Chris
> >
> > --
> > J. Daniel Kulp
> > Principal Engineer
> > IONA
> > P: 781-902-8727    C: 508-380-7194
> > daniel.kulp@iona.com
> > http://www.dankulp.com/blog

-- 
J. Daniel Kulp
Principal Engineer
IONA
P: 781-902-8727    C: 508-380-7194
daniel.kulp@iona.com
http://www.dankulp.com/blog

Re: Importing XSDs in a WSDL

Posted by Sergey Beryozkin <se...@iona.com>.
Hi

IMHO the easiest strategy would be to support
http://localhost:8080/myapp/services/MyService/wsdl queries,

with ?wsdl the only way to serve relative imports is to overwrite importing entities to use absolute URLs.  '/wsdl' allows for the 
composability on the client side while giving the server two options :
* overwrite the url (the only option with ?wsdl)
* map MyService/wsdl to some folder keeping the imports or some query handler and let the client runtime compose the relative URL 
with the original one, most ones can do it easily. Assuming the wsdl retrieved from the 
http://localhost:8080/myapp/services/MyService/wsdl imports two more schemas using relative paths then the client can compose the 
paths like this
http://localhost:8080/myapp/services/MyService/wsdl/imported.xsd
http://localhost:8080/myapp/services/MyService/wsdl/bar/imported.xsd

Inlining won't really work for wsdl imports due to different namespaces...

What would be your opinion on /wsdl like queries as opposed to ?wsdl ones ?

Cheers, Sergey

----- Original Message ----- 
From: "Daniel Kulp" <dk...@apache.org>
To: <cx...@incubator.apache.org>
Cc: "Christopher Moesel" <Ch...@avid.com>
Sent: Monday, April 16, 2007 2:50 PM
Subject: Re: Importing XSDs in a WSDL


>
> Just FYI:  this is a known "restriction" at this point.   However, I'm
> going to be working on fixing it this week.   It is a big hold up for
> some of the work I need done.
>
> Dan
>
>
> On Monday 16 April 2007 08:50, Christopher Moesel wrote:
>> Hello,
>>
>> I would prefer to keep my schema types in a separate XSD file rather
>> than define them inside the WSDL file.  So, I use an xsd:import to
>> accomplish this.
>>
>> This appears to work well in CXF with one exception:
>> When I view the wsdl at
>> http://localhost:8080/myapp/services/MyService?wsdl the import doesn't
>> resolve correctly, since it is a relative import.
>>
>> I want to avoid using an absolute address for the import, since this
>> will be deployed on several different servers.  I suppose I could use
>> "../MyService.xsd" as a relative address, but then that affects my
>> project's file structure so that I can't have the XSD and WSDL in the
>> same directory.
>>
>> Any ideas or work-arounds?
>>
>> Thanks,
>> Chris
>
> -- 
> J. Daniel Kulp
> Principal Engineer
> IONA
> P: 781-902-8727    C: 508-380-7194
> daniel.kulp@iona.com
> http://www.dankulp.com/blog 


RE: Importing XSDs in a WSDL

Posted by Christopher Moesel <Ch...@avid.com>.
Hi Dan K,

I just noticed that you fixed this.  Thanks!  Now I can separate my WSDL
from my XSDs again!

-Chris

-----Original Message-----
From: Daniel Kulp [mailto:dkulp@apache.org] 
Sent: Monday, April 16, 2007 9:50 AM
To: cxf-user@incubator.apache.org
Cc: Christopher Moesel
Subject: Re: Importing XSDs in a WSDL


Just FYI:  this is a known "restriction" at this point.   However, I'm 
going to be working on fixing it this week.   It is a big hold up for 
some of the work I need done.

Dan


On Monday 16 April 2007 08:50, Christopher Moesel wrote:
> Hello,
>
> I would prefer to keep my schema types in a separate XSD file rather
> than define them inside the WSDL file.  So, I use an xsd:import to
> accomplish this.
>
> This appears to work well in CXF with one exception:
> When I view the wsdl at
> http://localhost:8080/myapp/services/MyService?wsdl the import doesn't
> resolve correctly, since it is a relative import.
>
> I want to avoid using an absolute address for the import, since this
> will be deployed on several different servers.  I suppose I could use
> "../MyService.xsd" as a relative address, but then that affects my
> project's file structure so that I can't have the XSD and WSDL in the
> same directory.
>
> Any ideas or work-arounds?
>
> Thanks,
> Chris

-- 
J. Daniel Kulp
Principal Engineer
IONA
P: 781-902-8727    C: 508-380-7194
daniel.kulp@iona.com
http://www.dankulp.com/blog

Re: Importing XSDs in a WSDL

Posted by Daniel Kulp <dk...@apache.org>.
Just FYI:  this is a known "restriction" at this point.   However, I'm 
going to be working on fixing it this week.   It is a big hold up for 
some of the work I need done.

Dan


On Monday 16 April 2007 08:50, Christopher Moesel wrote:
> Hello,
>
> I would prefer to keep my schema types in a separate XSD file rather
> than define them inside the WSDL file.  So, I use an xsd:import to
> accomplish this.
>
> This appears to work well in CXF with one exception:
> When I view the wsdl at
> http://localhost:8080/myapp/services/MyService?wsdl the import doesn't
> resolve correctly, since it is a relative import.
>
> I want to avoid using an absolute address for the import, since this
> will be deployed on several different servers.  I suppose I could use
> "../MyService.xsd" as a relative address, but then that affects my
> project's file structure so that I can't have the XSD and WSDL in the
> same directory.
>
> Any ideas or work-arounds?
>
> Thanks,
> Chris

-- 
J. Daniel Kulp
Principal Engineer
IONA
P: 781-902-8727    C: 508-380-7194
daniel.kulp@iona.com
http://www.dankulp.com/blog