And i solved my problem again :-p

I couldnt create stubs from my wsdl because mail.jar wasnt in my classpath. I thought i had set it but looks like i didn't.
When i use the stubs I can send large files without problems.

greetings
Dave



Dave wrote:
Hi,

I have deployed an axis webservice wich accepts an attachment and just returns it. The client sends a file, asks it back and writes the recieved file to the hd. This works fine for files not bigger then 1Mb. When i try to send a file that is bigger then 1Mb i get this exception:


java.lang.RuntimeException: java.io.IOException: End of physical stream detected when 10 more bytes expected.AxisFault
 faultCode: {http://schemas.xmlsoap.org/soap/envelope/}Server.userException
 faultSubcode:
faultString: java.io.IOException: End of physical stream detected when 10 more bytes expected.
 faultActor:
 faultNode:
 faultDetail:
{http://xml.apache.org/axis/}stackTrace:java.io.IOException: End of physical stream detected when 10 more bytes expected.


When i try to send another file, also bigger then 1Mb, the fault says "End of physical stream detected when 25 more bytes expected.AxisFault" Looks like the stream is cut off to early, but why and what can I do about it?

I've read that axis can send files up to 4gigabyte so i have no id why i get an exception for 1Mb...


Some extra info:
axis1.3
jakarta-tomcat-4.1.31
I have al the jars in my classpath that i need.
I manualy create a wsdd file to deploy my service. I do not use the WSDL2java and Java2WSDL tools because those tools cant create stubs from my wsdl, but thats another story...

The service code:

    public class Service{
    public DataHandler echo(DataHandler dh) {
    return dh;
    }

The client code:

URL url=new URL("http://localhost:8080/axis/services/urn:AttachmentTestService";); File file = new File("C:"+File.separator+"image.jpg");
    DataHandler dhSource=new DataHandler(new FileDataSource(file));
Service service = new Service();
    Call call = (Call) service.createCall();
    call.setTargetEndpointAddress(url);
    call.setOperationName(new QName("urn:AttachmentTestService", "echo"));
QName qnameAttachment = new QName("urn:AttachmentTestService", "DataHandler"); call.registerTypeMapping(dhSource.getClass(), qnameAttachment, JAFDataHandlerSerializerFactory.class, JAFDataHandlerDeserializerFactory.class);
    call.addParameter("source", qnameAttachment,  ParameterMode.IN);
    call.setReturnType(qnameAttachment);
call.setProperty(call.ATTACHMENT_ENCAPSULATION_FORMAT, call.ATTACHMENT_ENCAPSULATION_FORMAT_DIME);
    Object ret = call.invoke(new Object[]{dhSource});
BufferedOutputStream bos=new BufferedOutputStream(new FileOutputStream("c:\\test.jpg"));
    DataHandler rdh = (DataHandler) ret;
    rdh.writeTo(bos);
System.out.println(dhSource.getName());
    System.out.println(rdh.getName());
Is hope there's someone who can help me with this problem...

thx
greetings
Dave



Reply via email to