greenstone.org greenstone wiki greenstone trac planet greenstone

Changeset 16761

Show
Ignore:
Timestamp:
2008-08-13 14:49:47 (5 months ago)
Author:
ak19
Message:

Changed processInternal(), keeping it in sync with older change made to official QBRSOAPServer.java.in in Greenstone3 checkout. Now this method does not return a prettyString version of the response, but instead trims the response so there's no whitespace (illegal in XML) and prepends the official xml tag to the response

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • other-projects/trunk/gs3-webservices-democlient/src/GS3DemoClient/org/greenstone/gs3services/AdminSOAPServer.java

    r16759 r16761  
    266266 
    267267                // Return it as a String formatted for display 
    268                 return this.converter.getPrettyString(response); 
     268                //return this.converter.getPrettyString(response); 
     269                 
     270                // In order to avoid "Content is not allowed in prolog" exception on the  
     271                // web services' client end (problem encountered in GS mailing list), need  
     272                // to make sure no characters (incl spaces) preceed the XML sent back  
     273                // from here. It may also require the <?xml?> tag at the very start. 
     274                if(responseMsg.charAt(0) == ' ') { 
     275                    responseMsg = responseMsg.trim(); 
     276                } 
     277                 
     278                return "<?xml version=\"1.0\" encoding=\"utf-8\"?>"+responseMsg; 
    269279        } 
    270280         
  • other-projects/trunk/gs3-webservices-democlient/src/GS3DemoClient/org/greenstone/gs3services/QBRSOAPServer.java

    r16759 r16761  
    732732                     // otherwise, MR always returns some response 
    733733 
    734                 // Return it as a String formatted for display 
    735                 return this.converter.getPrettyString(response); 
     734                // In order to avoid "Content is not allowed in prolog" exception on the  
     735                // web services' client end (problem encountered in GS mailing list), need  
     736                // to make sure no characters (incl spaces) preceed the XML sent back  
     737                // from here. It may also require the <?xml?> tag at the very start. 
     738                if(responseMsg.charAt(0) == ' ') { 
     739                    responseMsg = responseMsg.trim(); 
     740                } 
     741                 
     742                return "<?xml version=\"1.0\" encoding=\"utf-8\"?>"+responseMsg; 
     743 
    736744        } 
    737745