Help - Premature end of file Exception while using saaj

Hi Everyone,
I have written a sample saaj client, with a string as an attachment and trying to send it to a servlet as shown in the example below:
* SaajClient.java
* Created on June 23, 2004, 5:49 PM
* @author Krishna Menon
import javax.xml.soap.*;
import javax.xml.messaging.URLEndpoint;
public class SaajClient {
public SaajClient() throws Exception
try{
SOAPMessage soapMessage = MessageFactory.newInstance().createMessage();
SOAPPart soapPart = soapMessage.getSOAPPart();
SOAPEnvelope envelope = soapPart.getEnvelope();
SOAPHeader header = envelope.getHeader();
SOAPBody body = envelope.getBody();
header.detachNode();
String str = "Something a;alskdjf;laksjdfl;akjsdf;lk ;alskdjfl;asjdfl;ajk ;kdls a;kl";
if(soapMessage != null)
AttachmentPart attachment = soapMessage.createAttachmentPart();
attachment.setContentType("text/plain");
attachment.setContent(str,"text/plain");
attachment.setContentId("Sample_String");
soapMessage.addAttachmentPart(attachment);
soapMessage.saveChanges();
SOAPConnection connection = SOAPConnectionFactory.newInstance().createConnection();
URLEndpoint endpoint = new URLEndpoint("http://10.2.1.132:8080/WebServices/servlet/AttachmentReceiver");
SOAPMessage response = connection.call(soapMessage,endpoint);
response.writeTo(System.out);
}catch(Exception e)
System.out.println("Caught in constructor");
e.printStackTrace();
public static void main(String args[])
try
SaajClient client = new SaajClient();
}catch(Exception e)
e.printStackTrace();
When I run the above program, it is giving the following exception:
Caught in constructor
javax.xml.soap.SOAPException: org.xml.sax.SAXParseException: Premature end of file.
at org.apache.axis.soap.SOAPConnectionImpl.call(SOAPConnectionImpl.java:110)
at SaajClient.<init>(SaajClient.java:58)
at SaajClient.main(SaajClient.java:74)
Caused by: org.xml.sax.SAXParseException: Premature end of file.
at org.apache.axis.AxisFault.makeFault(AxisFault.java:129)
at org.apache.axis.SOAPPart.getAsSOAPEnvelope(SOAPPart.java:543)
at org.apache.axis.Message.getSOAPEnvelope(Message.java:376)
at org.apache.axis.client.Call.invokeEngine(Call.java:2583)
at org.apache.axis.client.Call.invoke(Call.java:2553)
at org.apache.axis.client.Call.invoke(Call.java:1753)
at org.apache.axis.soap.SOAPConnectionImpl.call(SOAPConnectionImpl.java:105)
... 2 more
Caused by: org.xml.sax.SAXParseException: Premature end of file.
at org.apache.xerces.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1139)
at javax.xml.parsers.SAXParser.parse(SAXParser.java:345)
at org.apache.axis.encoding.DeserializationContextImpl.parse(DeserializationContextImpl.java:242)
at org.apache.axis.SOAPPart.getAsSOAPEnvelope(SOAPPart.java:538)
... 7 more
If anybody has a solution for it, please post it here.
Thanks in advance,
With Regards,
Krishna Menon. B.

