Response Document:"The invocation resulted in an error: Length  Required"

Hi sirs,
I'm new to OSB. After try some lab test, i try to import a real web service.
Web service is http://www.webservicex.net/globalweather.asmx?WSDL
I copy whole XML file and create a WSDL file. Then import to OSB and then create a Business service using this WSDL resource.
Then i test the Business Service. The test show:
==============================================================
<soap:Envelope      xmlns:soap="http://www.w3.org/2003/05/soap-envelope">
<soap:Header>
</soap:Header>
<soap:Body>
<web:GetCitiesByCountry      xmlns:web="http://www.webserviceX.NET">
<!--Optional:-->
<web:CountryName>spain</web:CountryName>
</web:GetCitiesByCountry>
</soap:Body>
</soap:Envelope>
====================================================================
     Response Document     
The invocation resulted in an error: Length Required.
=========================================================================
     Response Metadata
<con:metadata      xmlns:con="http://www.bea.com/wli/sb/test/config">
<tran:headers      xsi:type="http:HttpResponseHeaders" xmlns:http="http://www.bea.com/wli/sb/transports/http" xmlns:tran="http://www.bea.com/wli/sb/transports" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<http:Connection>close</http:Connection>
<http:Content-Length>344</http:Content-Length>
<http:Content-Type>text/html; charset=us-ascii</http:Content-Type>
<http:Date>Sat, 05 Nov 2011 04:20:50 GMT</http:Date>
<http:Server>Microsoft-HTTPAPI/2.0</http:Server>
</tran:headers>
<tran:response-code      xmlns:tran="http://www.bea.com/wli/sb/transports">1</tran:response-code>
<tran:response-message      xmlns:tran="http://www.bea.com/wli/sb/transports">Length Required</tran:response-message>
<tran:encoding      xmlns:tran="http://www.bea.com/wli/sb/transports">us-ascii</tran:encoding>
<http:http-response-code      xmlns:http="http://www.bea.com/wli/sb/transports/http">411</http:http-response-code>
</con:metadata>
============
I try with a SOAPUI with a same request XML and it works. I stuck with this 2 weeks. Please help me.
Thank for watching.

Disable the "Use Chunked Streaming Mode" property in HTTP Transport Configuration of your business service. By default it remains enabled.
Regards,
Anuj

