You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by tellmejeff <je...@premierinc.com> on 2008/09/12 19:43:53 UTC

schemaLocation in jax-rs

Hi! I'm trying to configure a web service such that in the XML that is
generated, it will include a schemaLocation attribute in the xml header. To
clarify, this is the XML that is currently being generated:

<ns3:contractList xmlns:ns2="urn:contentList" 
   xmlns:ns3="urn:contractList">
  <ns2:header>
    <ns2:count>47</ns2:count>
    <ns2:asOf>2008-09-12T13:35:51.585-04:00</ns2:asOf>
     ... 
 </ns2:header>
 <ns2:items>
  <contentCategory>
   <id>a03ad0c9-79da-4ca4-8f90-3f9023d6dc6b</id>
   <name>Medical-Surgical_Service_Lines</name>
   <description>Medical-Surgical Service Lines</description>
  </contentCategory>
     ...
 </ns2:items>
</ns3:contractList> 

I would like it to add a schema location item:

<ns3:contractList xmlns:ns2="urn:contentList" 
   xmlns:ns3="urn:contractList"
   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
   xsi:schemaLocation="
	urn:contentList
        http://someplace.com/schemas/contentList.xsd
        urn:contractList
        http://someplace.com/schemas/contractList.xsd">
  <ns2:header>
    <ns2:count>47</ns2:count>
    <ns2:asOf>2008-09-12T13:35:51.585-04:00</ns2:asOf>
     ... 
 </ns2:header>
 <ns2:items>
  <contentCategory>
   <id>a03ad0c9-79da-4ca4-8f90-3f9023d6dc6b</id>
   <name>Medical-Surgical_Service_Lines</name>
   <description>Medical-Surgical Service Lines</description>
  </contentCategory>

I'm using JAX-RS as my front end and JAXB as my data binding. I see that if
I was using JAX-WS there is a way to pass properties to the JAXB Marshaller,
and there is a jaxb.schemaLocation parameter that I could use, but I don't
see such a thing for JAX-RS. Has anyone tackled this problem before?

Thanks!
-jp
-- 
View this message in context: http://www.nabble.com/schemaLocation-in-jax-rs-tp19460894p19460894.html
Sent from the cxf-user mailing list archive at Nabble.com.


RE: schemaLocation in jax-rs

Posted by "Poore, Jeffrey" <Je...@PremierInc.com>.
Cool. It isn't urgent, but it would be a nice to have. I assume this
would be the schemaLocation property and there would be a way to get
that property from the Spring configuration? 

Thanks!
-jp


---------------------------------------
Jeffrey Poore, Software Consultant
Jamberry Consulting, Inc.
jeffrey@jamberryconsulting.com
jeffrey_poore@premierinc.com 
704.526.716

Premier, Inc., 
2320 Cascade Pointe Blvd
Charlotte, NC 28208

-----Original Message-----
From: Sergey Beryozkin [mailto:sergey.beryozkin@iona.com] 
Sent: Monday, September 15, 2008 12:10 PM
To: users@cxf.apache.org
Subject: Re: schemaLocation in jax-rs

Hi

A minor update needs to be applied AbstractJAXBProvider :
setProperties(Map<String, String>) resource method has to be added and
this Map instance will need to be passed in to the JAXBContext factory
methods.
I'll try to fix it along with few other pending JAX-RS issues shortly.
If you need it urgently then just copy&paste the existing
JAXBElementProvider and update the code accordingly.
This provider will then need to be registered...

Cheers, Sergey



>
> Hi! I'm trying to configure a web service such that in the XML that is

