Hi,

i am playing around with the attchment support with Axis 1.4. The first 
question is, what is the current status of MTOM support in Axis 1.4. I was able 
to send attachment with MTOM-Encoding so far and I would like to know if there 
is any limitation and whether MTOM is officially and fully supported. The 2 
question is about message style with attachment. Using RPC/Encoded, I am able 
to send call a service method containing a single parameter, which is a bean 
containg a DataHandler-attribut, which stands for the attachment. But when 
switching to Wrapped by calling call.setOperationStyle(Style.WRAPPED) on the 
client side, I get the following exception, which actually occurs on the client 
side. It seems the BeanSerializer, which I have regsitered before, can't be 
found. 

My question is: why can't the bean serializer registration can't be found any 
more? Is it possible to use wrapped with attachment at all?

StackTrace: 

- Exception:
AxisFault
 faultCode: {http://schemas.xmlsoap.org/soap/envelope/}Server.userException
 faultSubcode: 
 faultString: java.io.IOException: No serializer found for class 
de.javamagazin.attachments.FileWrapper in registry [EMAIL PROTECTED]
 faultActor: 
 faultNode: 
 faultDetail: 
        {http://xml.apache.org/axis/}stackTrace:java.io.IOException: No 
serializer found for class de.javamagazin.attachments.FileWrapper in registry 
[EMAIL PROTECTED]
        at 
org.apache.axis.encoding.SerializationContext.serializeActual(SerializationContext.java:1507)
        at 
org.apache.axis.encoding.SerializationContext.serialize(SerializationContext.java:980)
        at 
org.apache.axis.encoding.SerializationContext.serialize(SerializationContext.java:801)
        at org.apache.axis.message.RPCParam.serialize(RPCParam.java:208)
        at org.apache.axis.message.RPCElement.outputImpl(RPCElement.java:433)
        at 
org.apache.axis.message.MessageElement.output(MessageElement.java:1208)
        at org.apache.axis.message.SOAPBody.outputImpl(SOAPBody.java:139)
        at 
org.apache.axis.message.SOAPEnvelope.outputImpl(SOAPEnvelope.java:478)
        at 
org.apache.axis.message.MessageElement.output(MessageElement.java:1208)
        at org.apache.axis.SOAPPart.writeTo(SOAPPart.java:315)
        at org.apache.axis.SOAPPart.writeTo(SOAPPart.java:269)
        at org.apache.axis.SOAPPart.saveChanges(SOAPPart.java:530)
        at 
org.apache.axis.attachments.AttachmentsImpl.getAttachmentCount(AttachmentsImpl.java:554)
        at org.apache.axis.Message.getContentType(Message.java:486)
        at 
org.apache.axis.transport.http.HTTPSender.writeToSocket(HTTPSender.java:343)
        at org.apache.axis.transport.http.HTTPSender.invoke(HTTPSender.java:138)
        at 
org.apache.axis.strategies.InvocationStrategy.visit(InvocationStrategy.java:32)
        at org.apache.axis.SimpleChain.doVisiting(SimpleChain.java:118)
        at org.apache.axis.SimpleChain.invoke(SimpleChain.java:83)
        at org.apache.axis.client.AxisClient.invoke(AxisClient.java:165)
        at org.apache.axis.client.Call.invokeEngine(Call.java:2784)
        at org.apache.axis.client.Call.invoke(Call.java:2767)
        at org.apache.axis.client.Call.invoke(Call.java:2443)
        at org.apache.axis.client.Call.invoke(Call.java:2366)
        at org.apache.axis.client.Call.invoke(Call.java:1812)
        at 
de.javamagazin.attachments.FileWrapperUploadServiceClient.main(FileWrapperUploadServiceClient.java:55)

        {http://xml.apache.org/axis/}hostname:SAMSUNG

java.io.IOException: No serializer found for class 
de.javamagazin.attachments.FileWrapper in registry [EMAIL PROTECTED]
        at org.apache.axis.AxisFault.makeFault(AxisFault.java:101)
        at org.apache.axis.SOAPPart.writeTo(SOAPPart.java:317)
        at org.apache.axis.SOAPPart.writeTo(SOAPPart.java:269)
        at org.apache.axis.SOAPPart.saveChanges(SOAPPart.java:530)
        at 
org.apache.axis.attachments.AttachmentsImpl.getAttachmentCount(AttachmentsImpl.java:554)
        at org.apache.axis.Message.getContentType(Message.java:486)
        at 
org.apache.axis.transport.http.HTTPSender.writeToSocket(HTTPSender.java:343)
        at org.apache.axis.transport.http.HTTPSender.invoke(HTTPSender.java:138)
        at 
org.apache.axis.strategies.InvocationStrategy.visit(InvocationStrategy.java:32)
        at org.apache.axis.SimpleChain.doVisiting(SimpleChain.java:118)
        at org.apache.axis.SimpleChain.invoke(SimpleChain.java:83)
        at org.apache.axis.client.AxisClient.invoke(AxisClient.java:165)
        at org.apache.axis.client.Call.invokeEngine(Call.java:2784)
        at org.apache.axis.client.Call.invoke(Call.java:2767)
        at org.apache.axis.client.Call.invoke(Call.java:2443)
        at org.apache.axis.client.Call.invoke(Call.java:2366)
        at org.apache.axis.client.Call.invoke(Call.java:1812)
        at 
de.javamagazin.attachments.FileWrapperUploadServiceClient.main(FileWrapperUploadServiceClient.java:55)
Caused by: java.io.IOException: No serializer found for class 
de.javamagazin.attachments.FileWrapper in registry [EMAIL PROTECTED]
        at 
org.apache.axis.encoding.SerializationContext.serializeActual(SerializationContext.java:1507)
        at 
org.apache.axis.encoding.SerializationContext.serialize(SerializationContext.java:980)
        at 
org.apache.axis.encoding.SerializationContext.serialize(SerializationContext.java:801)
        at org.apache.axis.message.RPCParam.serialize(RPCParam.java:208)
        at org.apache.axis.message.RPCElement.outputImpl(RPCElement.java:433)
        at 
org.apache.axis.message.MessageElement.output(MessageElement.java:1208)
        at org.apache.axis.message.SOAPBody.outputImpl(SOAPBody.java:139)
        at 
org.apache.axis.message.SOAPEnvelope.outputImpl(SOAPEnvelope.java:478)
        at 
org.apache.axis.message.MessageElement.output(MessageElement.java:1208)
        at org.apache.axis.SOAPPart.writeTo(SOAPPart.java:315)
        ... 16 more
AxisFault
 faultCode: {http://schemas.xmlsoap.org/soap/envelope/}Server.userException
 faultSubcode: 
 faultString: java.io.IOException: No serializer found for class 
de.javamagazin.attachments.FileWrapper in registry [EMAIL PROTECTED]
 faultActor: 
 faultNode: 
 faultDetail: 
        {http://xml.apache.org/axis/}stackTrace:java.io.IOException: No 
serializer found for class de.javamagazin.attachments.FileWrapper in registry 
[EMAIL PROTECTED]
        at 
org.apache.axis.encoding.SerializationContext.serializeActual(SerializationContext.java:1507)
        at 
org.apache.axis.encoding.SerializationContext.serialize(SerializationContext.java:980)
        at 
org.apache.axis.encoding.SerializationContext.serialize(SerializationContext.java:801)
        at org.apache.axis.message.RPCParam.serialize(RPCParam.java:208)
        at org.apache.axis.message.RPCElement.outputImpl(RPCElement.java:433)
        at 
org.apache.axis.message.MessageElement.output(MessageElement.java:1208)
        at org.apache.axis.message.SOAPBody.outputImpl(SOAPBody.java:139)
        at 
org.apache.axis.message.SOAPEnvelope.outputImpl(SOAPEnvelope.java:478)
        at 
org.apache.axis.message.MessageElement.output(MessageElement.java:1208)
        at org.apache.axis.SOAPPart.writeTo(SOAPPart.java:315)
        at org.apache.axis.SOAPPart.writeTo(SOAPPart.java:269)
        at org.apache.axis.SOAPPart.saveChanges(SOAPPart.java:530)
        at org.apache.axis.SOAPPart.getContentLength(SOAPPart.java:229)
        at org.apache.axis.Message.getContentLength(Message.java:510)
        at 
org.apache.axis.transport.http.HTTPSender.writeToSocket(HTTPSender.java:371)
        at org.apache.axis.transport.http.HTTPSender.invoke(HTTPSender.java:138)
        at 
org.apache.axis.strategies.InvocationStrategy.visit(InvocationStrategy.java:32)
        at org.apache.axis.SimpleChain.doVisiting(SimpleChain.java:118)
        at org.apache.axis.SimpleChain.invoke(SimpleChain.java:83)
        at org.apache.axis.client.AxisClient.invoke(AxisClient.java:165)
        at org.apache.axis.client.Call.invokeEngine(Call.java:2784)
        at org.apache.axis.client.Call.invoke(Call.java:2767)
        at org.apache.axis.client.Call.invoke(Call.java:2443)
        at org.apache.axis.client.Call.invoke(Call.java:2366)
        at org.apache.axis.client.Call.invoke(Call.java:1812)
        at 
de.javamagazin.attachments.FileWrapperUploadServiceClient.main(FileWrapperUploadServiceClient.java:55)

        {http://xml.apache.org/axis/}hostname:SAMSUNG

java.io.IOException: No serializer found for class 
de.javamagazin.attachments.FileWrapper in registry [EMAIL PROTECTED]
        at org.apache.axis.AxisFault.makeFault(AxisFault.java:101)
        at org.apache.axis.SOAPPart.writeTo(SOAPPart.java:317)
        at org.apache.axis.SOAPPart.writeTo(SOAPPart.java:269)
        at org.apache.axis.SOAPPart.saveChanges(SOAPPart.java:530)
        at org.apache.axis.SOAPPart.getContentLength(SOAPPart.java:229)
        at org.apache.axis.Message.getContentLength(Message.java:510)
        at 
org.apache.axis.transport.http.HTTPSender.writeToSocket(HTTPSender.java:371)
        at org.apache.axis.transport.http.HTTPSender.invoke(HTTPSender.java:138)
        at 
org.apache.axis.strategies.InvocationStrategy.visit(InvocationStrategy.java:32)
        at org.apache.axis.SimpleChain.doVisiting(SimpleChain.java:118)
        at org.apache.axis.SimpleChain.invoke(SimpleChain.java:83)
        at org.apache.axis.client.AxisClient.invoke(AxisClient.java:165)
        at org.apache.axis.client.Call.invokeEngine(Call.java:2784)
        at org.apache.axis.client.Call.invoke(Call.java:2767)
        at org.apache.axis.client.Call.invoke(Call.java:2443)
        at org.apache.axis.client.Call.invoke(Call.java:2366)
        at org.apache.axis.client.Call.invoke(Call.java:1812)
        at 
de.javamagazin.attachments.FileWrapperUploadServiceClient.main(FileWrapperUploadServiceClient.java:55)
Caused by: java.io.IOException: No serializer found for class 
de.javamagazin.attachments.FileWrapper in registry [EMAIL PROTECTED]
        at 
org.apache.axis.encoding.SerializationContext.serializeActual(SerializationContext.java:1507)
        at 
org.apache.axis.encoding.SerializationContext.serialize(SerializationContext.java:980)
        at 
org.apache.axis.encoding.SerializationContext.serialize(SerializationContext.java:801)
        at org.apache.axis.message.RPCParam.serialize(RPCParam.java:208)
        at org.apache.axis.message.RPCElement.outputImpl(RPCElement.java:433)
        at 
org.apache.axis.message.MessageElement.output(MessageElement.java:1208)
        at org.apache.axis.message.SOAPBody.outputImpl(SOAPBody.java:139)
        at 
org.apache.axis.message.SOAPEnvelope.outputImpl(SOAPEnvelope.java:478)
        at 
org.apache.axis.message.MessageElement.output(MessageElement.java:1208)
        at org.apache.axis.SOAPPart.writeTo(SOAPPart.java:315)
        ... 16 more
Exception in thread "main" 


Bean:

public class FileWrapper implements Serializable {

        private String name;
        
        private DataHandler handler;
        
        public FileWrapper() {
                super();
        }

        public FileWrapper(String name, DataHandler handler) {
                super();
                this.name = name;
                this.handler = handler;
        }

        public DataHandler getHandler() {
                return handler;
        }

        public void setHandler(DataHandler handler) {
                this.handler = handler;
        }

        public String getName() {
                return name;
        }

        public void setName(String name) {
                this.name = name;
        }               
}


Client:

public class FileWrapperUploadServiceClient {

        public static void main(String[] args) throws Exception {
                String filename = ".classpath";
                DataHandler dhSource = new DataHandler(new 
FileDataSource(filename));
                Service service = new Service();
                FileWrapper wrapper = new FileWrapper(filename, dhSource);
                Call call = (Call) service.createCall();
                call.setTargetEndpointAddress(new URL(
                                
"http://localhost:8081/axis/services/FileUploadService";));
                call.setOperationName(new QName("urn:FileUploadService",
                                "uploadWrapper"));
                QName qnameAttachment = new QName("urn:FileUploadService",
                                "DataHandler");
                call.registerTypeMapping(dhSource.getClass(), qnameAttachment,
                                JAFDataHandlerSerializerFactory.class,
                                JAFDataHandlerDeserializerFactory.class);
                QName qnameWrapper = new QName("urn:FileUploadService", 
"FileWrapper");
                call.registerTypeMapping(FileWrapper.class, qnameWrapper,
                                BeanSerializerFactory.class, 
BeanDeserializerFactory.class);
                call.addParameter("wrapper", qnameWrapper, ParameterMode.IN);
                call.setReturnType(XMLType.AXIS_VOID);
                call.setProperty(Call.ATTACHMENT_ENCAPSULATION_FORMAT,
                                Call.ATTACHMENT_ENCAPSULATION_FORMAT_MIME);
                call.setOperationStyle(Style.WRAPPED);
//              call.setOperationUse(Use.LITERAL);              
                long start = System.currentTimeMillis();
                call.invoke(new Object[] { wrapper });
                long end = System.currentTimeMillis();
                System.out.println(end - start);
        }
}


Best regards
Dapeng


-- 


Der GMX SmartSurfer hilft bis zu 70% Ihrer Onlinekosten zu sparen!
Ideal für Modem und ISDN: http://www.gmx.net/de/go/smartsurfer

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to