jira.codehaus.org

  • Log In Access more options
    • Online Help
    • Keyboard Shortcuts
    • About JIRA
    • JIRA Credits
    • What?s New
  • Dashboards Access more options (Alt+d)
  • Projects Access more options (Alt+p)
  • Issues Access more options (Alt+i)
  • XFire
  • XFIRE-844

JAX-WS Array Support

  • Log In
  • Views
    • XML
    • Word
    • Printable

Details

  • Type: Bug Bug
  • Status: Open Open
  • Priority: Major Major
  • Resolution: Unresolved
  • Affects Version/s: 1.2.4
  • Fix Version/s: 1.2.7
  • Component/s: JAX-WS
  • Labels:
    None

Description

JAX-WS (2.1 EA3) sides with JBoss. It looks like an XFire bug.

To figure it what JAX-WS does, I simply modified their "fromjava"
sample. I added a couple methods to AddNumbersImpl.java that use
arrays.

cd $JAXWS_HOME/samples/fromjava/
ant help
server-j2se

http://localhost:8080/jaxws-fromjava/addnumbers?wsdl
http://localhost:8080/jaxws-fromjava/addnumbers?xsd=1

In the XSD, you get
<xs:element name="arg0" type="xs:string" minOccurs="0" maxOccurs="unbounded">

Cameron

On 1/16/07, Cameron Taggart <cameron.taggart@gmail.com> wrote:
> How should a String array get encoded for JSR 181? According to the
> documentation the default is document literal wrapped and that is what
> I'm using.
>
> https://jax-ws.dev.java.net/nonav/jax-ws-21-ea3/docs/annotations.html
>
> When a String[] is passed in as a parameter, should it be encoded like this:
>
> <fruit>
> <string>apple</string>
> <string>banana</string>
> <string>orange</string>
> </fruit>
>
> or
>
> <fruit>apple</fruit>
> <fruit>banana</fruit>
> <fruit>orange</fruit>
>
> Hopefully, either JBoss or XFire is doing it incorrectly. If not,
> then using JSR 181 annotations isn't portable between implementations,
> which would suck. Any suggestions for how to figure this out. I'm
> going to see what the JAX-WS reference implementation does.
>
> Cameron
>
> On 1/15/07, Cameron Taggart <cameron.taggart@gmail.com> wrote:
> > I'm trying to switch for JBoss-WS to XFire and running into some
> > differences into the produced wsdl files with regards to String
> > arrays. Here is the JSR-181 annotation:
> >
> > @WebParam(name = "input") String[] input
> >
> > and for JBoss, it produces this is the wsdl:
> >
> > <element maxOccurs="unbounded" minOccurs="0" name="input"
> > nillable="true" type="string"/>
> >
> > yet XFire produces this.
> >
> > <xsd:element maxOccurs="1" minOccurs="1" name="input" nillable="true"
> > type="tns:ArrayOfString"/>
> >
> > <xsd:complexType name="ArrayOfString">
> > <xsd:sequence>
> > <xsd:element maxOccurs="unbounded" minOccurs="0" name="string"
> > nillable="true" type="xsd:string"/>
> > </xsd:sequence>
> > </xsd:complexType>
> >
> > The WSDL's are obviously different. JBoss expects:
> > <input>apple</input>
> > <input>orange</input>
> > <input>banana</input>
> >
> > XFire expects:
> > <input>
> > <string>apple</string>
> > <string>orange</string>
> > <string>banana</string>
> > </input>
> >
> > I was expecting them to be identical so I don't have to change the
> > clients anytime I change the JSR181 library implementation. Any idea
> > what is wrong or if one library is doing it wrong? I'm using wrapped
> > document literal:
> >
> > @SOAPBinding (style = SOAPBinding.Style.DOCUMENT,
> > use = SOAPBinding.Use.LITERAL,
> > parameterStyle = SOAPBinding.ParameterStyle.WRAPPED)
> >
> > thanks,
> > Cameron
> >
>

