[
http://jira.codehaus.org/browse/XFIRE-547?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_90001
]
Joel Turkel commented on XFIRE-547:
-----------------------------------
Dan,
Not sure if you're on it already or not but I believe the suggested fixes still
leave a problem when sending arrays of non-null objects back and forth e.g.
{code}
@XmlRootElement
public class Foo {
public Foo() { }
public Foo(String name) { this.name = name; }
@XmlElement
public String name;
}
@WebService
public class ArrayService {
@WebMethod
public Foo[] getFoos() { return new Foo[] { new Foo("Bob"), new Foo("Hank")
}; }
}
{code}
This ends up generating XML something like:
{code}
<Foo>
<foo>
<name>Bob</name>
</foo>
</Foo>
<Foo>
<foo>
<name>Hank</name>
</foo>
</Foo>
{code}
I'm not very familiar with the code but I *think* the problem is in
org.codehaus.xfire.aegis.type.basic.ArrayType.writeValue(). I believe the
correct implementation of this method should be:
{code}
protected void writeValue(Object value,
MessageWriter writer,
MessageContext context,
Type type,
String name,
String ns)
throws XFireFault
{
type = AegisBindingProvider.getWriteType(context, value, type);
// Bug Fix
if (type.isWriteOuter())
{
writer = writer.getElementWriter(name, ns);
}
if (value==null && type.isNillable())
writer.writeXsiNil();
else
type.writeObject( value, writer, context );
// Bug Fix
if (type.isWriteOuter())
{
writer.close();
}
}
{code}
Not sure if I'm interpreting the isWriteOuter flag correctly, but it seems to
fix the problem???
Thanks,
Joel Turkel
> Generated collection structures don't appear on WSDL
> ----------------------------------------------------
>
> Key: XFIRE-547
> URL: http://jira.codehaus.org/browse/XFIRE-547
> Project: XFire
> Issue Type: Bug
> Components: JAX-WS, JAXB 2.0
> Affects Versions: 1.1, 1.1.1
> Environment: Java 5
> Reporter: frederic dreyfus
> Assigned To: Dan Diephouse
> Fix For: 1.2.5
>
> Attachments: FakeService.java, FakeService.wsdl, spring-xfire.xml,
> web.xml
>
>
> When trying to expose a service that returns a collection of type T :
> Collection<T> doStuff()
> The generated WSDL makes a reference to ArrayOfT but has no corresponding
> schema.
> This occurs when using the org.codehaus.xfire.jaxws.JAXWSServiceFactory and
> the org.codehaus.xfire.jaxb2.JaxbServiceFactory.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe from this list please visit:
http://xircles.codehaus.org/manage_email