Similar Messages

  • SFTP: The invocation resulted in an error: java.util.NoSuchElementException

    I have created a business service using the SFTP protocol.
    When testing the BS, I received the "known_hosts doesn't exist or doesn't have read permission" error, which I resolve by placing the known_host file in $Domain_Home\config\osb\transports\sftp
    But now I have got another error "The invocation resulted in an error: java.util.NoSuchElementException". Does anyone know what this error refers to? I have already set the filename through the transport header.

    I have created a business service using the SFTP protocol.
    When testing the BS, I received the "known_hosts doesn't exist or doesn't have read permission" error, which I resolve by placing the known_host file in $Domain_Home\config\osb\transports\sftp
    But now I have got another error "The invocation resulted in an error: java.util.NoSuchElementException". Does anyone know what this error refers to? I have already set the filename through the transport header.

  • The invocation resulted in an error: java.util.NoSuchElementException

    I am trying to implement sftp protcol for oracle service bus using business service.
    While invocation it is throwing "The invocation resulted in an error: java.util.NoSuchElementException" error.
    Does any one know the reason for it?

    known_hosts file must contain data & hostname and IP address must be separated by a comma.
    e.g. localhost,127.0.0.1 ssh-rsa ABCDEF............==
    Regards,
    Anuj

  • SFTP Issue in OSB invocation resulted in an error: java.util.NoSuchElement

    I created a Proxy Service to do SFTP Poll to read the file from abcserver and its working fine .
    (OSB is on abc server).
    known_hosts file is present on OSB server.
    It has abcserverhostname,IP ssh-rsa AA................. ==
    I created a business service to do SFTP Write to xyz server (remote) - Its not working.
    Error : The invocation resulted in an error: java.util.NoSuchElementException.
    My Business Service
    End Point URI : sftp://xyzserverhostname:22/directorypath
    Authetication Mode : user name, password.I have created a Service Account for xyz server and imported in Business Service.
    Later, I created business service to do SFTP Write on abc server (same server) and it failed.*
    Error : The invocation resulted in an error: java.util.NoSuchElementException
    Do I need to give anything else in known_hosts file ?
    OSBServer.log
    *<Error> <SFTPTransport> <OSBServer> <[ACTIVE] ExecuteThread: '4' for queue: 'weblogic.kernel.Default (self-tuning)'> <<anonymous>> <> <db432d7c09c5a041:4295b211:1310705fe8e:-8000-000000000001f312> <1311176892037> <BEA-381801> <Error occured for endpoint java.util.NoSuchElementException*
    java.util.NoSuchElementException
    at java.util.StringTokenizer.nextToken(StringTokenizer.java:183)
    at java.util.StringTokenizer.nextElement(StringTokenizer.java:149)
    at com.bea.wli.sb.transports.sftp.client.KnownHostVerifier.validateKnownHosts(KnownHostVerifier.java:102)
    at com.bea.wli.sb.transports.sftp.client.SFTPClient.authenticate(SFTPClient.java:104)
    at com.bea.wli.sb.transports.sftp.connector.SFTPResource.<init>(SFTPResource.java:77)
    at com.bea.wli.sb.transports.sftp.resource.SFTPUtils.createSFTPResource(SFTPUtils.java:170)
    at com.bea.wli.sb.transports.sftp.resource.SFTPConnectionPool.getResource(SFTPConnectionPool.java:104)
    at com.bea.wli.sb.transports.sftp.connector.SFTPTransportProvider.getSFTPResource(SFTPTransportProvider.java:958)
    at com.bea.wli.sb.transports.sftp.connector.SFTPTransportProvider.sendMessage(SFTPTransportProvider.java:145)
    at com.bea.wli.sb.transports.sftp.connector.SFTPTransportProvider.sendMessageAsync(SFTPTransportProvider.java:110)
    at sun.reflect.GeneratedMethodAccessor4031.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:37)
    at java.lang.reflect.Method.invoke(Method.java:611)
    at com.bea.wli.sb.transports.Util$1.invoke(Util.java:83)
    at $Proxy142.sendMessageAsync(Unknown Source)
    at com.bea.wli.sb.transports.LoadBalanceFailoverListener.sendMessageAsync(LoadBalanceFailoverListener.java:148)
    at com.bea.wli.sb.transports.LoadBalanceFailoverListener.sendMessageToServiceAsync(LoadBalanceFailoverListener.java:603)
    at com.bea.wli.sb.transports.LoadBalanceFailoverListener.sendMessageToService(LoadBalanceFailoverListener.java:538)
    at com.bea.wli.sb.transports.TransportManagerImpl.sendMessageToService(TransportManagerImpl.java:558)
    at com.bea.wli.sb.transports.TransportManagerImpl.sendMessageAsync(TransportManagerImpl.java:426)
    at com.bea.wli.sb.test.service.ServiceMessageSender.send0(ServiceMessageSender.java:380)
    at com.bea.wli.sb.test.service.ServiceMessageSender.access$000(ServiceMessageSender.java:79)
    at com.bea.wli.sb.test.service.ServiceMessageSender$1.run(ServiceMessageSender.java:137)
    at com.bea.wli.sb.test.service.ServiceMessageSender$1.run(ServiceMessageSender.java:135)
    at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:363)
    at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:146)
    at com.bea.wli.sb.security.WLSSecurityContextService.runAs(WLSSecurityContextService.java:55)
    at com.bea.wli.sb.test.service.ServiceMessageSender.send(ServiceMessageSender.java:140)
    at com.bea.wli.sb.test.service.ServiceProcessor.invoke(ServiceProcessor.java:454)
    at com.bea.wli.sb.test.TestServiceImpl.invoke(TestServiceImpl.java:172)
    at com.bea.wli.sb.test.client.ejb.TestServiceEJBBean.invoke(TestServiceEJBBean.java:167)
    at com.bea.wli.sb.test.client.ejb.TestService_sqr59p_EOImpl.__WL_invoke(Unknown Source)
    at weblogic.ejb.container.internal.SessionRemoteMethodInvoker.invoke(SessionRemoteMethodInvoker.java:40)
    at com.bea.wli.sb.test.client.ejb.TestService_sqr59p_EOImpl.invoke(Unknown Source)
    at com.bea.wli.sb.test.client.ejb.TestService_sqr59p_EOImpl_WLSkel.invoke(Unknown Source)
    at weblogic.rmi.internal.BasicServerRef.invoke(BasicServerRef.java:667)
    at weblogic.rmi.cluster.ClusterableServerRef.invoke(ClusterableServerRef.java:230)
    at weblogic.rmi.internal.BasicServerRef$1.run(BasicServerRef.java:522)
    at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:363)
    at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:146)
    at weblogic.rmi.internal.BasicServerRef.handleRequest(BasicServerRef.java:518)
    at weblogic.rmi.internal.wls.WLSExecuteRequest.run(WLSExecuteRequest.java:118)
    at weblogic.work.ExecuteThread.execute(ExecuteThread.java:207)
    at weblogic.work.ExecuteThread.run(ExecuteThread.java:176)
    Thanks
    Edited by: soauser on Jul 25, 2011 3:22 PM

    Patrick,
    I apologize. polling was done by some other service, not my current OSB Service.
    OSB Proxy Service to poll/read data is not working.
    I enabled logging to Error in Proxy Service. and enable tracing
    If I test my Proxy Service from Console. I see this message
    <con:metadata      xmlns:con="http://www.bea.com/wli/sb/test/config">
         <tran:response-code      xmlns:tran="http://www.bea.com/wli/sb/transports">0</tran:response-code>
         </con:metadata>
    tail -f OSBServer.log
    <Error> <WliSbTransports> <OSBServer> <pool-20-thread-1> <weblogic> <> <db432d7c09c5a041:1f5dbb0e:1314411cf6c:-8000-000000000000213c> <1311178504443> <BEA-381602> <Error encountered while polling the resource for the service endpoint ProxyService$SFTPFileTesting$SFTPFilePoll: com.bea.wli.sb.transports.TransportException
    com.bea.wli.sb.transports.TransportException
    at com.bea.wli.sb.transports.sftp.connector.SFTPWorkPartitioningAgent.execute(SFTPWorkPartitioningAgent.java:125)
    at com.bea.wli.sb.transports.poller.TransportTimerListener.run(TransportTimerListener.java:74)
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:452)
    at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:314)
    at java.util.concurrent.FutureTask.run(FutureTask.java:149)
    at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:109)
    at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:215)
    at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:897)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:919)
    at java.lang.Thread.run(Thread.java:736)
    Caused By: java.util.NoSuchElementException
    at java.util.StringTokenizer.nextToken(StringTokenizer.java:183)
    at java.util.StringTokenizer.nextElement(StringTokenizer.java:149)
    at com.bea.wli.sb.transports.sftp.client.KnownHostVerifier.validateKnownHosts(KnownHostVerifier.java:102)
    at com.bea.wli.sb.transports.sftp.client.SFTPClient.authenticate(SFTPClient.java:104)
    at com.bea.wli.sb.transports.sftp.connector.SFTPResource.<init>(SFTPResource.java:77)
    at com.bea.wli.sb.transports.sftp.resource.SFTPUtils.createSFTPResource(SFTPUtils.java:170)
    at com.bea.wli.sb.transports.sftp.connector.SFTPWorkPartitioningAgent.getSftpResource(SFTPWorkPartitioningAgent.java:148)
    at com.bea.wli.sb.transports.sftp.connector.SFTPWorkPartitioningAgent.execute(SFTPWorkPartitioningAgent.java:58)
    at com.bea.wli.sb.transports.poller.TransportTimerListener.run(TransportTimerListener.java:74)
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:452)
    at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:314)
    at java.util.concurrent.FutureTask.run(FutureTask.java:149)
    at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:109)
    at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:215)
    at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:897)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:919)
    at java.lang.Thread.run(Thread.java:736)
    Edited by: soauser on Jul 20, 2011 9:36 AM
    Edited by: soauser on Jul 25, 2011 3:22 PM

  • SFTP Issue in OSB invocation resulted in an error: com.maverick.ssh.SshException: ssh-dss Key Not Found for host hostname,ip

    I created a Proxy Service to do pull file and push it to sftp server
    known_hosts file is present on OSB server.
    It has abcserverhostname,IP ssh-rsa AA................. ==
    I created a business service to do SFTP push to sftp server (remote) - Its not working.
    <Error> <SFTPTransport> <BEA-381826> <Key Not Found for host hostname,10.124....>
    com.maverick.ssh.SshException: ssh-dss Key Not Found for host hostname,10.124.....
      at com.bea.wli.sb.transports.sftp.client.KnownHostVerifier.onUnknownHost(KnownHostVerifier.java:37)
    My Business Service
    End Point URI : sftp://sftpserverhostname:22/directorypath
    Authetication Mode : user name, password.I have created a Service Account for sftpserver and imported in Business Service.
    Do I need to give anything else in known_hosts file ?
    and hostname can be any random name?
    <Dec 11, 2013 1:45:37 PM GMT+08:00> <Error> <SFTPTransport> <BEA-381801> <Error occured for endpoint com.bea.wli.sb.transports.TransportException: com.maverick.ssh.SshException: ssh-dss Key Not Found for host hostname,10.124....
    com.bea.wli.sb.transports.TransportException: com.maverick.ssh.SshException: ssh-dss Key Not Found for host
      at com.bea.wli.sb.transports.sftp.connector.SFTPTransportProvider.sendMessage(SFTPTransportProvider.java:161)
      at com.bea.wli.sb.transports.sftp.connector.SFTPTransportProvider.sendMessageAsync(SFTPTransportProvider.java:111)
      at sun.reflect.GeneratedMethodAccessor566.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:597)
      Truncated. see log file for complete stacktrace
    Caused By: com.maverick.ssh.SshException: ssh-dss Key Not Found for host eirnode2,10.124.10.16
      at com.bea.wli.sb.transports.sftp.client.KnownHostVerifier.onUnknownHost(KnownHostVerifier.java:37)
      at com.sshtools.publickey.AbstractKnownHostsKeyVerification.A(Unknown Source)
      at com.sshtools.publickey.AbstractKnownHostsKeyVerification.verifyHost(Unknown Source)
      at com.maverick.ssh2.TransportProtocol.C(Unknown Source)
      at com.maverick.ssh2.TransportProtocol.processMessage(Unknown Source)
      Truncated. see log file for complete stacktrace

    BEA-381826 suggest that there is any issue with your public key in known_host file, can you cross verify it again. Also can you check if known_host file has appropriate permissions and I am assuming it is in /OSB_DOMAIN/osb/transports/sftp folder.
    Hostname,IP algorithm publickey are the hostname, ip, and public key of SFTP server.
    As per troubleshooting guidelines
    The Key not found for IP, host error message indicates that the known_hosts file does not contain an entry that corresponds to the specified IP-host combination. If the entry exists, then try with another algorithm key; for example, if the earlier attempt was with an RSA key, try again with a DSA key.
    Cheers,
    Sahil

  • Hyper-v replication Error Hyper-V received a digital certificate that is not valid from the Replica server 'burstingreplica'. Error: A required certificate is not within its validity period when verifying against the current system clock or the timestamp"

    Hi,
    When trying to initiate hyper-v replication from the main server i'm getting this error in the event logs.
    Hyper-V failed to enable replication for virtual machine 'RECADemo': A required certificate is not within its validity period when verifying against the current system clock or the timestamp in the signed file. (0x800B0101). (Virtual Machine ID 561591B6-567C-...)--I'm using certificate based auth and cert is installed/recognized on both machines.Please help.Thanks,Jaffer
    Jaf

    Hi,
    This error occurs because the Microsoft Certificate Trust List Publisher certificate expired. A copy of the CTL with an expired signing certificate exists in the CryptnetUrlCache
    folder. Please try to renew the Trust List Publisher certificate.
    The related KB:
    Event ID 4107 or Event ID 11 is logged in the Application log in Windows and in Windows Server
    http://support.microsoft.com/kb/2328240
    How to Renew the Site Server Signing Certificate (Microsoft Certificate Services)
    http://blogs.technet.com/b/configmgrteam/archive/2009/02/11/how-to-renew-the-site-server-signing-certificate-microsoft-certificate-services.aspx
    Manage Trusted Publishers
    http://technet.microsoft.com/en-us/library/cc733026.aspx
    Hope this helps.
    We
    are trying to better understand customer views on social support experience, so your participation in this
    interview project would be greatly appreciated if you have time.
    Thanks for helping make community forums a great place.

  • RDS 2012 R2: A timeout (30000 milliseconds) was reached while waiting for a transaction response from the (name-of-service) service

    Hi guys,
    On a random base (daily, weekly) we're experiencing major log-in problems on our Windows Server 2012 R2 Remote Desktop Services farm. The VM's are hosted on Hyper-V 2008 hosts and we're not using Citrix techniques etc.
    Users are reporting that they cannot log-in, the log-in sessions hangs with a blank screen when loading their user profile (e.g. Please Wait For The User Profile Service).
    In the System event log of the server on which the user is logging on the following errors are shown:
    Source:        Service Control Manager
    Date:          23-12-2014 7:28:01
    Event ID:      7011
    Task Category: None
    Level:         Error
    Keywords:      Classic
    User:          N/A
    Description:
    A timeout (30000 milliseconds) was reached while waiting for a transaction response from the UmRdpService service.
    …and after 30 (or sometimes 60) seconds, the same error only another service (in random order):
    A timeout (30000 milliseconds) was reached while waiting for a transaction response from the UmRdpService service.
    …and after exactly 30 seconds, the same error only another service:
    A timeout (30000 milliseconds) was reached while waiting for a transaction response from the UxmSms service.
    etcetera, with the following errors:
    A timeout (30000 milliseconds) was reached while waiting for a transaction response from the Netman service.
    A timeout (30000 milliseconds) was reached while waiting for a transaction response from the AudioEndPointBuilder service.
    A timeout (30000 milliseconds) was reached while waiting for a transaction response from the WPDBusEnum service.
    A timeout (30000 milliseconds) was reached while waiting for a transaction response from the NlaSvc service.
    The Portable Device Enumerator Service service failed to start due to the following error:
    The service did not respond to the start or control request in a timely fashion.
    A timeout (30000 milliseconds) was reached while waiting for a transaction response from the TrkWks service.
    A timeout (30000 milliseconds) was reached while waiting for a transaction response from the UmRdpService service.
    These errors are logged continuously.
    An administrator cannot solve this since he isn't able to login in as well (console or remotely), only a hard reset of the VM is possible to use the affected server again.
    I took different steps to solve this problem without any success, like:
    - Installing the latest Windows updates
    - Removed unnecessary printer drivers, print monitors and print processors (no local printers/drivers are installed, only Remote Desktop Easy Printer driver is used)
    - Searched different forum posts, but found only hotfixes for Windows Server 2008 R2.
    Can someone please help me with this annoying problem?
    Many thanks!!
    EDIT:
    Of course is increasing the time-out not really an option here... http://social.technet.microsoft.com/wiki/contents/articles/13765.event-id-7011-service-timeout.aspx

    Hi Jeroentjuhh,
    1)Do you see this problem on all VM's or only on Windows 2012 R2 server?
    2)Are these VMs' in hyper-v cluster?
    3)Do you see event id 56 or 50? Please see the below link if it helps you to resolve these events.
    http://blogs.msdn.com/b/scstr/archive/2012/02/29/how-to-troubleshoot-the-terminal-server-security-layer-detected-an-error-in-the-protocol-stream-and-has-disconnected-the-client-client-ip-and-the-rdp-protocol-component-x-224-detected-an-error-in-the-protocol-stream-and-has-d.aspx
    Thanks,
    Umesh.S.K

  • Issue: Not getting response when the document is having special chars

    Please help following issue: Not getting response when the document is having special chars(Use any doc with special char(ex: &, $, <, >,.....) TestErrorFour.doc
    Error message:
    System.FormatException: Invalid length for a Base-64 char array. at
    System.Convert.FromBase64String(String s) at
    Summarize.Summarizer.AccumulateBroadcast(String filedata, String givenWords) in
    c:\DocumentSummarizer\App_Code\Summarizer.cs:line 66
    Code:
    File 1:
    import java.io.BufferedReader;
    import java.io.FileInputStream;
    import java.io.FileNotFoundException;
    import java.io.FileReader;
    import java.io.IOException;
    import java.io.InputStreamReader;
    import java.io.OutputStream;
    import java.net.HttpURLConnection;
    import java.net.URL;
    import java.net.URLConnection;
    import java.util.Properties;
    import org.apache.poi.poifs.filesystem.POIFSFileSystem;
    import org.apache.poi.hwpf.*;
    import org.apache.poi.hwpf.extractor.*;
    import com.lowagie.text.Document;
    import com.lowagie.text.pdf.PRTokeniser;
    import com.lowagie.text.pdf.PdfReader;
    public class DocumentSummarizerClient {
         static Properties loadProperties() {
              Properties prop = new Properties();
              try {
                   prop.load(DocumentSummarizerClient.class.getClassLoader().getResourceAsStream("vep.properties"));
              } catch (Exception ioe) {
                   ioe.printStackTrace();
              return prop;
         public String getSummary(String fileName,String noOfWordsOrPercentage ){
              String summaryInputData ="";
              String summarizedData="";
              String summarizerURL = loadProperties().getProperty("Summarizer.serviceURL");
              try {
                   String fileExtension=fileName.substring(fileName.lastIndexOf(".")+1, fileName.length());
                   if (fileExtension.equalsIgnoreCase("doc")|| fileExtension.equalsIgnoreCase("txt")|| fileExtension.equalsIgnoreCase("pdf")) {
                                  if (fileExtension.equalsIgnoreCase("txt")) {
                                       BufferedReader bufferedReader = new BufferedReader(
                                                 new FileReader(fileName));
                                       String line = null;
                                       while ((line = bufferedReader.readLine()) != null) {
                                            summaryInputData += line;
                                  if(fileExtension.equalsIgnoreCase("doc")){
                                       POIFSFileSystem fs = null;
                                        fs = new POIFSFileSystem(new FileInputStream(fileName));
                                         HWPFDocument doc = new HWPFDocument(fs);
                                         WordExtractor we = new WordExtractor(doc);
                                         String[] paragraphs = we.getParagraphText();
                                         for( int i=0; i<paragraphs .length; i++ ) {
                                            paragraphs[i] = paragraphs.replaceAll("\\cM?\r?\n","");
                                  summaryInputData+= paragraphs[i];
                                  if(fileExtension.equalsIgnoreCase("pdf")){
                                       Document document = new Document();
                   document.open();
                   PdfReader reader = new PdfReader(fileName);
                   int pageCount =reader.getNumberOfPages();
                        for(int i=1;i<=pageCount;i++){
                                  byte[] bytes = reader.getPageContent(i);
                                  PRTokeniser tokenizer = new PRTokeniser(bytes);
                                  StringBuffer buffer = new StringBuffer();
                                  while (tokenizer.nextToken()) {
                                  if (tokenizer.getTokenType() == PRTokeniser.TK_STRING) {
                                  buffer.append(tokenizer.getStringValue());
                                  summaryInputData += buffer.toString();
                   else{
                        System.out.println("This is Invalid document. Presntly we support only text,word and PDF documents ");
                   // String encoded =new String (summaryInputData.getBytes("ISO-8859-1"),"UTF-8");
                        String encoded=Base64Utils.base64Encode(summaryInputData.getBytes());
                   // encoded =new String (summaryInputData.getBytes("ISO-8859-1"),"UTF-8");
                        String parameters= "base64String="+encoded+"&noOfWordsOrPercentage="+noOfWordsOrPercentage;
                        summarizedData= postRequest(parameters,summarizerURL);
                        String slength= "<string xmlns=\"http://tempuri.org/\">";
                        if(summarizedData.contains("</string>")){
                        summarizedData= summarizedData.substring(summarizedData.indexOf(slength)+slength.length(),summarizedData.indexOf("</string>"));
                        summarizedData = replaceVal(summarizedData);
                        //System.out.println("<?xml version=\"1.0\" encoding=\"utf-8\"?><![CDATA["+summarizedData+"]]>");
                        // System.out.println("Summarized data "+summarizedData);
                        if(summarizedData.contains("Please enter the percentage")){
                             summarizedData="Data given cannot be summarized further";
                   else{
                        System.out.println("Data given cannot be summarized further");
                        summarizedData="";
              } catch (FileNotFoundException e) {
                   return("The File is not found \n\n"+e.toString());
              } catch (IOException e) {
                   return("The File is already in use \n\n"+e.toString());
              } catch (Exception e) {
                   return(e.toString());
              return summarizedData;
         public static String postRequest(String parameters,String webServiceURL) throws Exception{
              Properties systemSettings = System.getProperties();
              systemSettings.put("http.proxyHost", loadProperties().getProperty("proxyHost"));
         systemSettings.put("http.proxyPort", loadProperties().getProperty("proxyPort"));
         System.setProperties(systemSettings);
              String responseXML = "";
              try {
                   URL url = new URL(webServiceURL);
                   URLConnection connection = url.openConnection();
                   HttpURLConnection httpConn = (HttpURLConnection) connection;
                   byte[] requestXML = parameters.getBytes();
                   httpConn.setRequestProperty("Content-Length", String
                             .valueOf(requestXML.length));
                   httpConn.setRequestProperty("Content-Type",
                             "application/x-www-form-urlencoded");
                   httpConn.setRequestMethod("POST");
                   httpConn.setDoOutput(true);
                   httpConn.setDoInput(true);
                   OutputStream out = httpConn.getOutputStream();
                   out.write(requestXML, 0, requestXML.length);
                   out.close();
                   InputStreamReader isr = new InputStreamReader(httpConn
                             .getInputStream());
                   BufferedReader br = new BufferedReader(isr);
                   String temp;
                   String tempResponse = "";
                   while ((temp = br.readLine()) != null)
                        tempResponse = tempResponse + temp;
                   responseXML = tempResponse;
                   br.close();
                   isr.close();
              } catch (java.net.MalformedURLException e) {
                   System.out
                             .println("Error in postRequest(): Secure Service Required");
              } catch (Exception e) {
                   System.out.println("Error in postRequest(): " + e.getMessage());
              return responseXML;
         public String replaceVal(String value) {
                   if (value == null) {
                        value = "";
                   value = value.replace("&lt;", "<");
                   value = value.replace("&gt;", ">");
                   value = value.replace("&amp;", "&");
                   return value;
              public static void main(String[] args) {  
                   DocumentSummarizerClient testdoc=new DocumentSummarizerClient();
                   System.out.println("hello");               
                   testdoc.getSummary("C:\\working_folder\\vep\\UnitTestCases\\VEP1.0\\DocumentSummarizerTestData\\TestErrorFour.doc","100%");     
    Note: Use any doc with special char(ex: &, $, <, >,.....) TestErrorFour.doc
    File 2:
    ---------public class Base64Utils {
    private static byte[] mBase64EncMap, mBase64DecMap;
    * Class initializer. Initializes the Base64 alphabet (specified in RFC-2045).
    static {
    byte[] base64Map = {
    (byte)'A', (byte)'B', (byte)'C', (byte)'D', (byte)'E', (byte)'F',
    (byte)'G', (byte)'H', (byte)'I', (byte)'J', (byte)'K', (byte)'L',
    (byte)'M', (byte)'N', (byte)'O', (byte)'P', (byte)'Q', (byte)'R',
    (byte)'S', (byte)'T', (byte)'U', (byte)'V', (byte)'W', (byte)'X',
    (byte)'Y', (byte)'Z',
    (byte)'a', (byte)'b', (byte)'c', (byte)'d', (byte)'e', (byte)'f',
    (byte)'g', (byte)'h', (byte)'i', (byte)'j', (byte)'k', (byte)'l',
    (byte)'m', (byte)'n', (byte)'o', (byte)'p', (byte)'q', (byte)'r',
    (byte)'s', (byte)'t', (byte)'u', (byte)'v', (byte)'w', (byte)'x',
    (byte)'y', (byte)'z',
    (byte)'0', (byte)'1', (byte)'2', (byte)'3', (byte)'4', (byte)'5',
    (byte)'6', (byte)'7', (byte)'8', (byte)'9', (byte)'+', (byte)'/'};
    mBase64EncMap = base64Map;
    mBase64DecMap = new byte[128];
    for (int i=0; i<mBase64EncMap.length; i++)
    mBase64DecMap[mBase64EncMap[i]] = (byte) i;
    * This class isn't meant to be instantiated.
    private Base64Utils() {
    * Encodes the given byte[] using the Base64-encoding,
    * as specified in RFC-2045 (Section 6.8).
    * @param aData the data to be encoded
    * @return the Base64-encoded <var>aData</var>
    * @exception IllegalArgumentException if NULL or empty array is passed
    public static String base64Encode(byte[] aData) {
    if ((aData == null) || (aData.length == 0))
    throw new IllegalArgumentException("Can not encode NULL or empty byte array.");
    byte encodedBuf[] = new byte[((aData.length+2)/3)*4];
    // 3-byte to 4-byte conversion
    int srcIndex, destIndex;
    for (srcIndex=0, destIndex=0; srcIndex < aData.length-2; srcIndex += 3) {
    encodedBuf[destIndex++] = mBase64EncMap[(aData[srcIndex] >>> 2) & 077];
    encodedBuf[destIndex++] = mBase64EncMap[(aData[srcIndex+1] >>> 4) & 017 |
    (aData[srcIndex] << 4) & 077];
    encodedBuf[destIndex++] = mBase64EncMap[(aData[srcIndex+2] >>> 6) & 003 |
    (aData[srcIndex+1] << 2) & 077];
    encodedBuf[destIndex++] = mBase64EncMap[aData[srcIndex+2] & 077];
    // Convert the last 1 or 2 bytes
    if (srcIndex < aData.length) {
    encodedBuf[destIndex++] = mBase64EncMap[(aData[srcIndex] >>> 2) & 077];
    if (srcIndex < aData.length-1) {
    encodedBuf[destIndex++] = mBase64EncMap[(aData[srcIndex+1] >>> 4) & 017 |
    (aData[srcIndex] << 4) & 077];
    encodedBuf[destIndex++] = mBase64EncMap[(aData[srcIndex+1] << 2) & 077];
    else {
    encodedBuf[destIndex++] = mBase64EncMap[(aData[srcIndex] << 4) & 077];
    // Add padding to the end of encoded data
    while (destIndex < encodedBuf.length) {
    encodedBuf[destIndex] = (byte) '=';
    destIndex++;
    String result = new String(encodedBuf);
    return result;
    * Decodes the given Base64-encoded data,
    * as specified in RFC-2045 (Section 6.8).
    * @param aData the Base64-encoded aData.
    * @return the decoded <var>aData</var>.
    * @exception IllegalArgumentException if NULL or empty data is passed
    public static byte[] base64Decode(String aData) {
    if ((aData == null) || (aData.length() == 0))
    throw new IllegalArgumentException("Can not decode NULL or empty string.");
    byte[] data = aData.getBytes();
    // Skip padding from the end of encoded data
    int tail = data.length;
    while (data[tail-1] == '=')
    tail--;
    byte decodedBuf[] = new byte[tail - data.length/4];
    // ASCII-printable to 0-63 conversion
    for (int i = 0; i < data.length; i++)
    data[i] = mBase64DecMap[data[i]];
    // 4-byte to 3-byte conversion
    int srcIndex, destIndex;
    for (srcIndex = 0, destIndex=0; destIndex < decodedBuf.length-2;
    srcIndex += 4, destIndex += 3) {
    decodedBuf[destIndex] = (byte) ( ((data[srcIndex] << 2) & 255) |
    ((data[srcIndex+1] >>> 4) & 003) );
    decodedBuf[destIndex+1] = (byte) ( ((data[srcIndex+1] << 4) & 255) |
    ((data[srcIndex+2] >>> 2) & 017) );
    decodedBuf[destIndex+2] = (byte) ( ((data[srcIndex+2] << 6) & 255) |
    (data[srcIndex+3] & 077) );
    // Handle last 1 or 2 bytes
    if (destIndex < decodedBuf.length)
    decodedBuf[destIndex] = (byte) ( ((data[srcIndex] << 2) & 255) |
    ((data[srcIndex+1] >>> 4) & 003) );
    if (++destIndex < decodedBuf.length)
    decodedBuf[destIndex] = (byte) ( ((data[srcIndex+1] << 4) & 255) |
    ((data[srcIndex+2] >>> 2) & 017) );
    return decodedBuf;
    issue 2: Exception when passing 2MB .txt file
    Steps to reproduce:
    Call getSummary() with 2MB .txt file
    Actual:
    The following exception has occured:
    1. Error in postRequest(): Unexpected end of file from server
    java.lang.NullPointerException
    Please provide your precious feedback/suggestions.
    Thanks in advance…..
    Edited by: EJP on 15/03/2011 16:52: added code tags. Please use them. Code is unreadable otherwise.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

    Thanks for your response….
    This is enhancement project and some one develops long back.
    Regarding point (b) You should be using the java.net.URLEncoder to encode URL parameters, not a base64 encoder.
    DocumentSummarizerClient.java I am using base64
    Ex:
    // String encoded =new String (summaryInputData.getBytes("ISO-8859-1"),"UTF-8");
                        String encoded=Base64Utils.base64Encode(summaryInputData.getBytes());
                   // encoded =new String (summaryInputData.getBytes("ISO-8859-1"),"UTF-8");
                        String parameters= "base64String="+encoded+"&noOfWordsOrPercentage="+noOfWordsOrPercentage;
                        summarizedData= postRequest(parameters,summarizerURL);
                        String slength= "<string xmlns=\"http://tempuri.org/\">";
                        if(summarizedData.contains("</string>")){
                        summarizedData= summarizedData.substring(summarizedData.indexOf(slength)+slength.length(),summarizedData.indexOf("</string>"));
                        summarizedData = replaceVal(summarizedData);
                        //System.out.println("<?xml version=\"1.0\" encoding=\"utf-8\"?><![CDATA["+summarizedData+"]]>");
                        System.out.println("Summarized data "+summarizedData);
                        if(summarizedData.contains("Please enter the percentage")){
                             summarizedData="Data given cannot be summarized further";
    Above specific please I need to modify to resolve above issue.
    Could you please suggest me what changes I need to do.
    Waiting for positive response.

  • When I attempt to open a PDF file I saved from a website, I get the message "There was an error opening this document. The file is damaged and could not be repaired." Is there any way to correct this problem?

    When I attempt to open a PDF file I saved from a website using Safari, I get the message "There was an error opening this document. The file is damaged and could not be repaired." When I save the same PDF file using FireFox it opens up immediately. Is there any way to correct this problem with Safari?

    Back up all data.
    Triple-click the line of text below to select it, the copy the selected text to the Clipboard (command-C):
    /Library/Internet Plug-ins
    In the Finder, select
    Go ▹ Go to Folder
    from the menu bar, or press the key combination shift-command-G. Paste into the text box that opens (command-V), then press return.
    From the folder that opens, remove any items that have the letters “PDF” in the name. You may be prompted for your login password. Then quit and relaunch Safari, and test.
    The "Silverlight" web plugin distributed by Microsoft can also interfere with PDF display in Safari, so you may need to remove it as well, if it's present.
    If you still have the issue, repeat with this line:
    ~/Library/Internet Plug-ins
    If you don’t like the results of this procedure, restore the items from the backup you made before you started. Relaunch Safari again.

  • The way SharePoint open office documents will differ if the user try to open them from the document library directly, or if users try to open the document from the search result page.

    I have a document library where I have uploaded an excel sheet to it. Now If I click on the excel sheet directly from the document library page , I will get the following error ““The webpage cannot be displayed””. While if I do a search and I open the excel
    sheet from the search result page , it will open the excel sheet using the excel services inside the browser !!.
    So can anyone advice on this ?
    Also if I have a PowerPoint document , and I try to open it from the document library I will get the following error “The webpage cannot be displayed” , and the URL will be prefix with the following “ms-powerpoint:ofv|u|”. while if i do a search and i open
    the PowerPoint from the search result page i will be prompted to either open or save the document ? So why SharePoint is reacting totally different when trying to open document library items from the document library Or from the search result page?

    Hi,
    The behavior in the document library could be probably because of the Documents handling setting. Please try setting it to default behavior (Open in browser) as i hear from you that the default behavior is to open from browser.
    Thanks, Suneetha
    Currently I have set the following;-
    1. On the library advance setting :- I define  “Open in the client application”
    2. On the web application setting:- I define stricked for Browser File Handling
    And I have noted if I delete the browser cache and I access the document , then I will be prompted with the download dialog. but if I re-click on the same document I will be redirected to the
    The webpage cannot be displayed
    And the ms-powerpoint:ofv|u| will be added to the beginning of the URL. So could this be a caching problem ?

  • Message'there was an error opening this document.The file cannot be found'

    Using xp home and when I click to download the pdf file, it will give 3 options been 'open'/'save'/?. When I choose the 'open' option, it will give me the above message "there was an error opening this document.The file cannot be found"
    owever if I choose to "save" and I will be able to open the file and read it. In this pc its using Adobe Reader 8.1.2 with a patch. It was working fine prior to this sudden occurance of the error.
    Strangely I have another pc with the same specification, I was able to choose "open" and be able to read the file. Can anyone help to resolve the issue by using the "open' option instead of "save, then open". Greateful for your prompt response.

    Fyi, in addition to my earlier post, the other pc is using Adobe 8.1.1 and no other patch. I was trying to find 8.1.1 version but could not find a trust worthy site to load from. Do you think the error caused by using the 8.1.2 version? Thanks

  • Trouble opening pdf's - I have received several pdf's from a friend via e-mail (Thunderbird). Some of them open just fine but others give me the message: "There was an error opening this document. The file is damaged and could not be repaired."

    Trouble opening pdf's - I have received several pdf's from a friend via e-mail (Thunderbird). Some of them open just fine but others give me the message: "There was an error opening this document. The file is damaged and could not be repaired." My friend made sure that the files in question opened without issue on his computer (a PC). Further, I was able to open one of these "damaged" files on my Android phone, but I cannot open them on the Macbook Air. Any help would be greatly appreciated.

    Back up all data.
    Triple-click the line of text below to select it, the copy the selected text to the Clipboard (command-C):
    /Library/Internet Plug-ins
    In the Finder, select
    Go ▹ Go to Folder
    from the menu bar, or press the key combination shift-command-G. Paste into the text box that opens (command-V), then press return.
    From the folder that opens, remove any items that have the letters “PDF” in the name. You may be prompted for your login password. Then quit and relaunch Safari, and test.
    The "Silverlight" web plugin distributed by Microsoft can also interfere with PDF display in Safari, so you may need to remove it as well, if it's present.
    If you still have the issue, repeat with this line:
    ~/Library/Internet Plug-ins
    If you don’t like the results of this procedure, restore the items from the backup you made before you started. Relaunch Safari again.

  • I just downloaded and installed the 64bit itunes, but I get an error 2 "Apple application support required to run Itunes, uninstall and install again" I did that twice and got the same result

    I am a Windows 7 user and everything has been fine, but when I just tried to open itunes I got an Error 2 message. "Apple application support not found. uninstall and install itunes again." I have done that twice with the same result. this was the 64 bit version.

    Check this Apple document out -> Removing and reinstalling iTunes, QuickTime, and other software components for Windows Vista or Windows 7
    Try following the steps in that article, which will have you remove iTunes and the other bundled Apple software. Then download and install iTunes 10.4.1 for Windows (64 bit).

  • An FTP Error occured - cannot make connection to host. No response from the server

    "An FTP Error occured - cannot make connection to host. No response from the server".
    As of today this is all i get when trying to connect to every single ftp account i have. It's not the server cause it's every one and there is several different. Tried passive and non-passive same result. I've connected fine with other FTP clients. So this must be another dreamweaver bug. Anyone know what to do?

    Very hard to diagnose these problems, particularly as you can connect using a 3rd party program.
    See if the 'timeout' issue could be at play here:
    http://forums.adobe.com/message/708941#708941

  • I have used Image Capture to scan images/documents and then saved them as either PDFs or PNG files.  For some reason, just this past week Image Capture will no longer save the file.  It scans, and the Scan Results window pops up, but it won't save file.

    I have used Image Capture to scan images/documents and then saved them as either PDFs or PNG files.  For some reason, just this past week, Image Capture will no longer save the file.  It scans, and the Scan Results window pops up, but it won't save file.
    The file name has no special character in it, just letters and no spaces.
    I have done this in the past and it has worked, but now it will not.
    I have not upgraded any software, that I am aware of.
    After scanning, the Image Capture pops up the Scan Results with the file name in the window, but neither the Scan Results nor the Image Capture window responds to inputs.  The Image Capture window is frozen, with only the "Overview" and "Cancel" buttons active (but non-responsive).
    Is this a software issue or a scanner hardware issue?  I am using a HP Photosmart C6200 series printer/scanner on a network using a Time Capsule airport.
    Thanks.

    I had the same problem.
    Got a 90% fix.  Apparently the Mavericks preferences won't work with Yosemite, so I just deleted the Image Capture preferences.
    Unfortunately, the "Scan to" folder seems to be permanently set to the Pictures folder.
    1.  Quit Image Capture
    2.  Go to Finder > Go > Home, which opens up your home folder (named after your user name)
    3.  Open Library > Preferences > com.apple.ImageCapture.plist - Drag this file to the Trash
    4.  Start "Image Capture", click "Details" and change all your settings as you prefer
    5.  Quit and restart "Image Capture".   Notice it remembers all your settings except "Scan to" folder.  It insists on saving to "Pictures".
    That's as far as I was successful.  I tried changing the "Scan to" folder to "Desktop", but on launch, Image Capture always sets it back to "Pictures".
    This is what I tried:
    6.  Download and install "Pref Setter" from http://www.nightproductions.net/prefsetter.html
    7.  Quit "Image Capture".  Right-click on "com.apple.ImageCapture.plist" and open with Pref Setter.
    8.  Search for "Pictures", which finds "~/Pictures" (the tilde character at the start means your home directory).
    9.  Double-click on "~/Pictures" and change it to the folder you prefer.  I like "~/Desktop"
    10. Choose File > Save then Quit from Pref Setter.  Note that re-opening the plist file still shows "~/Desktop"
    11. Start up "Image Capture" -- on startup, "Image Capture" sets "Scan to" folder to "Pictures"
    I consider this a bug.

Maybe you are looking for

  • How to stop/warn another advance payment on same vendor and invoice

    HI, How to make an error or warning message, if user going to made another advance payment or book payment (f-47 and f-48). For instance an advance payment or payment request already exist on specific vendor with specific PO no.Currenty by E-47 and F

  • TS2446 Please help my apple id has been disabled

    And not for security reasons

  • Attach file in a ABAP module pool

    Hi, I have an application to control costs with employees. I would like to attach pdf files with this application. How do I attach a document to a record in an Z application. I am using a SAP release ECC 6.0 with OS WinNT. Thanks for your help in adv

  • UKMS versus Value Mapping versus Z tables ?

    Hello, has someone already made a choice whether to use UKMS or Value Mapping or Z Tables to do mapping or filtering of data ? If yes, what were the reasons to go for one or the other solution ? - both UKMS / Value Mapping provide key-pair mappings -

  • Diary help please.

    I am trying to create an appointments diary with a hashmap made up of a gregoriancalendar and an appointment in which i have a separate class for. import jewl.*; import java.io.*; import java.util.Date; import java.util.ArrayList; import java.lang.Ob