Details
-
Type:
Bug
-
Status:
Open
-
Priority:
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.
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.