You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@cxf.apache.org by "Nathan Bryant (JIRA)" <ji...@apache.org> on 2007/09/21 00:53:50 UTC

[jira] Commented: (CXF-952) RESTful services must include a package-info.java to set the elementFormDefault to QUALIFIED

    [ https://issues.apache.org/jira/browse/CXF-952?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12529282 ] 

Nathan Bryant commented on CXF-952:
-----------------------------------

This seems to be related to the following code from DocLiteralInInterceptor.java:

    private void getPara(DepthXMLStreamReader xmlReader,
                         DataReader<XMLStreamReader> dr,
                         MessageContentsList parameters,
                         Iterator<MessagePartInfo> itr,
                         Message message) {

[beginning of method snipped]

            Object obj = null;
            if (hasNext) {
                QName rname = xmlReader.getName();
                while (part != null 
                    && !rname.equals(part.getConcreteName())) {
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

When single stepping through here in the debugger, rname is fully qualified and concreteName is not.

When the message was built by URIParameterInInterceptor / IriDecoderHelper, it was built with a namespace. Setting namespaces with @WebParam(targetNamespace=...) does not help.

> RESTful services must include a package-info.java to set the elementFormDefault to QUALIFIED
> --------------------------------------------------------------------------------------------
>
>                 Key: CXF-952
>                 URL: https://issues.apache.org/jira/browse/CXF-952
>             Project: CXF
>          Issue Type: Bug
>          Components: Core
>    Affects Versions: 2.0.1
>            Reporter: Adrian Trenaman
>
> -- Extract from email sent to cxf-dev --
> Hi all,
>  
> I've been playing with the RESTful service support and I've come across some issues that really slowed me down :( I'm describing them here (and their workarounds) in case any users find it useful. I'm also wondering if some of these might be classified as bugs - please advise!
>  
> Here's what happened: based on the docu in the CXF wiki User Guide [1], I developed a RESTful service: everything was going fine until I implemented a PUT method for an update. 
>  
> --- in play/Contacts.java ---
>  @Put
>  @HttpResource(location="/people/{id}")  
>  void updatePerson(Person person);
> --- 
>  
> First problem: I didn't realise that I needed to have a package-info.java in the package. Without this, my Person object (which represents the payload of the PUT) has null contents in the serverside code. Through a lot of trial and error I discovered that I hadn't included package-info.java file in the Java package (it's still not clear to me why I should need it...). 
>  
> Also, I've found that elementFormDefault must be QUALIFIED - making this UNQUALIFIED doesn't work (see package-info.java below)
>  
> --- package-info.java ---
> @javax.xml.bind.annotation.XmlSchema(
>   namespace = "http://play/", 
>         elementFormDefault = javax.xml.bind.annotation.XmlNsForm.QUALIFIED
> )
> package play;
> ------

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.