Click here to Skip to main content
15,891,136 members
Please Sign up or sign in to vote.
4.00/5 (1 vote)
See more:
Hello There! Good Morning!

I'm with a problem here.
I have to send a XML through a WebService.
This XML must be compressed on a ZLib format, and then put on Base64 format.

Until here, everything is OK.

when I send this XML and the structure and the information is wrong I receive the a small return saying me what is wrong, and this is working fine.

My problem is when I send everything right and I should receive another XML that's contains important information for me, I receive just part of the XML.


But after some tests, I realized that when I receive the answer. I got only a part of it. The return XML is cut in a random place. Like if the communication was ended before have finished. I receive all time around 4-6ko. The size is not constant.

I thought about a network problem. I have tested in another network, is the same.

I add a timeout on my side but nothing change.

I really don't know what more to try.

Here go my codes:

Java
public String envioWs(String msg){
    try{
        String urlWS = "URL";
        Object[] params = {geraMsgComp(msg)};

        Service service = new Service();
        Call call = (Call) service.createCall();

        call.setTargetEndpointAddress(urlWS);
        call.setOperationName("OPERATION");
        //call.setTimeout(new Integer(999999999));

        String ret = (String) call.invoke(params);

        ret = geraString(ret.getBytes());

        return ret;
    }
    catch(Exception ex){
        ex.printStackTrace();
        return null;
    }
}


The method "geraMsgComp" just compressed the XML on a ZLib format, and then put on Base64 format, the method "geraString" does exactly the reversion.

any ideas???

Thanks for your future advises.
Posted

1 solution

Hello There!!

I have found the error.
It wasn't in this part of the code, it was in the ZLib class, the decompress method.
It was setting a limit to the size of the string to decompress.

Thanks for all who had tried.

Ray
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900