Hi,
I am getting an error marshalling an enumerated type. Is there an open
issue with this in XFire 1.2.2?
Here is the stack trace from the exception:
org.codehaus.xfire.XFireRuntimeException: Could not invoke service..
Nested exception is org.codehaus.xfire.fault.XFireFault: Could not marshall
type.
org.codehaus.xfire.fault.XFireFault: Could not marshall type.
at org.codehaus.xfire.jaxb2.JaxbType.writeObject(JaxbType.java:254)
at
org.codehaus.xfire.aegis.AegisBindingProvider.writeParameter(AegisBindingPro
vider.java:200)
at
org.codehaus.xfire.service.binding.AbstractBinding.writeParameter(AbstractBi
nding.java:273)
at
org.codehaus.xfire.service.binding.DocumentBinding.writeMessage(DocumentBind
ing.java:65)
at
org.codehaus.xfire.soap.SoapSerializer.writeMessage(SoapSerializer.java:80)
at
org.codehaus.xfire.transport.http.HttpChannel.writeWithoutAttachments(HttpCh
annel.java:56)
at
org.codehaus.xfire.transport.http.CommonsHttpMessageSender.getByteArrayReque
stEntity(CommonsHttpMessageSender.java:313)
at
org.codehaus.xfire.transport.http.CommonsHttpMessageSender.send(CommonsHttpM
essageSender.java:251)
at
org.codehaus.xfire.transport.http.HttpChannel.sendViaClient(HttpChannel.java
:123)
at org.codehaus.xfire.transport.http.HttpChannel.send(HttpChannel.java:48)
at
org.codehaus.xfire.handler.OutMessageSender.invoke(OutMessageSender.java:26)
at
org.codehaus.xfire.handler.HandlerPipeline.invoke(HandlerPipeline.java:131)
at org.codehaus.xfire.client.Invocation.invoke(Invocation.java:75)
at org.codehaus.xfire.client.Client.invoke(Client.java:335)
at org.codehaus.xfire.client.XFireProxy.handleRequest(XFireProxy.java:77)
at org.codehaus.xfire.client.XFireProxy.invoke(XFireProxy.java:57)
at $Proxy13.testWebService(Unknown Source) Caused by:
javax.xml.bind.MarshalException
- with linked exception:
[javax.xml.bind.JAXBException: com.sample.EnumCodeType is not known to this
context]
at
com.sun.xml.bind.v2.runtime.MarshallerImpl.write(MarshallerImpl.java:295)
at
com.sun.xml.bind.v2.runtime.MarshallerImpl.marshal(MarshallerImpl.java:148)
at org.codehaus.xfire.jaxb2.JaxbType.writeObject(JaxbType.java:249)
... 17 more
Caused by: javax.xml.bind.JAXBException: com.sample.EnumCodeType is not
known to this context
at
com.sun.xml.bind.v2.runtime.XMLSerializer.reportError(XMLSerializer.java:223
)
at
com.sun.xml.bind.v2.runtime.XMLSerializer.reportError(XMLSerializer.java:238
)
at
com.sun.xml.bind.v2.runtime.ElementBeanInfoImpl$1.serializeBody(ElementBeanI
nfoImpl.java:85)
at
com.sun.xml.bind.v2.runtime.ElementBeanInfoImpl$1.serializeBody(ElementBeanI
nfoImpl.java:127)
at
com.sun.xml.bind.v2.runtime.ElementBeanInfoImpl.serializeBody(ElementBeanInf
oImpl.java:244)
at
com.sun.xml.bind.v2.runtime.ElementBeanInfoImpl.serializeRoot(ElementBeanInf
oImpl.java:251)
at
com.sun.xml.bind.v2.runtime.ElementBeanInfoImpl.serializeRoot(ElementBeanInf
oImpl.java:33)
at
com.sun.xml.bind.v2.runtime.XMLSerializer.childAsRoot(XMLSerializer.java:461
)
at
com.sun.xml.bind.v2.runtime.MarshallerImpl.write(MarshallerImpl.java:292)
... 19 more
Caused by: javax.xml.bind.JAXBException: com.sample.EnumCodeType is not
known to this context
at
com.sun.xml.bind.v2.runtime.JAXBContextImpl.getBeanInfo(JAXBContextImpl.java
:510)
at
com.sun.xml.bind.v2.runtime.ElementBeanInfoImpl$1.serializeBody(ElementBeanI
nfoImpl.java:82)
... 25 more
Here is the com.sample.EnumCodeType that is generated by XFire:
-------------------------------------------------------------------
package com.sample;
import javax.xml.bind.annotation.XmlEnum;
/**
* <p>Java class for EnumCodeType.
*
* <p>The following schema fragment specifies the expected content contained
within this class.
* <p>
* <pre>
* <simpleType name=3D"EnumCodeType">
* <restriction base=3D"{http://www.w3.org/2001/XMLSchema}string">
* <enumeration value=3D"M"/>
* <enumeration value=3D"F"/>
* <enumeration value=3D"X"/>
* <enumeration value=3D"N"/>
* </restriction>
* </simpleType>
* </pre>
*
*/
@XmlEnum
public enum EnumCodeType {
F,
M,
N,
X;
public String value() {
return name();
}
public static EnumCodeType fromValue(String v) {
return valueOf(v);
}
}
------------------------------------------------------------------------
When I call the web service, I am passing "EnumCodeType.F" as an argument
where the EnumCodeType value is expected. For example:
soap.testWebService(EnumCodeType.F);
Any ideas as to what I am doing wrong?
Thanks a lot!
Chad
---------------------------------------------------------------------
To unsubscribe from this list please visit:
http://xircles.codehaus.org/manage_email