Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: Java WebService WSDL
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:
 
    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 14-Jan-13 4:08am

1 solution

Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

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
  Permalink  

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



Advertise | Privacy | Mobile
Web01 | 2.8.1411022.1 | Last Updated 17 Jan 2013
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100