cxf-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Amaris Nieves" <daraii.t...@gmail.com>
Subject Problem invoking webservice: Marshalling Error
Date Tue, 28 Oct 2008 02:51:57 GMT
I have a very simple test for a webservice. The client was generated with
CXF but the webservice was not.

This is the class:

import com_service_osadia_interface.wovenware.SERVICEOSADIA;
import com_service_osadia_interface.wovenware.SERVICEOSADIAFromOeawPortType;
public class test {

    /**
     * @param args
     */
    public static void main(String[] args) {
        SERVICEOSADIA ss = new SERVICEOSADIA();
        SERVICEOSADIAFromOeawPortType port =
ss.getFromOeawSOAPHTTPListener1BindingPort();

        {
        System.out.println("Invoking oeaw...");
        com.wovenware.oeaw.Oeaw _oeaw_oeawVal = new
com.wovenware.oeaw.Oeaw();
        _oeaw_oeawVal.setM1ACFNMF(" ");
        _oeaw_oeawVal.setM1ACFNMI(" ");
        _oeaw_oeawVal.setM1ACLNMF(" ");
        _oeaw_oeawVal.setM1ACLNMI(" ");
        _oeaw_oeawVal.setM1ACOF(" ");
        _oeaw_oeawVal.setM1ACOI(" ");
        _oeaw_oeawVal.setM1ACTIONF(" ");
        _oeaw_oeawVal.setM1ACTIONI(" ");
        _oeaw_oeawVal.setM1ADDR1F(" ");
        _oeaw_oeawVal.setM1ADDR1I(" ");
        _oeaw_oeawVal.setM1ADDR2F(" ");
        _oeaw_oeawVal.setM1ADDR2I(" ");
        _oeaw_oeawVal.setM1ADDRVF(" ");
        _oeaw_oeawVal.setM1ADDRVI(" ");
        _oeaw_oeawVal.setM1ADR2F(" ");
        _oeaw_oeawVal.setM1ADR2I(" ");
.............
             *   (And many other set calls)*
.............
        javax.xml.ws.Holder<com.wovenware.oeaw.Oeaw> _oeaw_oeaw = new
javax.xml.ws.Holder<com.wovenware.oeaw.Oeaw>(_oeaw_oeawVal);
        port.oeaw(_oeaw_oeaw);

        System.out.println("oeaw._oeaw_oeaw=" + _oeaw_oeaw.value);

        }

        System.exit(0);
    }

}

When I try to execute it I get the following error:

INFO: Interceptor has thrown exception, unwinding now
org.apache.cxf.interceptor.Fault: Marshalling Error: Error writing request
body to server
    at
org.apache.cxf.jaxb.JAXBEncoderDecoder.marshall(JAXBEncoderDecoder.java:176)
    at org.apache.cxf.jaxb.io.DataWriterImpl.write(DataWriterImpl.java:166)
    at
org.apache.cxf.interceptor.AbstractOutDatabindingInterceptor.writeParts(AbstractOutDatabindingInterceptor.java:104)
    at
org.apache.cxf.binding.soap.interceptor.RPCOutInterceptor.handleMessage(RPCOutInterceptor.java:92)
    at
org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:220)
    at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:466)
    at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:299)
    at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:251)
    at org.apache.cxf.frontend.ClientProxy.invokeSync(ClientProxy.java:73)
    at
org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:124)
    at $Proxy37.oeaw(Unknown Source)
    at test.main(test.java:869)
Caused by: javax.xml.bind.MarshalException
 - with linked exception:
[java.io.IOException: Error writing request body to server]
    at
com.sun.xml.bind.v2.runtime.MarshallerImpl.write(MarshallerImpl.java:333)
    at
com.sun.xml.bind.v2.runtime.MarshallerImpl.marshal(MarshallerImpl.java:257)
    at
javax.xml.bind.helpers.AbstractMarshallerImpl.marshal(AbstractMarshallerImpl.java:75)
    at
org.apache.cxf.jaxb.JAXBEncoderDecoder.writeObject(JAXBEncoderDecoder.java:381)
    at
org.apache.cxf.jaxb.JAXBEncoderDecoder.marshall(JAXBEncoderDecoder.java:164)
    ... 11 more
