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-526

Invalid wsdl for array parameters with JAXB 2.0 / Wrapped Style

  • Log In
  • Views
    • XML
    • Word
    • Printable

Details

  • Type: Bug Bug
  • Status: Open Open
  • Priority: Major Major
  • Resolution: Unresolved
  • Affects Version/s: 1.1.1
  • Fix Version/s: None
  • Component/s: None
  • Labels:
    None
  • Environment:
    XFire 1.1.1 in Apache Tomcat 5.5.7 in Winodws XP

Description

Hi, I'm trying to generate a wrapped style wsdl with jaxb 2.0 and i'm having
problems with array parameters: the wrapper element references an array complex type
(for example: "ArrayOfString") but this types are not declared. in the wsdl.

I'm testing with the following service interface

@WebService(name="TestService", targetNamespace="http://xml.service.test")
public interface TestService
{
@WebMethod(operationName = "EchoArray", action = "")
public String[] echoArray(String[] array);
}

The implementation has the "parameterStyle" annotation

@WebService(endpointInterface="test.service.xml.TestService", serviceName="TestService")
@SOAPBinding(style = SOAPBinding.Style.DOCUMENT,
use = SOAPBinding.Use.LITERAL ,
parameterStyle=SOAPBinding.ParameterStyle.WRAPPED)
public class TestServiceImpl implements TestService
{
public String[] echoArray(String[] array) { return array; }
}

The service.xml is the following

<beans xmlns="http://xfire.codehaus.org/config/1.0">

<bean id="testServiceImpl"
class="test.service.xml.TestServiceImpl">
</bean>

<service>
<serviceBean>#testServiceImpl</serviceBean>
<serviceFactory>#jaxbServiceFactory</serviceFactory>
</service>

<bean name="jaxbServiceFactory"
class="org.codehaus.xfire.jaxb2.JaxbServiceFactory">
<constructor-arg ref="xfire.transportManager" />
</bean>

</beans>

Finally, the generated wsdl is:

<wsdl:types>
<xsd:schema targetNamespace="http://xml.service.test" elementFormDefault="qualified" attributeFormDefault="qualified">
<xsd:element name="EchoArray">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="in0" type="tns:ArrayOfString" nillable="true" minOccurs="1" maxOccurs="1" />
</xsd:sequence>
</xsd:complexType>
</xsd:element>
<xsd:element name="EchoArrayResponse">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="out" type="tns:ArrayOfString" nillable="true" minOccurs="1" maxOccurs="1" />
</xsd:sequence>
</xsd:complexType>
</xsd:element>
</xsd:schema>
</wsdl:types>

The type "ArrayOfString" is referenced but not declared in the wrapper elements but is nto declared.

Activity

Ascending order - Click to sort in descending order
  • All
  • Comments
  • Work Log
  • History
  • Activity
Hide
Permalink
Mark Larman added a comment - 04/Jan/07 5:00 AM

The same problem occurs with generic List/Map and it does not seem to matter whether the style is bare or wrapped.

The online example: http://xfire.codehaus.org/JAXB+2.0#JAXB2.0-CodeFirstDevelopment

Does not work due to this bug as the BookService has a method

public Book[] getBooks();

So in wsdl the returned object is declared to be of type ArrayOfBook but this complex type is not declared.

Show
Mark Larman added a comment - 04/Jan/07 5:00 AM The same problem occurs with generic List/Map and it does not seem to matter whether the style is bare or wrapped. The online example: http://xfire.codehaus.org/JAXB+2.0#JAXB2.0-CodeFirstDevelopment Does not work due to this bug as the BookService has a method public Book[] getBooks(); So in wsdl the returned object is declared to be of type ArrayOfBook but this complex type is not declared.
Hide
Permalink
Viktor Nordling added a comment - 23/Jan/07 7:20 AM

I am experiencing this problem and I need urgent help.

What I want to do is this:
1. Create an interface with a method which return an array of Strings.
2. Generate the WSDL file with XFire.
3. Generate the code for calling the webservice with XFire.
4. See that the code compiles.

Are there any known workarounds? Can I use anything else instead of JAXB 2.0 / Wrapped Style?

Show
Viktor Nordling added a comment - 23/Jan/07 7:20 AM I am experiencing this problem and I need urgent help. What I want to do is this: 1. Create an interface with a method which return an array of Strings. 2. Generate the WSDL file with XFire. 3. Generate the code for calling the webservice with XFire. 4. See that the code compiles. Are there any known workarounds? Can I use anything else instead of JAXB 2.0 / Wrapped Style?

People

  • Assignee:
    Dan Diephouse
    Reporter:
    Pablo Pastorino
Vote (5)
Watch (6)

Dates

  • Created:
    08/Jul/06 10:16 AM
    Updated:
    23/Jan/07 11:56 AM
  • 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.