cxf-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Alessandro Canevese (JIRA)" <j...@apache.org>
Subject [jira] [Updated] (CXF-5342) Letting to be absolute XSISchemaNamespace
Date Fri, 18 Oct 2013 07:31:43 GMT

     [ https://issues.apache.org/jira/browse/CXF-5342?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Alessandro Canevese updated CXF-5342:
-------------------------------------

    Description: 
Hi all. It's my first contribute to CXF. Maybe it has already been solved but I've not figured
out how to obtain it.
I need to have a xml produced with 
xsi:schemaLocation="john andrew".

I've tried @XSISchemaLocation("john andrew") but you know it's rendered http://blabla/john%20andrew.

I've tried to configure through the bean property schemaLocation in spring/cxf xml configuration
file (for a bean of class org.apache.cxf.jaxrs.provider.JAXBElementProvider<T>), but
I obtain that Spring fires an exception of operation not supported (maybe it would not work
anyway).

So, in the end, I've copied the class above and I made a class of my own changing the  addSchemaLocation
method as follows:

private void addSchemaLocation(Marshaller ms, Annotation[] anns)
        throws Exception
    {
        XSISchemaLocation sl = AnnotationUtils.getAnnotation(anns,
            XSISchemaLocation.class);
        if (sl != null)
        {
            log.debug("It would produce " + buildAbsoluteXMLResourceURI(sl.value()));

            //String value = buildAbsoluteXMLResourceURI(sl.value());

            log.debug("It produces instead" + sl.value());
 
           String value = sl.value();

            String propName = !sl.noNamespace() ? Marshaller.JAXB_SCHEMA_LOCATION
                : Marshaller.JAXB_NO_NAMESPACE_SCHEMA_LOCATION;
            ms.setProperty(propName, value);
        }
    }

It's not the right way as it should be configured to have a choice on turning on/off absolute
paths.  

Maybe in a future version it will be set?

Thank you.
Excuse me if it turns out it's not an appropriate post.

Ciao
Alessandro

  was:
Hi all. It's my first contribute to CXF. Maybe it has already been solved but I've not figured
out how to obtain it.
I need to have a xml produced with 
xsi:schemaLocation="john andrew".

I've tried @XSISchemaLocation("john andrew") but you know it's rendered http://blabla/john%20andrew.

I've tried to configure through the bean property schemaLocation in spring/cxf xml configuration
file (for a bean of class org.apache.cxf.jaxrs.provider.JAXBElementProvider<T>), but
I obtain that Spring fires an exception of operation not supported (maybe it would not work
anyway).

So, in the end, I've copied the class above and I made a class of my own changing the  addSchemaLocation
method as follows:

private void addSchemaLocation(Marshaller ms, Annotation[] anns)
        throws Exception
    {
        XSISchemaLocation sl = AnnotationUtils.getAnnotation(anns,
            XSISchemaLocation.class);
        if (sl != null)
        {
            log.debug("It would produce " + buildAbsoluteXMLResourceURI(sl.value()));
            //String value = buildAbsoluteXMLResourceURI(sl.value());

            log.debug("It produces instead" + sl.value());
            String value = sl.value();

            String propName = !sl.noNamespace() ? Marshaller.JAXB_SCHEMA_LOCATION
                : Marshaller.JAXB_NO_NAMESPACE_SCHEMA_LOCATION;
            ms.setProperty(propName, value);
        }
    }

It's not the right way as it should be configured to have a choice on turning on/off absolute
paths.  

Maybe in a future version it will be set?

Thank you.
Excuse me if it turns out it's not an appropriate post.

Ciao
Alessandro


> Letting to be absolute XSISchemaNamespace 
> ------------------------------------------
>
>                 Key: CXF-5342
>                 URL: https://issues.apache.org/jira/browse/CXF-5342
>             Project: CXF
>          Issue Type: Improvement
>          Components: JAX-RS
>    Affects Versions: 2.7.7
>         Environment: Tomcat Spring
>            Reporter: Alessandro Canevese
>
> Hi all. It's my first contribute to CXF. Maybe it has already been solved but I've not
figured out how to obtain it.
> I need to have a xml produced with 
> xsi:schemaLocation="john andrew".
> I've tried @XSISchemaLocation("john andrew") but you know it's rendered http://blabla/john%20andrew.
> I've tried to configure through the bean property schemaLocation in spring/cxf xml configuration
file (for a bean of class org.apache.cxf.jaxrs.provider.JAXBElementProvider<T>), but
I obtain that Spring fires an exception of operation not supported (maybe it would not work
anyway).
> So, in the end, I've copied the class above and I made a class of my own changing the
 addSchemaLocation method as follows:
> private void addSchemaLocation(Marshaller ms, Annotation[] anns)
>         throws Exception
>     {
>         XSISchemaLocation sl = AnnotationUtils.getAnnotation(anns,
>             XSISchemaLocation.class);
>         if (sl != null)
>         {
>             log.debug("It would produce " + buildAbsoluteXMLResourceURI(sl.value()));
>             //String value = buildAbsoluteXMLResourceURI(sl.value());
>             log.debug("It produces instead" + sl.value());
>  
>            String value = sl.value();
>             String propName = !sl.noNamespace() ? Marshaller.JAXB_SCHEMA_LOCATION
>                 : Marshaller.JAXB_NO_NAMESPACE_SCHEMA_LOCATION;
>             ms.setProperty(propName, value);
>         }
>     }
> It's not the right way as it should be configured to have a choice on turning on/off
absolute paths.  
> Maybe in a future version it will be set?
> Thank you.
> Excuse me if it turns out it's not an appropriate post.
> Ciao
> Alessandro



--
This message was sent by Atlassian JIRA
(v6.1#6144)

Mime
View raw message