Hi
Actually the problem is not with the client but with the servlet I think. In the servlet, I am able to retrieve the attachment and print its content. After receiving the Message, I am creating a new message and populating its body with a new child element and returning the message back to the client. Just Before returning the message, I am getting the Axis Fault error in the log file. I am giving the code for the Servlet I have used below:
* AttachmentReceiver.java
* Created on June 23, 2004, 7:11 PM
* @author Krishna Menon
import java.util.Iterator;
import javax.servlet.ServletException;
import javax.xml.messaging.JAXMServlet;
import javax.xml.messaging.ReqRespListener;
import javax.xml.soap.AttachmentPart;
import javax.xml.soap.MessageFactory;
import javax.xml.soap.SOAPEnvelope;
import javax.xml.soap.SOAPMessage;
import javax.xml.soap.SOAPPart;
import javax.xml.soap.SOAPFactory;
* Servlet that accepts a SOAP message and looks through
* its attachments before sending the SOAP part of the message
* to the console and sending back a response
* @author Krishna Menon
public class AttachmentReceiver extends JAXMServlet implements ReqRespListener {
private MessageFactory fac;
public void init() throws ServletException {
try {
fac = MessageFactory.newInstance();
catch( Exception ex ) {
System.out.println("In AttachmentReceiver init");
ex.printStackTrace();
throw new ServletException( ex );
// This is the application code for handling the message.. Once the
// message is received the application can retrieve the soap part, the
// attachment part if there are any, or any other information from the
// message.
public SOAPMessage onMessage( SOAPMessage message ) {
System.out.println( "On message called in receiving servlet" );
try {
System.out.println( "\nMessage Received: " );
System.out.println( "\n============ start ============\n" );
// dump out attachments
System.out.println( "Number of Attachments: " + message.countAttachments() );
int i = 1;
for( Iterator it = message.getAttachments(); it.hasNext(); i++ ) {
AttachmentPart ap = (AttachmentPart) it.next();
System.out.println( "Attachment #" + i + " content type : " +
ap.getContentType() );
System.out.println("Attachment Content ::"+ap.getContent());
// dump out the SOAP part of the message
SOAPPart soapPart = message.getSOAPPart();
System.out.println( "SOAP Part of Message:\n\n" + soapPart );
System.out.println( "\n============ end ===========\n" );
SOAPMessage msg = fac.createMessage();
SOAPEnvelope env = msg.getSOAPPart().getEnvelope();
SOAPFactory soapFactory = SOAPFactory.newInstance();
System.out.println("Before getBody");
env.getBody().addChildElement(soapFactory.createName("MessageResponse")).addTextNode("From Attachment Servlet"+"\nYour Attachment Received");
System.out.println("After getBody");
//addChildElement("MessageResponse").addTextNode("From Attachment Servlet"+"\nYour Attachment Received");
msg.saveChanges();
System.out.println("After Msg Save Changes");
return msg;
catch( Exception e ) {
System.out.println("From OnMessage() of AttachmentReceiver");
e.printStackTrace();
return null;
This is generating the following series of errors in the catalina.out (Tomcat4.1 error log ) file:
On message called in receiving servlet
Message Received:
============ start ============
Number of Attachments: 1
Attachment #1 content type : text/plain
SOAP Part of Message:
org.apache.axis.SOAPPart@16fdac
============ end ===========
- java.io.IOException:
AxisFault
faultCode: {http://schemas.xmlsoap.org/soap/envelope/}Server.userException
faultSubcode:
faultString: java.lang.ClassCastException
faultActor:
faultNode:
faultDetail:
     {http://xml.apache.org/axis/}stackTrace: java.lang.ClassCastException
     at org.apache.axis.message.SOAPBody.outputImpl(SOAPBody.java:173)
     at org.apache.axis.message.SOAPEnvelope.outputImpl(SOAPEnvelope.java:509)
     at org.apache.axis.message.MessageElement.output(MessageElement.java:783)
     at org.apache.axis.SOAPPart.writeTo(SOAPPart.java:270)
     at org.apache.axis.Message.writeTo(Message.java:440)
     at javax.xml.messaging.JAXMServlet.doPost(Unknown Source)
     at javax.servlet.http.HttpServlet.service(HttpServlet.java)
     at javax.servlet.http.HttpServlet.service(HttpServlet.java)
     at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Unknown Source)
     at org.apache.catalina.core.ApplicationFilterChain.doFilter(Unknown Source)
     at org.apache.catalina.core.StandardWrapperValve.invoke(Unknown Source)
     at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(Unknown Source)
     at org.apache.catalina.core.StandardPipeline.invoke(Unknown Source)
     at org.apache.catalina.core.ContainerBase.invoke(Unknown Source)
     at org.apache.catalina.core.StandardContextValve.invoke(Unknown Source)
     at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(Unknown Source)
     at org.apache.catalina.core.StandardPipeline.invoke(Unknown Source)
     at org.apache.catalina.core.ContainerBase.invoke(Unknown Source)
     at org.apache.catalina.core.StandardContext.invoke(Unknown Source)
     at org.apache.catalina.core.StandardHostValve.invoke(Unknown Source)
     at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(Unknown Source)
     at org.apache.catalina.valves.ErrorDispatcherValve.invoke(Unknown Source)
     at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(Unknown Source)
     at org.apache.catalina.valves.ErrorReportValve.invoke(Unknown Source)
     at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(Unknown Source)
     at org.apache.catalina.core.StandardPipeline.invoke(Unknown Source)
     at org.apache.catalina.core.ContainerBase.invoke(Unknown Source)
     at org.apache.catalina.core.StandardEngineValve.invoke(Unknown Source)
     at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(Unknown Source)
     at org.apache.catalina.core.StandardPipeline.invoke(Unknown Source)
     at org.apache.catalina.core.ContainerBase.invoke(Unknown Source)
     at org.apache.coyote.tomcat4.CoyoteAdapter.service(CoyoteAdapter.java:223)
     at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:594)
     at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:392)
     at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:565)
     at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:619)
     at java.lang.Thread.run(Thread.java:534)
java.lang.ClassCastException
     at org.apache.axis.AxisFault.makeFault(AxisFault.java:129)
     at org.apache.axis.SOAPPart.writeTo(SOAPPart.java:272)
     at org.apache.axis.Message.writeTo(Message.java:440)
     at javax.xml.messaging.JAXMServlet.doPost(Unknown Source)
     at javax.servlet.http.HttpServlet.service(HttpServlet.java)
     at javax.servlet.http.HttpServlet.service(HttpServlet.java)
     at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Unknown Source)
     at org.apache.catalina.core.ApplicationFilterChain.doFilter(Unknown Source)
     at org.apache.catalina.core.StandardWrapperValve.invoke(Unknown Source)
     at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(Unknown Source)
     at org.apache.catalina.core.StandardPipeline.invoke(Unknown Source)
     at org.apache.catalina.core.ContainerBase.invoke(Unknown Source)
     at org.apache.catalina.core.StandardContextValve.invoke(Unknown Source)
     at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(Unknown Source)
     at org.apache.catalina.core.StandardPipeline.invoke(Unknown Source)
     at org.apache.catalina.core.ContainerBase.invoke(Unknown Source)
     at org.apache.catalina.core.StandardContext.invoke(Unknown Source)
     at org.apache.catalina.core.StandardHostValve.invoke(Unknown Source)
     at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(Unknown Source)
     at org.apache.catalina.valves.ErrorDispatcherValve.invoke(Unknown Source)
     at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(Unknown Source)
     at org.apache.catalina.valves.ErrorReportValve.invoke(Unknown Source)
     at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(Unknown Source)
     at org.apache.catalina.core.StandardPipeline.invoke(Unknown Source)
     at org.apache.catalina.core.ContainerBase.invoke(Unknown Source)
     at org.apache.catalina.core.StandardEngineValve.invoke(Unknown Source)
     at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(Unknown Source)
     at org.apache.catalina.core.StandardPipeline.invoke(Unknown Source)
     at org.apache.catalina.core.ContainerBase.invoke(Unknown Source)
     at org.apache.coyote.tomcat4.CoyoteAdapter.service(CoyoteAdapter.java:223)
     at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:594)
     at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:392)
     at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:565)
     at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:619)
     at java.lang.Thread.run(Thread.java:534)