Activity

Ascending order - Click to sort in descending order
  • All
  • Comments
  • Work Log
  • History
  • Activity
Hide
Permalink
Dan Diephouse added a comment - 18/Jan/07 10:16 AM

Thanks Cameron. Scheduling this for 1.2.5

Show
Dan Diephouse added a comment - 18/Jan/07 10:16 AM Thanks Cameron. Scheduling this for 1.2.5
Hide
Permalink
Cameron Taggart added a comment - 18/Jan/07 10:40 AM

I believe CXF also sides with JBoss-WS and JAX-WS RI. For example, this web method

@WebMethod
public List<String> getGreetings() { return greetings; }

The WSDL response element from CXF looks like:

<xsd:element name="getGreetingsResponse">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="return" type="gen185:stringArray"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>

where xmlns:gen185="http://jaxb.dev.java.net/array"

Show
Cameron Taggart added a comment - 18/Jan/07 10:40 AM I believe CXF also sides with JBoss-WS and JAX-WS RI. For example, this web method @WebMethod public List<String> getGreetings() { return greetings; } The WSDL response element from CXF looks like: <xsd:element name="getGreetingsResponse"> <xsd:complexType> <xsd:sequence> <xsd:element name="return" type="gen185:stringArray"/> </xsd:sequence> </xsd:complexType> </xsd:element> where xmlns:gen185="http://jaxb.dev.java.net/array"
Hide
Permalink
Cameron Taggart added a comment - 18/Jan/07 6:03 PM

Nevermind about CXF. It now appears that it is doing the same thing as XFire where it wraps the array items in an element. Did it inherit this from XFire?

Show
Cameron Taggart added a comment - 18/Jan/07 6:03 PM Nevermind about CXF. It now appears that it is doing the same thing as XFire where it wraps the array items in an element. Did it inherit this from XFire?
Hide
Permalink
Matthew Eanor added a comment - 25/Jan/07 11:55 AM

Good to hear it is going to be fixed in 1.2.5: will this fix cover web services using the service factory org.codehaus.xfire.jaxb2.JaxbServiceFactory?

Show
Matthew Eanor added a comment - 25/Jan/07 11:55 AM Good to hear it is going to be fixed in 1.2.5: will this fix cover web services using the service factory org.codehaus.xfire.jaxb2.JaxbServiceFactory?
Hide
Permalink
Zarar Siddiqi added a comment - 08/Mar/07 10:28 AM

Could this be related to this issue I'm having?

http://www.nabble.com/Problem-returning-a-Collection-or-an-array-using-generics-tf3364015.html

Show
Zarar Siddiqi added a comment - 08/Mar/07 10:28 AM Could this be related to this issue I'm having? http://www.nabble.com/Problem-returning-a-Collection-or-an-array-using-generics-tf3364015.html
Hide
Permalink
Cameron Taggart added a comment - 03/May/07 9:02 AM

Moved to 1.2.7. I guess the good news is that it is still one of the 23 issues on the roadmap.

Show
Cameron Taggart added a comment - 03/May/07 9:02 AM Moved to 1.2.7. I guess the good news is that it is still one of the 23 issues on the roadmap.
Hide
Permalink
tsc added a comment - 03/Dec/07 2:14 PM

Has this issue been resolved in CXF version 2.0.3?

Show
tsc added a comment - 03/Dec/07 2:14 PM Has this issue been resolved in CXF version 2.0.3?

People

  • Assignee:
    Dan Diephouse
    Reporter:
    Cameron Taggart
Vote (7)
Watch (5)

Dates

  • Created:
    16/Jan/07 7:07 PM
    Updated:
    03/Dec/07 2:14 PM
  • Atlassian JIRA (v5.0.4#731-sha1:3aa7374)
  • Report a problem
  • Powered by a free Atlassian JIRA open source license for Codehaus. Try JIRA - bug tracking software for your team.