You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by "Wolf, Chris (IT)" <Ch...@morganstanley.com> on 2009/01/05 16:52:00 UTC
CXF query URL for schema-only?
I know there are several special query strings for WSDL and JavaScript,
i.e. :
http://host/service?wsdl
http://host/service?js
...but I thought there was also one for getting the schema part of the
WSDL, i.e. something like http://host/service?xsd (that doesn't work)
Is this true? What are all the special query URLs unserstod by JAX-WS
and/or CXF?
Thanks,
-Chris W.
--------------------------------------------------------
NOTICE: If received in error, please destroy and notify sender. Sender does not intend to waive confidentiality or privilege. Use of this email is prohibited when received in error.
RE: CXF query URL for schema-only?
Posted by "Wolf, Chris (IT)" <Ch...@morganstanley.com>.
Dan,
This time, looking at the protocol trace, I see the response sends
back the wsdl with the schema in-line via "Transfer-Encoding: chunked",
all in a single chunk. There was no separate request for the imported
schema.
I tried "?xsd" with the fully-qualified schemaLocation and that had the
same error. I'll try to find the original test case and/or look at the
source code.
Thanks,
-Chris W.
-----Original Message-----
From: Daniel Kulp [mailto:dkulp@apache.org]
Sent: Monday, January 05, 2009 3:00 PM
To: users@cxf.apache.org
Cc: Wolf, Chris (IT)
Subject: Re: CXF query URL for schema-only?
Do a get on the wsdl (?wsdl) and see what we output. Most likely, it
will
be something like:
http://localhost:8080/demo/services/demosvc?xsd=/var/tmp/demotypes.xsd
Basically, whatever you put in the schemaLocation is uses as the xsd
param.
Dan
On Monday 05 January 2009 2:56:09 pm Wolf, Chris (IT) wrote:
> Dan,
>
> I thought there was such a request technique. In the WSDL I'm dealing
> with, we have:
> <wsdl:definitions...
> <wsdl:types>
> <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
> targetNamespace="urn:com:msdw:xyz:demo"
> xmlns:tns="urn:com:msdw:xyz:demo"
> xmlns:types="urn:com:msdw:xyz:demo:types"
> elementFormDefault="unqualified"
> version="1.0">
> <xs:import namespace="urn:com:msdw:xyz:demo:types"
> schemaLocation="/var/tmp/demotypes.xsd"/>
> [...]
>
>
> ...but when I try to request the standalone schema, via:
>
> http://localhost:8080/demo/services/demosvc?xsd=demotypes.xsd
>
> ...I get the cxf servlet error:
>
> org.apache.cxf.transport.http.WSDLQueryException: Could not find xsd
> null
>
> org.apache.cxf.transport.http.WSDLQueryHandler.writeResponse(WSDLQuery
> Ha
> ndler.java:181)
>
> org.apache.cxf.transport.servlet.ServletController.invoke(ServletContr
> ol
> ler.java:147)
>
> org.apache.cxf.transport.servlet.AbstractCXFServlet.invoke(AbstractCXF
> Se
> rvlet.java:174)
>
> org.apache.cxf.transport.servlet.AbstractCXFServlet.doGet(AbstractCXFS
> er
> vlet.java:156)
> javax.servlet.http.HttpServlet.service(HttpServlet.java:690)
> javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
>
> Or did I misunderstand what you were suggesting with
"?xsd=MySchema.xsd"
> ?
>
> Thanks,
>
> -Chris W.
>
> -----Original Message-----
> From: Daniel Kulp [mailto:dkulp@apache.org]
> Sent: Monday, January 05, 2009 11:33 AM
> To: users@cxf.apache.org
> Cc: Wolf, Chris (IT)
> Subject: Re: CXF query URL for schema-only?
>
>
> In general, for wsdl we create on the fly, we embed the schema into
> the wsdl
> so there isn't any xsd separately available. It's one of those
things
> that
> we probably should provide a flag for somehow. The code supports
> putting
> each schema namespace into it's own file (see the -createxsdimports
> flag on java2ws), there just isn't a way to set it for wsdl's
> generated at runtime.
>
> For wsdl first cases, you can do "?xsd=MySchema.xsd" or whatever to
> get the named schemas that the wsdl imports.
>
> Dan
>
> On Monday 05 January 2009 10:52:00 am Wolf, Chris (IT) wrote:
> > I know there are several special query strings for WSDL and
> > JavaScript, i.e. :
> >
> > http://host/service?wsdl
> > http://host/service?js
> >
> > ...but I thought there was also one for getting the schema part of
> > the
> >
> > WSDL, i.e. something like http://host/service?xsd (that doesn't
> > work) Is this true? What are all the special query URLs unserstod
> > by JAX-WS
> >
> > and/or CXF?
> >
> > Thanks,
> >
> > -Chris W.
> > --------------------------------------------------------
> >
> > NOTICE: If received in error, please destroy and notify sender.
> > Sender
> >
> > does not intend to waive confidentiality or privilege. Use of this
> > email is prohibited when received in error.
>
> --
> Daniel Kulp
> dkulp@apache.org
> http://dankulp.com/blog
> --------------------------------------------------------
>
> NOTICE: If received in error, please destroy and notify sender. Sender
> does not intend to waive confidentiality or privilege. Use of this
> email is prohibited when received in error.
--
Daniel Kulp
dkulp@apache.org
http://dankulp.com/blog
--------------------------------------------------------
NOTICE: If received in error, please destroy and notify sender. Sender does not intend to waive confidentiality or privilege. Use of this email is prohibited when received in error.
Re: CXF query URL for schema-only?
Posted by Daniel Kulp <dk...@apache.org>.
Do a get on the wsdl (?wsdl) and see what we output. Most likely, it will
be something like:
http://localhost:8080/demo/services/demosvc?xsd=/var/tmp/demotypes.xsd
Basically, whatever you put in the schemaLocation is uses as the xsd param.
Dan
On Monday 05 January 2009 2:56:09 pm Wolf, Chris (IT) wrote:
> Dan,
>
> I thought there was such a request technique. In the WSDL I'm dealing
> with,
> we have:
> <wsdl:definitions...
> <wsdl:types>
> <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
> targetNamespace="urn:com:msdw:xyz:demo"
> xmlns:tns="urn:com:msdw:xyz:demo"
> xmlns:types="urn:com:msdw:xyz:demo:types"
> elementFormDefault="unqualified"
> version="1.0">
> <xs:import namespace="urn:com:msdw:xyz:demo:types"
> schemaLocation="/var/tmp/demotypes.xsd"/>
> [...]
>
>
> ...but when I try to request the standalone schema, via:
>
> http://localhost:8080/demo/services/demosvc?xsd=demotypes.xsd
>
> ...I get the cxf servlet error:
>
> org.apache.cxf.transport.http.WSDLQueryException: Could not find xsd
> null
>
> org.apache.cxf.transport.http.WSDLQueryHandler.writeResponse(WSDLQueryHa
> ndler.java:181)
>
> org.apache.cxf.transport.servlet.ServletController.invoke(ServletControl
> ler.java:147)
>
> org.apache.cxf.transport.servlet.AbstractCXFServlet.invoke(AbstractCXFSe
> rvlet.java:174)
>
> org.apache.cxf.transport.servlet.AbstractCXFServlet.doGet(AbstractCXFSer
> vlet.java:156)
> javax.servlet.http.HttpServlet.service(HttpServlet.java:690)
> javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
>
> Or did I misunderstand what you were suggesting with "?xsd=MySchema.xsd"
> ?
>
> Thanks,
>
> -Chris W.
>
> -----Original Message-----
> From: Daniel Kulp [mailto:dkulp@apache.org]
> Sent: Monday, January 05, 2009 11:33 AM
> To: users@cxf.apache.org
> Cc: Wolf, Chris (IT)
> Subject: Re: CXF query URL for schema-only?
>
>
> In general, for wsdl we create on the fly, we embed the schema into the
> wsdl
> so there isn't any xsd separately available. It's one of those things
> that
> we probably should provide a flag for somehow. The code supports
> putting
> each schema namespace into it's own file (see the -createxsdimports flag
> on java2ws), there just isn't a way to set it for wsdl's generated at
> runtime.
>
> For wsdl first cases, you can do "?xsd=MySchema.xsd" or whatever to get
> the named schemas that the wsdl imports.
>
> Dan
>
> On Monday 05 January 2009 10:52:00 am Wolf, Chris (IT) wrote:
> > I know there are several special query strings for WSDL and
> > JavaScript, i.e. :
> >
> > http://host/service?wsdl
> > http://host/service?js
> >
> > ...but I thought there was also one for getting the schema part of the
> >
> > WSDL, i.e. something like http://host/service?xsd (that doesn't work)
> > Is this true? What are all the special query URLs unserstod by JAX-WS
> >
> > and/or CXF?
> >
> > Thanks,
> >
> > -Chris W.
> > --------------------------------------------------------
> >
> > NOTICE: If received in error, please destroy and notify sender. Sender
> >
> > does not intend to waive confidentiality or privilege. Use of this
> > email is prohibited when received in error.
>
> --
> Daniel Kulp
> dkulp@apache.org
> http://dankulp.com/blog
> --------------------------------------------------------
>
> NOTICE: If received in error, please destroy and notify sender. Sender does
> not intend to waive confidentiality or privilege. Use of this email is
> prohibited when received in error.
--
Daniel Kulp
dkulp@apache.org
http://dankulp.com/blog
RE: CXF query URL for schema-only?
Posted by "Wolf, Chris (IT)" <Ch...@morganstanley.com>.
Dan,
I thought there was such a request technique. In the WSDL I'm dealing
with,
we have:
<wsdl:definitions...
<wsdl:types>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
targetNamespace="urn:com:msdw:xyz:demo"
xmlns:tns="urn:com:msdw:xyz:demo"
xmlns:types="urn:com:msdw:xyz:demo:types"
elementFormDefault="unqualified"
version="1.0">
<xs:import namespace="urn:com:msdw:xyz:demo:types"
schemaLocation="/var/tmp/demotypes.xsd"/>
[...]
...but when I try to request the standalone schema, via:
http://localhost:8080/demo/services/demosvc?xsd=demotypes.xsd
...I get the cxf servlet error:
org.apache.cxf.transport.http.WSDLQueryException: Could not find xsd
null
org.apache.cxf.transport.http.WSDLQueryHandler.writeResponse(WSDLQueryHa
ndler.java:181)
org.apache.cxf.transport.servlet.ServletController.invoke(ServletControl
ler.java:147)
org.apache.cxf.transport.servlet.AbstractCXFServlet.invoke(AbstractCXFSe
rvlet.java:174)
org.apache.cxf.transport.servlet.AbstractCXFServlet.doGet(AbstractCXFSer
vlet.java:156)
javax.servlet.http.HttpServlet.service(HttpServlet.java:690)
javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
Or did I misunderstand what you were suggesting with "?xsd=MySchema.xsd"
?
Thanks,
-Chris W.
-----Original Message-----
From: Daniel Kulp [mailto:dkulp@apache.org]
Sent: Monday, January 05, 2009 11:33 AM
To: users@cxf.apache.org
Cc: Wolf, Chris (IT)
Subject: Re: CXF query URL for schema-only?
In general, for wsdl we create on the fly, we embed the schema into the
wsdl
so there isn't any xsd separately available. It's one of those things
that
we probably should provide a flag for somehow. The code supports
putting
each schema namespace into it's own file (see the -createxsdimports flag
on java2ws), there just isn't a way to set it for wsdl's generated at
runtime.
For wsdl first cases, you can do "?xsd=MySchema.xsd" or whatever to get
the named schemas that the wsdl imports.
Dan
On Monday 05 January 2009 10:52:00 am Wolf, Chris (IT) wrote:
> I know there are several special query strings for WSDL and
> JavaScript, i.e. :
>
> http://host/service?wsdl
> http://host/service?js
>
> ...but I thought there was also one for getting the schema part of the
> WSDL, i.e. something like http://host/service?xsd (that doesn't work)
> Is this true? What are all the special query URLs unserstod by JAX-WS
> and/or CXF?
>
> Thanks,
>
> -Chris W.
> --------------------------------------------------------
>
> NOTICE: If received in error, please destroy and notify sender. Sender
> does not intend to waive confidentiality or privilege. Use of this
> email is prohibited when received in error.
--
Daniel Kulp
dkulp@apache.org
http://dankulp.com/blog
--------------------------------------------------------
NOTICE: If received in error, please destroy and notify sender. Sender does not intend to waive confidentiality or privilege. Use of this email is prohibited when received in error.
Re: CXF query URL for schema-only?
Posted by Daniel Kulp <dk...@apache.org>.
In general, for wsdl we create on the fly, we embed the schema into the wsdl
so there isn't any xsd separately available. It's one of those things that
we probably should provide a flag for somehow. The code supports putting
each schema namespace into it's own file (see the -createxsdimports flag on
java2ws), there just isn't a way to set it for wsdl's generated at runtime.
For wsdl first cases, you can do "?xsd=MySchema.xsd" or whatever to get the
named schemas that the wsdl imports.
Dan
On Monday 05 January 2009 10:52:00 am Wolf, Chris (IT) wrote:
> I know there are several special query strings for WSDL and JavaScript,
> i.e. :
>
> http://host/service?wsdl
> http://host/service?js
>
> ...but I thought there was also one for getting the schema part of the
> WSDL, i.e. something like http://host/service?xsd (that doesn't work)
> Is this true? What are all the special query URLs unserstod by JAX-WS
> and/or CXF?
>
> Thanks,
>
> -Chris W.
> --------------------------------------------------------
>
> NOTICE: If received in error, please destroy and notify sender. Sender does
> not intend to waive confidentiality or privilege. Use of this email is
> prohibited when received in error.
--
Daniel Kulp
dkulp@apache.org
http://dankulp.com/blog
RE: CXF query URL for schema-only?
Posted by "Wolf, Chris (IT)" <Ch...@morganstanley.com>.
Ian,
That's very interesting. As I replied to Glen, I thought I had recalled
the
behavior you mentioned by looking a protocol trace of a single HTTP-GET
of
a wsdl with imported schema. I suppose the case I was recollecting
was where the schema was in a different namespace then the wsdl.
I was hoping to be able to perform a standalone, schema-only request
via "?xsd" even if the imported schema was in the same namespace.
One issue we have with the dynamically assembled wsdl (via "?wsdl")
is that the schema section only contains types that are actually
referenced from the common schema import file, rather then whole
schema.
-Chris W.
-----Original Message-----
From: Ian Roberts [mailto:i.roberts@dcs.shef.ac.uk]
Sent: Monday, January 05, 2009 11:32 AM
To: users@cxf.apache.org
Subject: Re: CXF query URL for schema-only?
Wolf, Chris (IT) wrote:
> I know there are several special query strings for WSDL and
> JavaScript, i.e. :
>
> http://host/service?wsdl
> http://host/service?js
>
> ...but I thought there was also one for getting the schema part of the
> WSDL, i.e. something like http://host/service?xsd (that doesn't work)
CXF only does this when it has to in order to produce a complete and
well-defined WSDL. If you have JAXB objects in a different XML
namespace from your service then I believe CXF will create the ?wsdl
such that it imports one or more ?xsd schemas for the bits in the
different namespaces, but if everything is in one namespace then it's
all contained in the one ?wsdl and there's no need for imported ?xsd
documents. In any case, the schema or schemas you get from ?xsd will
not include any types whose namespace matches that of the WSDL, those
types will be defined inline.
Ian
--
Ian Roberts | Department of Computer Science
i.roberts@dcs.shef.ac.uk | University of Sheffield, UK
--------------------------------------------------------
NOTICE: If received in error, please destroy and notify sender. Sender does not intend to waive confidentiality or privilege. Use of this email is prohibited when received in error.
Re: CXF query URL for schema-only?
Posted by Ian Roberts <i....@dcs.shef.ac.uk>.
Wolf, Chris (IT) wrote:
> I know there are several special query strings for WSDL and JavaScript,
> i.e. :
>
> http://host/service?wsdl
> http://host/service?js
>
> ...but I thought there was also one for getting the schema part of the
> WSDL, i.e. something like http://host/service?xsd (that doesn't work)
CXF only does this when it has to in order to produce a complete and
well-defined WSDL. If you have JAXB objects in a different XML
namespace from your service then I believe CXF will create the ?wsdl
such that it imports one or more ?xsd schemas for the bits in the
different namespaces, but if everything is in one namespace then it's
all contained in the one ?wsdl and there's no need for imported ?xsd
documents. In any case, the schema or schemas you get from ?xsd will
not include any types whose namespace matches that of the WSDL, those
types will be defined inline.
Ian
--
Ian Roberts | Department of Computer Science
i.roberts@dcs.shef.ac.uk | University of Sheffield, UK
RE: CXF query URL for schema-only?
Posted by "Wolf, Chris (IT)" <Ch...@morganstanley.com>.
Glen,
I'm sure we can setup our schema's to be HTTP-GETable via static files,
but the reason I asked is that I thought I recalled seeing a single
"?wsdl" request actually coming across the wire as two separate
requests, one for the wsdl and one for the imported schema. It could
have been an older CXF code base.
-Chris W.
-----Original Message-----
From: Glen Mazza [mailto:glen.mazza@gmail.com]
Sent: Monday, January 05, 2009 11:05 AM
To: users@cxf.apache.org
Subject: Re: CXF query URL for schema-only?
JSR-224 defines the ?wsdl suffix--something all JAX-WS implementations
need to support. I don't think it defines any other suffix--a search of
that document on "?" might give you the answer.
If needed, your client can manually process the wsdl it downloads for
the specific parts (wsdl:types, wsdl:messages, etc.) that it cares
about.
Normally developers of SOAP clients don't need to get into that level of
detail. Note however, your WSDL can import multiple XSD's, so those
would need to be downloaded and parsed as well.
Glen
Wolf, Chris (IT) wrote:
>
> I know there are several special query strings for WSDL and
> JavaScript, i.e. :
>
> http://host/service?wsdl
> http://host/service?js
>
> ...but I thought there was also one for getting the schema part of the
> WSDL, i.e. something like http://host/service?xsd (that doesn't work)
> Is this true? What are all the special query URLs unserstod by JAX-WS
> and/or CXF?
>
> Thanks,
>
> -Chris W.
> --------------------------------------------------------
>
> NOTICE: If received in error, please destroy and notify sender. Sender
> does not intend to waive confidentiality or privilege. Use of this
> email is prohibited when received in error.
>
>
--
View this message in context:
http://www.nabble.com/CXF-query-URL-for-schema-only--tp21293483p21293719
.html
Sent from the cxf-user mailing list archive at Nabble.com.
--------------------------------------------------------
NOTICE: If received in error, please destroy and notify sender. Sender does not intend to waive confidentiality or privilege. Use of this email is prohibited when received in error.
Re: CXF query URL for schema-only?
Posted by Glen Mazza <gl...@gmail.com>.
JSR-224 defines the ?wsdl suffix--something all JAX-WS implementations need
to support. I don't think it defines any other suffix--a search of that
document on "?" might give you the answer.
If needed, your client can manually process the wsdl it downloads for the
specific parts (wsdl:types, wsdl:messages, etc.) that it cares about.
Normally developers of SOAP clients don't need to get into that level of
detail. Note however, your WSDL can import multiple XSD's, so those would
need to be downloaded and parsed as well.
Glen
Wolf, Chris (IT) wrote:
>
> I know there are several special query strings for WSDL and JavaScript,
> i.e. :
>
> http://host/service?wsdl
> http://host/service?js
>
> ...but I thought there was also one for getting the schema part of the
> WSDL, i.e. something like http://host/service?xsd (that doesn't work)
> Is this true? What are all the special query URLs unserstod by JAX-WS
> and/or CXF?
>
> Thanks,
>
> -Chris W.
> --------------------------------------------------------
>
> NOTICE: If received in error, please destroy and notify sender. Sender
> does not intend to waive confidentiality or privilege. Use of this email
> is prohibited when received in error.
>
>
--
View this message in context: http://www.nabble.com/CXF-query-URL-for-schema-only--tp21293483p21293719.html
Sent from the cxf-user mailing list archive at Nabble.com.