Caused by: java.lang.ClassCastException
     at org.apache.axis.message.SOAPBody.outputImpl(SOAPBody.java:173)
     at org.apache.axis.message.SOAPEnvelope.outputImpl(SOAPEnvelope.java:509)
     at org.apache.axis.message.MessageElement.output(MessageElement.java:783)
     at org.apache.axis.SOAPPart.writeTo(SOAPPart.java:270)
     ... 33 more

Similar Messages

  • File is not a normal file exception while using HttpClient()

    Hi All,
    I would like to upload few files from the end user desktop machine to a unix server. This process will be done during the execution of a portal application (PAR). I was just trying my hands at the following code, but it gives me <b>File is not a normal file exception</b>.
    public void doContent(IPortalComponentRequest request, IPortalComponentResponse response)
             response.write("Hi Sandip.....");
             /** reading file informations */
             final String serverURL = "serverURL";
              PostMethod mPost=null;
             try {
                   HttpClient httpCl = new HttpClient();
                   mPost = new PostMethod(serverURL);
                   File file1 = new File("D:\JavaScreen.jpeg");
                   response.write("<BR>you selected the file::"+file1.getAbsolutePath());
                   mPost.getParams().setBooleanParameter(HttpMethodParams.USE_EXPECT_CONTINUE,true);               
                   response.write("<BR>Uploading file to server....");
                   //Part fileParts = new FilePart(file1.getName(),file1);               
                   FilePart[] filePart = {
                             new FilePart(file1.getName(),file1) //add multiple files here
                   mPost.setRequestEntity(new MultipartRequestEntity(filePart,mPost.getParams()));     
                   httpCl.getHttpConnectionManager().getParams().setConnectionTimeout(5000);
                   int statusCode = httpCl.executeMethod(mPost);
                   if(statusCode==HttpStatus.SC_OK){
                        response.write("<BR>upload done:"+mPost.getResponseBodyAsString());
                   }else{
                        response.write("<BR>upload failed:"+HttpStatus.getStatusText(statusCode));
                   mPost.releaseConnection();
              } catch (HttpException e) {
                   // TODO Auto-generated catch block
                   //e.printStackTrace();
                   response.write("Excp1:"+e.getLocalizedMessage());
                   mPost.releaseConnection();
              } catch (IOException e) {
                   // TODO Auto-generated catch block
                   //e.printStackTrace()
                   response.write("Excp2:"+e.getLocalizedMessage());
                   response.write("Excp3::"+e.getCause());
                   mPost.releaseConnection();
              }finally{
                   mPost.releaseConnection();
    This is written inside a portal application. While running this code, it gives an output
    Hi Sandip.....
    you selected the file::D:JavaScreen.jpeg
    Uploading file to server....Excp2:File is not a normal file.Excp3::null
    What could be the problem? I tried with 2-3 files.
    Would appreciate a reply.
    Regards
    Sandip Agarwal

    Hi,
    you can check this link.
    <a href="http://svn.apache.org/viewvc/jakarta/httpcomponents/oac.hc3x/trunk/src/examples/">HttpClient sample codes</a>
    regards
    Vivek Nidhi

  • Premature end of file Problem in Mail-Adapter by using StrictXml2PlainBean

    Hello Experts,
    I tried a simple File to Mail scenario with the following test message and received the expected attachment:
    <?xml version="1.0" encoding="UTF-8"?>
    <ns0:MT_TEST_FlatMessage xmlns:ns0="urn:lynx.de:pi:test:bw_extractor">
         <elemente>
              <Kundennummer>4711</Kundennummer>
              <RechnungsNr>0001</RechnungsNr>
              <Umsatz>234,67</Umsatz>
              <Anzahl>34</Anzahl>
              <Versand>12,00</Versand>
              <PosNr>0001</PosNr>
         </elemente>
         <elemente>
              <Kundennummer>4711</Kundennummer>
              <RechnungsNr>0002</RechnungsNr>
              <Umsatz>1900,25</Umsatz>
              <Anzahl>100</Anzahl>
              <Versand>50</Versand>
              <PosNr>0002</PosNr>
         </elemente>
    </ns0:MT_TEST_FlatMessage>
    Everything is fine. Now I want to transform the message in a CSV-Attachment and joined the Module
    1     AF_Modules/StrictXml2PlainBean     Local Enterprise Bean     0
    as first entry in the sequence with the following configuration:
    Key  Parameter                          Value
    0     addHeaderLine                fromXML
    0      elemente.endSeparator      \r\n
    0     elemente.fieldSeparator        ;
    0     singleRecordType                elemente
    But now I the adapter gets the error:  Premature end of file
    What did I wrong?

    >
    Dirk Koch wrote:
    > as first entry in the sequence with the following configuration:
    >
    > Key  Parameter                          Value
    > 0     addHeaderLine                fromXML
    > 0      elemente.endSeparator      \r\n
    > 0     elemente.fieldSeparator        ;
    > 0     singleRecordType                elemente
    >
    >
    > But now I the adapter gets the error:  Premature end of file
    >
    > What did I wrong?
    try
    0      elemente.endSeparator      'nl'

  • Premature end of File

    Hi all,
    I got the following exception while doing file to file scenario  (with file content conversion)
    Operation Mapping
    INF137917_OM_Medicine
    Runtime error
    Runtime exception occurred during application mapping com/sap/xi/tf/_INF137917_MM_Medicine_; com.sap.aii.utilxi.misc.api.BaseRuntimeException: Premature end of file.
    I found this error in test configuration of Integration directory.
    Please help me to find out the cause of it.

    Hi Ashu,
    With what payload you are testing in the ID test tool? Should be from the SXMB_MONI ,isn't it ?
    My view is that , there are error in the sender file adapter FCC which you have written.
    Please try correcting the FCC error and your issue will be solved.Make sure you use correct parameters as FCC is case sensitive.
    refer this help.sap link to analyse and correct your fcc error.
    http://help.sap.com/saphelp_nw70/helpdata/en/2c/181077dd7d6b4ea6a8029b20bf7e55/content.htm
    post if you have any specific erorr, as you seems to be very new to SDN , try searching for the error in Google/SDn and then if you dont get any way out ... SDN members will be more than happy to guide you .
    Cheers,
    Srinivas

  • FILE_to_RFC  (Premature end of file)

    Hello,
    I'm trying to setup a FILE_to_RFC connection.
    Let me explain what I want to do .
    External systems sends files which should linked to SAP documents that users can later see with FB03.
    This can be done by function module ARCHIV_CREATE_SYNCHRON_META or similar, but only this is remote-enabled.
    Here an example:
    External system sends for e.g.  3 files. All files are located in file-system.
    1. file :  file-aaa.pdf
    2. file:   file-bbb-pdf
    3. file:   upload.txt
    Content of third file:  
    company-code, SAP-document number, year, file-name 
    0400..................6800004711...................2008..file-aaa.pdf
    0400.................48000004712..................2009, file-bbb.pdf
    FILE-Sender-channel is polling for  the file  "upload.txt".  This file will convert from text to XM by Adapter, so far ok. .
    RFC-Receiver-channel so far ok.  Using  imported RFC function module
    Test Message-Mappng : OK    (  MT_INVOICES  -->  ARCHIV_CREATE_SYNCHRON_META )
    Test.Operation-Maping:  OK
    But the process failed with following errors: , File "upload.txt" has been archived but no other activities.
    ==============================================================================
    SAP:Code area="MAPPING">EXCEPTION_DURING_EXECUTE</SAP:Code>
      <SAP:P1>com/sap/xi/tf/_MM_MT_INVOICES_to_ARCHIV_CREATE_SY~</SAP:P1>
      <SAP:P2>com.sap.aii.mappingtool.tf7.IllegalInstanceExcepti</SAP:P2>
      <SAP:P3>on: Cannot create target element /ns1:ARCHIV_CREAT</SAP:P3>
      <SAP:P4>E_SYNCHRON_META/AR_OBJECT. Values missing in queu~</SAP:P4>
      <SAP:AdditionalText />
      <SAP:Stack>Runtime exception occurred during application mapping com/sap/xi/tf/_MM_MT_INVOICES_to_ARCHIV_CREATE_SY; com.sap.aii.mappingtool.tf7.IllegalInstanceException: Cannot create target element /ns1:ARCHIV_CREATE_SYNCHRON_META/AR_OBJECT. Values missing in queu</SAP:Stack>
    Test-Result of configuration in the Integration Builder:
    ======================================
    Runtime exception occurred during application mapping com/sap/xi/tf/_MM_MT_INVOICES_to_ARCHIV_CREATE_SY~; com.sap.aii.utilxi.misc.api.BaseRuntimeException:Premature end of file.
    Maybe somebody can help here ?

    The payload is following: I imported this into the test area.
    <?xml version="1.0" encoding="utf-8" ?>
        <MT_INVOICES>
          <Recordset>
              <ROW>
                   <TEXT1>EFLOW</TEXT1>
                   <TEXT2>FI_DOCUMENTS</TEXT2>
                   <SAP_DOCUMENT>4300005878</SAP_DOCUMENT>
                   <COMPANY_CODE>0401</COMPANY_CODE>
                   <YEAR>2005</YEAR>
                   <FILE_NAME>file-1.gif</FILE_NAME>
                   <FILE_TYPE>GIF</FILE_TYPE>
            </ROW>
         </Recordset>
      </MT_INVOICES>
    Below the XSD schema of the  data type
    <xsd:complexType name="DT_INVOICES">
          <xsd:annotation>
             <xsd:documentation xml:lang="EN">
             Scanned invoices of eflow system
             </xsd:documentation>
          </xsd:annotation>
          <xsd:sequence>
             <xsd:element name="Recordset">
                <xsd:complexType>
                   <xsd:sequence>
                      <xsd:element name="ROW" maxOccurs="unbounded">
                         <xsd:complexType>
                            <xsd:sequence>
                               <xsd:element name="TEXT1" type="xsd:string" />
                               <xsd:element name="TEXT2" type="xsd:string" />
                               <xsd:element name="SAP_DOCUMENT" type="xsd:string" />
                               <xsd:element name="COMPANY_CODE" type="xsd:string" />
                               <xsd:element name="YEAR" type="xsd:string" />
                               <xsd:element name="FILE_NAME" type="xsd:string" />
                               <xsd:element name="FILE_TYPE" type="xsd:string" />
                            </xsd:sequence>
                         </xsd:complexType>
                      </xsd:element>
                   </xsd:sequence>
                </xsd:complexType>
             </xsd:element>
    So I see here no difference !.

  • OSB 11g - testing Business service throws Premature end of file.

    Hi,
    I am testing a business service which invokes a webservice. I have a load balancer.
    When testing business service from test console, I get the error "SoapService.doPost: unparseable XML in client Soap request, exception: org.xml.sax.SAXParseException: Premature end of file."
    I tried the following options:
    1. Changed <http:Connection> to close
    2. Added -DHTTPClient.disableKeepAlives=true in console - Servers-osbserver - Server Start
    Any pointers will be helpful.
    Thanks
    Ganesh
    Error:
    The invocation resulted in an error: Internal Server Error.
         <SOAP-ENV:Envelope      SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsi="http://www.w3.org/2001/XMLSchema">
         <SOAP-ENV:Body      xmlns:m="urn:www.my-url.com">
         <SOAP-ENV:Fault>
         <faultcode>SOAP-ENV:Client.XMLFormatError</faultcode>
         <faultstring>Client XML Format Error</faultstring>
         <detail>
         <XML_PARSING_EXCEPTION>
         35: SoapService.doPost: unparseable XML in client Soap request, exception: org.xml.sax.SAXParseException: Premature end of file.
         </XML_PARSING_EXCEPTION>
         </detail>
         </SOAP-ENV:Fault>
         </SOAP-ENV:Body>
         </SOAP-ENV:Envelope>
    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">
         <tran:user-header      name="Expires" value="Mon, 10 Jan 2011 17:49:17 CST"/>
         <tran:user-header      name="Last-Modified" value="Mon, 10 Jan 2011 17:49:17 CST"/>
         <http:Cache-Control>no-cache, no-store</http:Cache-Control>
         <http:Connection>Keep-Alive</http:Connection>
         <http:Content-Length>657</http:Content-Length>
         <http:Content-Type>text/xml</http:Content-Type>
         <http:Date>Mon, 10 Jan 2011 17:49:17 CST</http:Date>
         <http:Server>j2se/1.5x</http:Server>
         </tran:headers>
         <tran:response-code      xmlns:tran="http://www.bea.com/wli/sb/transports">2</tran:response-code>
         <tran:response-message      xmlns:tran="http://www.bea.com/wli/sb/transports">Internal Server Error</tran:response-message>
         <tran:encoding      xmlns:tran="http://www.bea.com/wli/sb/transports">iso-8859-1</tran:encoding>
         <http:http-response-code      xmlns:http="http://www.bea.com/wli/sb/transports/http">500</http:http-response-code>
         </con:metadata>

    35: SoapService.doPost: unparseable XML in client Soap request, exception: org.xml.sax.SAXParseException: Premature end of file.I am not sure but may be that the XML which you are passing as input, has got corrupted. Cross check the input XML and if possible use different input.
    Regards,
    Anuj

  • Premature end of file failure in Proxy-SFTP scenario

    Hi All,
    We had this asych. scenario working until, we got a request to send field names in the payload.
    In the receiver communication channel, under Module tab I've defined as below:
    Processing Sequence
    1     AF_Modules/StrictXml2PlainBean     Local Enterprise Bean     0
    Module configuration:
    Module Key                 Parameter Name              Parameter value
    0                                  addHeaderLine                 fromXML
    0                                  dataRec.fieldSeparator     |
    0                                  singleRecordType             dataRec
    Now when we try to send data its failing with the below message:
    Starting strict XML to plain text conversion
    2011-09-28 12:16:26 Error Adapter Framework caught exception: Premature end of file.
    2011-09-28 12:16:26 Error Delivering the message to the application using connection SFTP_http://seeburger.com/xi failed, due to: com.sap.engine.interfaces.messaging.api.exception.MessagingException: org.xml.sax.SAXParseException: Premature end of file..
    2011-09-28 12:16:26 Information The message status was set to WAIT.
    Please can anyone help with this? Am I missing something here?
    Thanks,
    Priya.

    check out this link. it might help you..
    File Content Conversion Error in PI 7.1 (file to Proxy)

  • ParseXml, "Premature end of file" error

    I have made an online PDF submission script for a form on my site.  For the most part, it has been working fine.  However, over the past few days, I have gotten a number of error emails that I have setup with people having submission errors.
    Here is what I am getting:
    Error Type: Expression
    Error Message: An error occured while Parsing an XML document.
    Error Details: Premature end of file.
    This is what I use to grab the XML:
    <CFSET pdfXml=#ToString(GetHttpRequestData().Content)#>
    <CFSET xmlData=#XmlParse(pdfXml)#>
    These lines occur like the third or fourth line in the script, and the lines before it are for a CFTRY and another CFSET variable.
    Any idea as to what might be causing this error?  Since it works for 99% of the people, I think it is a problem with the system/server rather than the script...
    Thanks in advance for any help with this!

    I'm seeing the same behavior as you with my Coldfusion Web Service.  Possibly a bug in GetHTTPRequestData function in CF?  References:
    http://www.bennadel.com/blog/1602-GetHTTPRequestData-Breaks-The-SOAP-Request-Response-Cycl e-In-ColdFusion.htm
    http://www.petefreitag.com/item/733.cfm
    I'm trying to find workarounds for this problem too.  If I find something I'll post it here.

  • Invalid_path exception while using UTL_FILE.FOPEN

    Hi
    I am getting invalid_path exception while using the UTL_FILE.fopen subprogram. I tried finding out the reason but could not solve it. Please help.
    Below is my piece of code.
    create directory utldr as 'e:\utldir';
    declare
    f utl_file.file_type;
    s varchar2(200);
    begin
    dbms_output.put_line('1');
    f := utl_file.fopen('UTLDR','utlfil.txt','r');
    dbms_output.put_line('2');
    utl_file.get_line(f,s);
    dbms_output.put_line('3');
    utl_file.fclose(f);
    dbms_output.put_line('4');
    dbms_output.put_line(s);
    exception
    when utl_file.invalid_path then
    dbms_output.put_line('invalid_path');
    end;
    the result is:
    1
    invalid_path

    I am executing it from sys. The same user who created the directory.
    The output is as below:
    SELECT * FROM dba_directories
    OWNER     DIRECTORY_NAME     DIRECTORY_PATH
    SYS     MEDIA_DIR      d:\avale\rel4\demo\schema\product_media\
    SYS     LOG_FILE_DIR     d:\avale\rel4\assistants\dbca\logs\
    SYS     DATA_FILE_DIR     d:\avale\rel4\demo\schema\sales_history\
    SYS     EMP_DIR     E:\Oracle Directory
    SYS     REMOTED     \\10.1.1.12\oracle directory
    SYS     UTLDR     e:\utldir
    SELECT * FROM dba_tab_privs WHERE table_name='UTLDR'
    GRANTEE     OWNER     TABLE_NAME     GRANTOR     PRIVILEGE     GRANTABLE     HIERARCHY
    PUBLIC     SYS     UTLDR     SYS     READ     NO     NO

  • Error - Premature end of file.

    Hi,
    I am running a scenario involviong File Sender Adapter. I am not able to get the payload.
    I am getiing the following error - Premature end of file.
      <SAP:Stack>Runtime exception occurred during application mapping com/sap/xi/tf/_MM_EXTD_EX_CustomerReturnData_to_C~; com.sap.aii.utilxi.misc.api.BaseRuntimeException:Premature end of file.</SAP:Stack>
      <SAP:Retry>M</SAP:Retry>
    Has anyone encountered such kind of error?
    Regards,
    Neeraj

    Satish,
    Yes I am using content conversion.
    Document Name - MT_CustomerReturnData
    Document Namespace - given
    Recordset Name - recordset
    Recordset Structure - Header,1,Record,*
    Recordset Sequence - Ascending
    Key Field Name - Key
    Key Field Type - String (Case-Insensitive)
    Header.fieldSeparator '|'
    Header.fieldNames Key,ProtocolVersion,CustomerCode,ProductionBatchNumber,Period,ProductionSite,DeliveryCode,CardType,FromBox,ToBox,DateReturnFileCreated,QuantityOfRecords,FixedString
    Header.endSeparator 'nl'
    Header.keyFieldValue 'H'
    Record.fieldSeparator '|'
    Record.fieldNames Key,CardID,PinCode,InfoCode
    Record.keyFieldValue 'R'
    ignoreRecordsetName true

  • Axis - Premature end of file (Desperate!)

    Hello guys,
    I am developing a simple XMLSignature (using Apache's XML-Sec v1.2.1) web service on a Tomcat v5.5.12 / Axis v1.3 installation (happyaxis.jsp is totally happy). The service performs signing and verification of Documents.
    The service call to the signing procedure completes successfully. In the verification procedure, though, I get the following error from Axis:AxisFault
    faultCode: {http://schemas.xmlsoap.org/soap/envelope/}Server.userException
    faultSubcode:
    faultString: org.xml.sax.SAXParseException: Premature end of file.
    faultActor:
    faultNode:
    faultDetail:
         {http://xml.apache.org/axis/}stackTrace:org.xml.sax.SAXParseException:Premature end of file.
    }According to another post, here in Sun's forums (reply 2 of 4 of http://forum.java.sun.com/thread.jspa?messageID=3790406), the error occurs when Axis is trying to download a schema. At some point in my verification code I have the following line:NodeList xmlSigs = root.getElementsByTagNameNS(
         "http://www.w3.org/2001/09/xmldsig#", "Signature");I have tried other methods, using root.getElementsByTagName("Signature") or downloading the xsd file and setting the NamespaceURI locally to my server (http://localhost/xmldsig#) but none worked. Note that I can test-run my code's jar file in Eclipse (not as a service but as an application) and it runs fine.
    If this is indeed the reason of the "premature end of file" error I should note that I have to run the server behind a proxy. For this I have tried to set proxyName="10.0.0.1" and proxyPort="8002" in server.xml HTTP Connector, but again no success. However, in Eclipse, the code works fine with or without proxy!
    I am ruther unsure if the above schema lookup is the reason of error, or some other "bug" is involved... I will provide further details (code/settings) if you need them.
    Thanks in advance for your help.

    No actually this xml file is a list of airport with a lattitude and longitude, whatever, and its located on the server. Here is a sample of this file:
    <?xml version="1.0" encoding="ISO-8859-1"?>
    <airports>
    <marker icao="LFAB" lat="49.883335" lng="1.0833334" name="Dieppe-St-Aubin"/>
    <marker icao="LFAC" lat="50.966667" lng="1.95" name="Calais-Dunkerque"/>
    </airports>

  • Premature end of file Error in the File conversion

    Hi Experts
    Working on File to Proxy scenario and file is picking up by the XI server and in the message mapping I am receiving the following error
    Can anyone let me know what is Premature end of file, Do I need to specify any parameter in the Content Conversion additional than normal parameters
    Thanks
    PR
    <?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
    - <!--  Request Message Mapping
      -->
    - <SAP:Error xmlns:SAP="http://sap.com/xi/XI/Message/30" xmlns:SOAP="http://schemas.xmlsoap.org/soap/envelope/" SOAP:mustUnderstand="">
      <SAP:Category>Application</SAP:Category>
      <SAP:Code area="MAPPING">EXCEPTION_DURING_EXECUTE</SAP:Code>
      <SAP:P1>com/sap/xi/tf/_MM_ISO_to_ECC_FROI_SROI_TA_TE_TR_T~</SAP:P1>
      <SAP:P2>com.sap.aii.utilxi.misc.api.BaseRuntimeException:</SAP:P2>
      <SAP:P3>Premature end of file.</SAP:P3>
      <SAP:P4 />
      <SAP:AdditionalText />
      <SAP:Stack>Runtime exception occurred during application mapping com/sap/xi/tf/_MM_ISO_to_ECC_FROI_SROI_TA_TE_TR_T~; com.sap.aii.utilxi.misc.api.BaseRuntimeException:Premature end of file.</SAP:Stack>
      <SAP:Retry>M</SAP:Retry>
      </SAP:Error>

    check out this link. it might help you..
    File Content Conversion Error in PI 7.1 (file to Proxy)

  • BI services error "Data parsing failed, premature end of file".

    Hi all,
    we are facing issue while using BI services whenever we are trying to drill data its showing the error as "Data parsing failed contact your system administrator,premature end of file".
    please share with me if anyone has faced the same error anytime.
    thank in advance for your valuable suggestions.
    Thanks,
    karan.

    Hi,
    Please check whether the RFC imported by you contain the exact elements of XML.  I feel the RFC generated does not contain proper XML schema.
    Regards
    Krish

  • SOAP service could not be loaded: premature end of file

    Hi,
    I am trying to call some web services using the Web Service action in the logic editor, but I am always getting some errors. For instance, for an online service (e.g. http://webservices.imacination.com/distance/Distance.jws) I am getting:
    "SOAP service could not be loaded: Premature end of file."
    I've tried 3 different web services that are available out there, and no result. I've laso tried writing it like this:
    http://webservices.imacination.com/distance/Distance.jws/ or
    http://webservices.imacination.com/distance/Distance.jws?wsdl
    , but the result was the same.
    I've also tried a web service that's currently deployed on my machine, using Tomcat. Here, I'm getting some slightly different errors:
    http://localhost:8080/epcis-repository-0.2.0/capture/
    SOAP service could not be loaded: the element type "HR" must be terminated by the matching end-tag "</hr>"
    http://localhost:8080/epcis-repository-0.2.0/capture or
    http://localhost:8080/epcis-repository-0.2.0/capture?wsdl
    SOAP service could not be loaded: WSDLEXception (at /html): faultCode=INVALID_WSDL: Expected element 'definitions'.
    As a note, this web service that I have deployed locally is also available online (http://demo.accada.org/epcis/capture), and if I try out this one, the error is again:
    SOAP service could not be loaded: Premature end of file.
    As far as I could tell, the /epcis/capture webservice is document/literal, so I don't think this should be a problem. I have read other posts about people having similar problems, but I could not find the answer to my problem...
    Can anyone please help?
    Thanks in advance!
    Angela

    Hi,
    Thanks a lot, everyone, for your answers! Yes, the firewall and the "rpc/encoded" encoding might explain why the first two web services did not work...
    However, it does not explain why the web service installed locally does not work, since it is "document/literal" encoded, as far as I could tell..... And unfortunately, this one is the one that I need to connect to (the others I was only using for testing). Again, this is the error message that I get:
    SOAP service could not be loaded: WSDLEXception (at /html): faultCode=INVALID_WSDL: Expected element definitions'.
    Parts of the wsdl file are copied bellow, and I can't see anything wrong with it (certainly no <definitions/> missing):
    <?xml version="1.0" encoding="UTF-8"?>
    <!-- EPCIS QUERY SERVICE DEFINITIONS -->
    <wsdl:definitions xmlns="http://schemas.xmlsoap.org/wsdl/" xmlns:apachesoap="http://xml.apache.org/xml-soap" xmlns:epcis="urn:epcglobal:epcis:xsd:1" xmlns:epcisq="urn:epcglobal:epcis-query:xsd:1" xmlns:epcglobal="urn:epcglobal:xsd:1" xmlns:impl="urn:epcglobal:epcis:wsdl:1" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" targetNamespace="urn:epcglobal:epcis:wsdl:1">
      <wsdl:binding name="EPCISServiceBinding" type="impl:EPCISServicePortType">
        <wsdlsoap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
        <wsdl:operation name="getQueryNames">
          <wsdlsoap:operation/>
          <wsdl:input>
            <wsdlsoap:body use="literal"/>
          </wsdl:input>
          <wsdl:output>
            <wsdlsoap:body use="literal"/>
          </wsdl:output>
        </wsdl:operation>
    </wsdl:binding>
    </wsdl:definitions>
    As a side note, I now get the same error message if I try to connect from outside the company's firewall to the same web service available on the internet (http://demo.accada.org/epcis/capture?wsdl).
    Does anyone have any more ideas?
    Thank you once again in advance!
    Angela

  • NWDS 7.3 - BRM WSDL generation: SAXParseException: Premature end of file

    On each and every try to regenerate the WSDL of an existing flowruleset.(these WSDL's have been generated, and deployed on earlier occasions) I get an 'SAXParseException: Premature end of file' Problem started to occur without being able to point out any system or tooling changes. But when creating a brand new flowruleset this exception does NOT occur. Even when it's a clone of one of the existing flowrulesets that give the exception, the clone works okay, in that case the WSDL artifact is created. But the existing flowrulesets keep causing the exception. Anyone experienced the same? Have a clue abothe cause and possibly how to work this out? Any help much appreciated.

    Hi John,
    thanks for your answer.
    I deinstalled and installed the Lifecycle Designer from sratch again.
    Unfortunately the same error arises.
    openDocumentWithBaseUrl() NOT successfully called (maybe too old version of WDAdobeControl.dll?).
    Any suggestions?
    Kind regards,
    Jochen

Maybe you are looking for

  • MY MOBILE IS IPHONE 5C BUT WHEN I LOGIN TO MU ID IT SHOWING INCORRECT PASSWORD

    HI I HAVE APPLE IPHONE 5C BUT WHEN I LOGIN TO MY ID IT'S SHOWING LIKE INCORRECT PASSWORD AND WHILE I AM DOING RESTORE IPHONE  IT DISCONNECTING IN MIDDLE OF THE PROCESS THEN HOW CAN I ACTIVATION MY PHONE

  • TDS Reversal in Down Payment Clearing F-54

    Hi, I have a downpayment through f-48, here TDS is properly deducted. Thenafter, I enter an invoice,here also TDS is properly deducted. Thereafter, in transaction F-54, the TDS amount deducted previously in F-48 should get reversed, which is not happ

  • Error starting Oracle BAM active data cache service

    Hi after installing BAM every thing working fine ,but if restart my system Oracle BAM active data cache service throwing following error "The Oracle BAM Active Data Cache service on Local computer started and then stopped.Some services stop automatic

  • HP ENVY 15: Slow 4K read speed for Dual SSD's in RAID 0 - Needs to be addressed!

    Crystalmark scores 2nd gen Envy 15: Read/Write SEQ 352 / 215 512K 270 / 195 4K 14.2 / 110 http://forum.notebookreview.com/showthread.php?t=427278&page=754 read write 418.2 / 213.9 seq 251.3  / 181.1 random 512k 9.8 / 53.17 random 4k http://forum.note

  • Request for Flex 4.5 (Hero) info

    Hey there - So... what's up with Flex 4.5?  I only saw references to it in the bug database and somehow came across this link: http://opensource.adobe.com/wiki/display/flexsdk/Download+Flex+Hero Even google seems to be failing me... So here are my qu