[
https://issues.apache.org/jira/browse/CXF-1407?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12563186#action_12563186
]
Daniel Kulp commented on CXF-1407:
----------------------------------
I think your ComplexException class has completely invalid annotations.
Technically, with those annotations, the fields would be mapped to attributes,
not annotations. The MyBeans really cannot map to an attribute. In anycase,
the fault writer definitely does not support writing to attributes at this
point.
On trunk, I changed the fault to:
@XmlAccessorType(XmlAccessType.PROPERTY)
public class ComplexException extends org.omg.CORBA.UserException {
private String reason;
private MyBean[] beans;
public ComplexException(String msg) {
super(msg);
}
public String getReason() {
return reason;
}
public void setReason(String reason) {
this.reason = reason;
}
public MyBean[] getBeans() {
return beans;
}
public void setBeans(MyBean[] beans) {
this.beans = beans;
}
}
and it seems to be writing out the correct data in all cases right now.
I'll check with 2.0.4 later.
Dan
> Item element with xmlns="" in Exception with arrays of compex objects
> ---------------------------------------------------------------------
>
> Key: CXF-1407
> URL: https://issues.apache.org/jira/browse/CXF-1407
> Project: CXF
> Issue Type: Bug
> Affects Versions: 2.0.4
> Environment: Linux, java1.6.0_02
> Reporter: Marco Piraccini
> Attachments: TestFault.zip
>
>
> Consider an exception with an array of objects. If i send a soap message:
> <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
> xmlns:ser="http://server.hw.demo/">
> <soapenv:Header/>
> <soapenv:Body>
> <ser:sayHi>
> <ser:arg0>test</ser:arg0>
> </ser:sayHi>
> </soapenv:Body>
> </soapenv:Envelope>
> The answer is:
> <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
> (...)
> <ns1:ComplexException xmlns:ns1="http://server.hw.demo/">
> <reason xmlns:ns2="http://server.hw.demo/">Test</reason>
> <beans xsi:type="ns2:myBeanArray"
> xmlns:ns2="http://server.hw.demo/"
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
> <item>
> <ns2:age>0</ns2:age>
> <ns2:name>Marco</ns2:name>
> </item>
> </beans>
> </ns1:ComplexException>
> (...)
> </soap:Envelope>
> Notice that the item element is with no namespace (correct).
> The problem is that, after the first soap message sent, if i request the
> service wsdl (for example pointing the browser at
> http://localhost:9000/helloWorld?wsdl), all the subsequent answers are with a
> different (and wrong) response:
> <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
> (...)
> <ns1:ComplexException xmlns:ns1="http://server.hw.demo/">
> <reason xmlns="http://server.hw.demo/">Test</reason>
> <beans xsi:type="myBeanArray" xmlns="http://server.hw.demo/"
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
> <item xmlns="" xmlns:ns3="http://server.hw.demo/">
> <ns3:age>0</ns3:age>
> <ns3:name>Marco</ns3:name>
> </item>
> </beans>
> </ns1:ComplexException>
> (...)
> </soap:Envelope>
> In the attachment there is a simple project to reproduce the problem.
> Marco.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.