axis-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Attharkar, Asmita" <>
Subject RE: MTOM: Axis2-1.4 issue?? XMLStreamException: Unknow type can not serialize
Date Thu, 03 Jul 2008 16:17:38 GMT

Here is my client code:

                        .setProperty(Constants.Configuration.ENABLE_MTOM, Constants.VALUE_TRUE);
            File file = new File(INPUT_FILE);
            FileInputStream fis = new FileInputStream(file);
            String base64String = Base64.encode(readFully(fis)); //reads the file bitwise
before encode is called on it.

ServiceMethodWithAttach serviceMsgAttach = new ServiceMethodWithAttach ();

            OMFactory fac = OMAbstractFactory.getOMFactory();

            OMText binaryNode =fac.createOMText(base64String,"application/pdf",true);

            OMNamespace omNs = fac.createOMNamespace("", "ns1");

            OMElement method = fac.createOMElement("processNPCMsgWithAttach", omNs);


            serviceMsgAttach.setUserId("Test"); // String 1
            serviceMsgAttach.setPassword("test"); //String 2
            serviceMsgAttach.setXMLMsg("<test></test>"); //String 3
            serviceMsgAttach.setElement(method); //Attachment

            myStub.serviceMethodWithAttach (serviceMsgAttach);
            System.out.println("done calling service...");

In Services.xml I have added the parameter :

<parameter name="enableMTOM" locked="false">true</parameter>

Why do I get unknown type cannot serialize?

From: Tony Dean []
Sent: Thursday, July 03, 2008 11:46 AM
Subject: RE: MTOM: Axis2-1.4 issue?? XMLStreamException: Unknow type can not serialize

don't know about your issue, but there are other issues fixed in 1.4 that were broke in 1.3
so I wouldn't go back there.

From: Attharkar, Asmita []
Sent: Thursday, July 03, 2008 9:40 AM
Subject: MTOM: Axis2-1.4 issue?? XMLStreamException: Unknow type can not serialize


I am trying to send a pdf attachment in the soap message but I get this:


And the message doesn't come to web services server, it is failing in OperationClient.execute()
method itself.
The AxisFault message shows "Unknow type can not serialize". What could be the possible reasons
for this or is this a known issue with axis2 1.4 release? Should I use axis2 1.3 release if
I need to send an attachment using MTOM?

Thanks so much for you help!

I am using JRE and JDK 1.5_15, Ant 1.6, apache tomcat server 1.6 and Axis2 1.4


View raw message