> generated, it will include a schemaLocation attribute in the xml 
> header. To clarify, this is the XML that is currently being generated:
>
> <ns3:contractList xmlns:ns2="urn:contentList"
>   xmlns:ns3="urn:contractList">
>  <ns2:header>
>    <ns2:count>47</ns2:count>
>    <ns2:asOf>2008-09-12T13:35:51.585-04:00</ns2:asOf>
>     ...
> </ns2:header>
> <ns2:items>
>  <contentCategory>
>   <id>a03ad0c9-79da-4ca4-8f90-3f9023d6dc6b</id>
>   <name>Medical-Surgical_Service_Lines</name>
>   <description>Medical-Surgical Service Lines</description>  
> </contentCategory>
>     ...
> </ns2:items>
> </ns3:contractList>
>
> I would like it to add a schema location item:
>
> <ns3:contractList xmlns:ns2="urn:contentList"
>   xmlns:ns3="urn:contractList"
>   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>   xsi:schemaLocation="
> urn:contentList
>        http://someplace.com/schemas/contentList.xsd
>        urn:contractList
>        http://someplace.com/schemas/contractList.xsd">
>  <ns2:header>
>    <ns2:count>47</ns2:count>
>    <ns2:asOf>2008-09-12T13:35:51.585-04:00</ns2:asOf>
>     ...
> </ns2:header>
> <ns2:items>
>  <contentCategory>
>   <id>a03ad0c9-79da-4ca4-8f90-3f9023d6dc6b</id>
>   <name>Medical-Surgical_Service_Lines</name>
>   <description>Medical-Surgical Service Lines</description>  
> </contentCategory>
>
> I'm using JAX-RS as my front end and JAXB as my data binding. I see 
> that if I was using JAX-WS there is a way to pass properties to the 
> JAXB Marshaller, and there is a jaxb.schemaLocation parameter that I 
> could use, but I don't see such a thing for JAX-RS. Has anyone tackled
this problem before?
>
> Thanks!
> -jp
> --
> View this message in context: 
> http://www.nabble.com/schemaLocation-in-jax-rs-tp19460894p19460894.htm
> l Sent from the cxf-user mailing list archive at Nabble.com.

----------------------------
IONA Technologies PLC (registered in Ireland) Registered Number: 171387
Registered Address: The IONA Building, Shelbourne Road, Dublin 4,
Ireland
-----------------------------------------
***Note:The information contained in this message may be privileged
and confidential and protected from disclosure. If the reader of
this message is not the intended recipient, or an employee or agent
responsible for delivering this message to the intended recipient,
you are hereby notified that any dissemination, distribution or
copying of this communication is strictly prohibited.  If you have
received this communication in error, please notify the Sender
immediately by replying to the message and deleting it from your
computer.  Thank you.  Premier Inc.

Re: schemaLocation in jax-rs

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

A minor update needs to be applied AbstractJAXBProvider : setProperties(Map<String, String>) resource method has to be added and 
this Map instance will need to be passed in to the JAXBContext factory methods.
I'll try to fix it along with few other pending JAX-RS issues shortly.
If you need it urgently then just copy&paste the existing JAXBElementProvider and update the code accordingly.
This provider will then need to be registered...

Cheers, Sergey



>
> Hi! I'm trying to configure a web service such that in the XML that is
> generated, it will include a schemaLocation attribute in the xml header. To
> clarify, this is the XML that is currently being generated:
>
> <ns3:contractList xmlns:ns2="urn:contentList"
>   xmlns:ns3="urn:contractList">
>  <ns2:header>
>    <ns2:count>47</ns2:count>
>    <ns2:asOf>2008-09-12T13:35:51.585-04:00</ns2:asOf>
>     ...
> </ns2:header>
> <ns2:items>
>  <contentCategory>
>   <id>a03ad0c9-79da-4ca4-8f90-3f9023d6dc6b</id>
>   <name>Medical-Surgical_Service_Lines</name>
>   <description>Medical-Surgical Service Lines</description>
>  </contentCategory>
>     ...
> </ns2:items>
> </ns3:contractList>
>
> I would like it to add a schema location item:
>
> <ns3:contractList xmlns:ns2="urn:contentList"
>   xmlns:ns3="urn:contractList"
>   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>   xsi:schemaLocation="
> urn:contentList
>        http://someplace.com/schemas/contentList.xsd
>        urn:contractList
>        http://someplace.com/schemas/contractList.xsd">
>  <ns2:header>
>    <ns2:count>47</ns2:count>
>    <ns2:asOf>2008-09-12T13:35:51.585-04:00</ns2:asOf>
>     ...
> </ns2:header>
> <ns2:items>
>  <contentCategory>
>   <id>a03ad0c9-79da-4ca4-8f90-3f9023d6dc6b</id>
>   <name>Medical-Surgical_Service_Lines</name>
>   <description>Medical-Surgical Service Lines</description>
>  </contentCategory>
>
> I'm using JAX-RS as my front end and JAXB as my data binding. I see that if
> I was using JAX-WS there is a way to pass properties to the JAXB Marshaller,
> and there is a jaxb.schemaLocation parameter that I could use, but I don't
> see such a thing for JAX-RS. Has anyone tackled this problem before?
>
> Thanks!
> -jp
> -- 
> View this message in context: http://www.nabble.com/schemaLocation-in-jax-rs-tp19460894p19460894.html
> Sent from the cxf-user mailing list archive at Nabble.com.

----------------------------
IONA Technologies PLC (registered in Ireland)
Registered Number: 171387
Registered Address: The IONA Building, Shelbourne Road, Dublin 4, Ireland