Caused by: java.io.IOException: Error writing request body to server
    at
sun.net.www.protocol.http.HttpURLConnection$StreamingOutputStream.checkError(HttpURLConnection.java:2285)
    at
sun.net.www.protocol.http.HttpURLConnection$StreamingOutputStream.write(HttpURLConnection.java:2268)
    at
org.apache.cxf.io.AbstractWrappedOutputStream.write(AbstractWrappedOutputStream.java:45)
    at
org.apache.cxf.io.AbstractThresholdOutputStream.write(AbstractThresholdOutputStream.java:69)
    at
com.sun.xml.bind.v2.runtime.output.UTF8XmlOutput.write(UTF8XmlOutput.java:395)
    at com.sun.xml.bind.v2.runtime.output.Encoded.write(Encoded.java:163)
    at
com.sun.xml.bind.v2.runtime.output.UTF8XmlOutput.writeName(UTF8XmlOutput.java:230)
    at
com.sun.xml.bind.v2.runtime.output.UTF8XmlOutput.endTag(UTF8XmlOutput.java:274)
    at
com.sun.xml.bind.v2.runtime.XMLSerializer.leafElement(XMLSerializer.java:322)
    at
com.sun.xml.bind.v2.model.impl.RuntimeBuiltinLeafInfoImpl$1.writeLeafElement(RuntimeBuiltinLeafInfoImpl.java:210)
    at
com.sun.xml.bind.v2.model.impl.RuntimeBuiltinLeafInfoImpl$1.writeLeafElement(RuntimeBuiltinLeafInfoImpl.java:209)
    at
com.sun.xml.bind.v2.runtime.reflect.TransducedAccessor$CompositeTransducedAccessorImpl.writeLeafElement(TransducedAccessor.java:250)
    at
com.sun.xml.bind.v2.runtime.property.SingleElementLeafProperty.serializeBody(SingleElementLeafProperty.java:98)
    at
com.sun.xml.bind.v2.runtime.ClassBeanInfoImpl.serializeBody(ClassBeanInfoImpl.java:322)
    at
com.sun.xml.bind.v2.runtime.XMLSerializer.childAsXsiType(XMLSerializer.java:681)
    at
com.sun.xml.bind.v2.runtime.ElementBeanInfoImpl$1.serializeBody(ElementBeanInfoImpl.java:151)
    at
com.sun.xml.bind.v2.runtime.ElementBeanInfoImpl$1.serializeBody(ElementBeanInfoImpl.java:185)
    at
com.sun.xml.bind.v2.runtime.ElementBeanInfoImpl.serializeBody(ElementBeanInfoImpl.java:305)
    at
com.sun.xml.bind.v2.runtime.ElementBeanInfoImpl.serializeRoot(ElementBeanInfoImpl.java:312)
    at
com.sun.xml.bind.v2.runtime.ElementBeanInfoImpl.serializeRoot(ElementBeanInfoImpl.java:71)
    at
com.sun.xml.bind.v2.runtime.XMLSerializer.childAsRoot(XMLSerializer.java:490)
    at
com.sun.xml.bind.v2.runtime.MarshallerImpl.write(MarshallerImpl.java:328)
    ... 15 more
Exception in thread "main" javax.xml.ws.soap.SOAPFaultException: Marshalling
Error: Error writing request body to server
    at
org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:145)
    at $Proxy37.oeaw(Unknown Source)
    at test.main(test.java:869)
Caused by: org.apache.cxf.interceptor.Fault: Marshalling Error: Error
writing request body to server
    at
org.apache.cxf.jaxb.JAXBEncoderDecoder.marshall(JAXBEncoderDecoder.java:176)
    at org.apache.cxf.jaxb.io.DataWriterImpl.write(DataWriterImpl.java:166)
    at
org.apache.cxf.interceptor.AbstractOutDatabindingInterceptor.writeParts(AbstractOutDatabindingInterceptor.java:104)
    at
org.apache.cxf.binding.soap.interceptor.RPCOutInterceptor.handleMessage(RPCOutInterceptor.java:92)
    at
org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:220)
    at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:466)
    at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:299)
    at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:251)
    at org.apache.cxf.frontend.ClientProxy.invokeSync(ClientProxy.java:73)
    at
org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:124)
    ... 2 more
Caused by: javax.xml.bind.MarshalException
 - with linked exception:
[java.io.IOException: Error writing request body to server]
    at
com.sun.xml.bind.v2.runtime.MarshallerImpl.write(MarshallerImpl.java:333)
    at
com.sun.xml.bind.v2.runtime.MarshallerImpl.marshal(MarshallerImpl.java:257)
    at
javax.xml.bind.helpers.AbstractMarshallerImpl.marshal(AbstractMarshallerImpl.java:75)
    at
org.apache.cxf.jaxb.JAXBEncoderDecoder.writeObject(JAXBEncoderDecoder.java:381)
    at
org.apache.cxf.jaxb.JAXBEncoderDecoder.marshall(JAXBEncoderDecoder.java:164)
    ... 11 more
Caused by: java.io.IOException: Error writing request body to server
    at
sun.net.www.protocol.http.HttpURLConnection$StreamingOutputStream.checkError(HttpURLConnection.java:2285)
    at
sun.net.www.protocol.http.HttpURLConnection$StreamingOutputStream.write(HttpURLConnection.java:2268)
    at
org.apache.cxf.io.AbstractWrappedOutputStream.write(AbstractWrappedOutputStream.java:45)
    at
org.apache.cxf.io.AbstractThresholdOutputStream.write(AbstractThresholdOutputStream.java:69)
    at
com.sun.xml.bind.v2.runtime.output.UTF8XmlOutput.write(UTF8XmlOutput.java:395)
    at com.sun.xml.bind.v2.runtime.output.Encoded.write(Encoded.java:163)
    at
com.sun.xml.bind.v2.runtime.output.UTF8XmlOutput.writeName(UTF8XmlOutput.java:230)
    at
com.sun.xml.bind.v2.runtime.output.UTF8XmlOutput.endTag(UTF8XmlOutput.java:274)
    at
com.sun.xml.bind.v2.runtime.XMLSerializer.leafElement(XMLSerializer.java:322)
    at
com.sun.xml.bind.v2.model.impl.RuntimeBuiltinLeafInfoImpl$1.writeLeafElement(RuntimeBuiltinLeafInfoImpl.java:210)
    at
com.sun.xml.bind.v2.model.impl.RuntimeBuiltinLeafInfoImpl$1.writeLeafElement(RuntimeBuiltinLeafInfoImpl.java:209)
    at
com.sun.xml.bind.v2.runtime.reflect.TransducedAccessor$CompositeTransducedAccessorImpl.writeLeafElement(TransducedAccessor.java:250)
    at
com.sun.xml.bind.v2.runtime.property.SingleElementLeafProperty.serializeBody(SingleElementLeafProperty.java:98)
    at
com.sun.xml.bind.v2.runtime.ClassBeanInfoImpl.serializeBody(ClassBeanInfoImpl.java:322)
    at
com.sun.xml.bind.v2.runtime.XMLSerializer.childAsXsiType(XMLSerializer.java:681)
    at
com.sun.xml.bind.v2.runtime.ElementBeanInfoImpl$1.serializeBody(ElementBeanInfoImpl.java:151)
    at
com.sun.xml.bind.v2.runtime.ElementBeanInfoImpl$1.serializeBody(ElementBeanInfoImpl.java:185)
    at
com.sun.xml.bind.v2.runtime.ElementBeanInfoImpl.serializeBody(ElementBeanInfoImpl.java:305)
    at
com.sun.xml.bind.v2.runtime.ElementBeanInfoImpl.serializeRoot(ElementBeanInfoImpl.java:312)
    at
com.sun.xml.bind.v2.runtime.ElementBeanInfoImpl.serializeRoot(ElementBeanInfoImpl.java:71)
    at
com.sun.xml.bind.v2.runtime.XMLSerializer.childAsRoot(XMLSerializer.java:490)
    at
com.sun.xml.bind.v2.runtime.MarshallerImpl.write(MarshallerImpl.java:328)
    ... 15 more


I read in a previous post that setting the client to use AutoRedirect could
help, but I don't understand how can I do it in my case.

Thanks.

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message