Ask a Question

Error while passing xml tags in SOAP UI while testing WSDL

psuresh547
New Contributor

Error while passing xml tags in SOAP UI while testing WSDL

Hi,

I am facing error while passing the xml tags inside the <xml> tag while testing the SOAP wsdl from SOAP UI

syntax that i am using:

<soapenv:Envelope xmlns:fil="http://FileReceived" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
<soapenv:Header>
<wsse:Security soapenv:mustUnderstand="1" xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">
<wsse:UsernameToken wsu:Id="UsernameToken-8FC8AF46F90DFE59D316125055920301">
<wsse:Username>suresh</wsse:Username>
<wsse:Password Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordText">sur...>
<wsse:Nonce EncodingType="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-soap-message-security-1.0#Base64Binary">RkLg...>
<wsu:Created>2021-02-05T06:13:12.011Z</wsu:Created>
</wsse:UsernameToken>
</wsse:Security>
</soapenv:Header>
<soapenv:Body>
<fil:processFileReceived>
<fileId>AMR</fileId>
<xml>
<test>abc</test>
</xml>
<!--Optional:-->
<arg2>7204C2FE-13B1-4A48-8CDA-DE8386C60EF9</arg2>
</fil:processFileReceived>
</soapenv:Body>
</soapenv:Envelope>

 

Error:

<S:Envelope xmlns:S="http://schemas.xmlsoap.org/soap/envelope/">
<S:Body>
<S:Fault xmlns:ns4="http://www.w3.org/2003/05/soap-envelope">
<faultcode>S:Server</faultcode>
<faultstring>Call to parse xml failed.
org.dom4j.DocumentException: Error on line 2 of document : Premature end of file.</faultstring>
<detail>
<ns2:exception class="javax.xml.ws.soap.SOAPFaultException" note="To disable this feature, set com.sun.xml.ws.fault.SOAPFaultBuilder.disableCaptureStackTrace system property to false" xmlns:ns2="http://jax-ws.dev.java.net/">
<message>Call to parse xml failed.
org.dom4j.DocumentException: Error on line 2 of document : Premature end of file.</message>
<ns2:stackTrace>
<ns2:frame class="com.adminserver.webservice.helper.WebServiceHelper" file="WebServiceHelper.java" line="207" method="createSOAPFault"/>
<ns2:frame class="com.adminserver.webservice.helper.WebServiceHelper" file="WebServiceHelper.java" line="167" method="createSOAPFault"/>
<ns2:frame class="com.adminserver.pas.webservice.bll.filereceived.FileReceivedExecutor" file="FileReceivedExecutor.java" line="39" method="processFile"/>
<ns2:frame class="com.adminserver.pas.webservice.bll.filereceived.PasFileReceived" file="PasFileReceived.java" line="55" method="processFileReceived"/>
<ns2:frame class="sun.reflect.NativeMethodAccessorImpl" file="NativeMethodAccessorImpl.java" line="native" method="invoke0"/>
<ns2:frame class="sun.reflect.NativeMethodAccessorImpl" file="NativeMethodAccessorImpl.java" line="62" method="invoke"/>
<ns2:frame class="sun.reflect.DelegatingMethodAccessorImpl" file="DelegatingMethodAccessorImpl.java" line="43" method="invoke"/>
<ns2:frame class="java.lang.reflect.Method" file="Method.java" line="498" method="invoke"/>
<ns2:frame class="com.sun.xml.ws.api.server.InstanceResolver$1" file="InstanceResolver.java" line="246" method="invoke"/>
<ns2:frame class="com.sun.xml.ws.server.InvokerTube$2" file="InvokerTube.java" line="146" method="invoke"/>
<ns2:frame class="com.sun.xml.ws.server.sei.EndpointMethodHandler" file="EndpointMethodHandler.java" line="257" method="invoke"/>
<ns2:frame class="com.sun.xml.ws.server.sei.SEIInvokerTube" file="SEIInvokerTube.java" line="95" method="processRequest"/>
<ns2:frame class="com.sun.xml.ws.api.pipe.Fiber" file="Fiber.java" line="629" method="__doRun"/>
<ns2:frame class="com.sun.xml.ws.api.pipe.Fiber" file="Fiber.java" line="588" method="_doRun"/>
<ns2:frame class="com.sun.xml.ws.api.pipe.Fiber" file="Fiber.java" line="573" method="doRun"/>
<ns2:frame class="com.sun.xml.ws.api.pipe.Fiber" file="Fiber.java" line="470" method="runSync"/>
<ns2:frame class="com.sun.xml.ws.server.WSEndpointImpl$2" file="WSEndpointImpl.java" line="295" method="process"/>
<ns2:frame class="com.sun.xml.ws.transport.http.HttpAdapter$HttpToolkit" file="HttpAdapter.java" line="519" method="handle"/>
<ns2:frame class="com.sun.xml.ws.transport.http.HttpAdapter" file="HttpAdapter.java" line="288" method="handle"/>
<ns2:frame class="com.sun.xml.ws.transport.http.servlet.ServletAdapter" file="ServletAdapter.java" line="143" method="handle"/>
<ns2:frame class="com.sun.xml.ws.transport.http.servlet.WSServletDelegate" file="WSServletDelegate.java" line="155" method="doGet"/>
<ns2:frame class="com.sun.xml.ws.transport.http.servlet.WSServletDelegate" file="WSServletDelegate.java" line="189" method="doPost"/>
<ns2:frame class="com.sun.xml.ws.transport.http.servlet.WSServlet" file="WSServlet.java" line="76" method="doPost"/>
<ns2:frame class="sun.reflect.NativeMethodAccessorImpl" file="NativeMethodAccessorImpl.java" line="native" method="invoke0"/>
<ns2:frame class="sun.reflect.NativeMethodAccessorImpl" file="NativeMethodAccessorImpl.java" line="62" method="invoke"/>
<ns2:frame class="sun.reflect.DelegatingMethodAccessorImpl" file="DelegatingMethodAccessorImpl.java" line="43" method="invoke"/>
<ns2:frame class="java.lang.reflect.Method" file="Method.java" line="498" method="invoke"/>
<ns2:frame class="com.adminserver.web.helper.WSServlet" file="WSServlet.java" line="93" method="doPost"/>
<ns2:frame class="javax.servlet.http.HttpServlet" file="HttpServlet.java" line="648" method="service"/>
<ns2:frame class="javax.servlet.http.HttpServlet" file="HttpServlet.java" line="729" method="service"/>
<ns2:frame class="org.apache.catalina.core.ApplicationFilterChain" file="ApplicationFilterChain.java" line="231" method="internalDoFilter"/>
<ns2:frame class="org.apache.catalina.core.ApplicationFilterChain" file="ApplicationFilterChain.java" line="166" method="doFilter"/>
<ns2:frame class="org.apache.tomcat.websocket.server.WsFilter" file="WsFilter.java" line="53" method="doFilter"/>
<ns2:frame class="org.apache.catalina.core.ApplicationFilterChain" file="ApplicationFilterChain.java" line="193" method="internalDoFilter"/>
<ns2:frame class="org.apache.catalina.core.ApplicationFilterChain" file="ApplicationFilterChain.java" line="166" method="doFilter"/>
<ns2:frame class="com.github.ziplet.filter.compression.CompressingFilter" file="CompressingFilter.java" line="263" method="doFilter"/>
<ns2:frame class="org.apache.catalina.core.ApplicationFilterChain" file="ApplicationFilterChain.java" line="193" method="internalDoFilter"/>
<ns2:frame class="org.apache.catalina.core.ApplicationFilterChain" file="ApplicationFilterChain.java" line="166" method="doFilter"/>
<ns2:frame class="com.oracle.pas.filter.SecurityFilter" file="SecurityFilter.java" line="57" method="doFilter"/>
<ns2:frame class="org.apache.catalina.core.ApplicationFilterChain" file="ApplicationFilterChain.java" line="193" method="internalDoFilter"/>
<ns2:frame class="org.apache.catalina.core.ApplicationFilterChain" file="ApplicationFilterChain.java" line="166" method="doFilter"/>
<ns2:frame class="com.thetransactioncompany.cors.CORSFilter" file="CORSFilter.java" line="209" method="doFilter"/>
<ns2:frame class="com.thetransactioncompany.cors.CORSFilter" file="CORSFilter.java" line="244" method="doFilter"/>
<ns2:frame class="org.apache.catalina.core.ApplicationFilterChain" file="ApplicationFilterChain.java" line="193" method="internalDoFilter"/>
<ns2:frame class="org.apache.catalina.core.ApplicationFilterChain" file="ApplicationFilterChain.java" line="166" method="doFilter"/>
<ns2:frame class="org.apache.catalina.core.StandardWrapperValve" file="StandardWrapperValve.java" line="202" method="invoke"/>
<ns2:frame class="org.apache.catalina.core.StandardContextValve" file="StandardContextValve.java" line="96" method="invoke"/>
<ns2:frame class="org.apache.tomee.catalina.OpenEJBValve" file="OpenEJBValve.java" line="45" method="invoke"/>
<ns2:frame class="org.apache.catalina.authenticator.AuthenticatorBase" file="AuthenticatorBase.java" line="541" method="invoke"/>
<ns2:frame class="org.apache.catalina.core.StandardHostValve" file="StandardHostValve.java" line="139" method="invoke"/>
<ns2:frame class="org.apache.catalina.valves.ErrorReportValve" file="ErrorReportValve.java" line="92" method="invoke"/>
<ns2:frame class="org.apache.tomee.catalina.OpenEJBSecurityListener$RequestCapturer" file="OpenEJBSecurityListener.java" line="97" method="invoke"/>
<ns2:frame class="org.apache.catalina.valves.AbstractAccessLogValve" file="AbstractAccessLogValve.java" line="678" method="invoke"/>
<ns2:frame class="org.apache.catalina.core.StandardEngineValve" file="StandardEngineValve.java" line="74" method="invoke"/>
<ns2:frame class="org.apache.catalina.ha.tcp.ReplicationValve" file="ReplicationValve.java" line="330" method="invoke"/>
<ns2:frame class="org.apache.catalina.connector.CoyoteAdapter" file="CoyoteAdapter.java" line="343" method="service"/>
<ns2:frame class="org.apache.coyote.http11.Http11Processor" file="Http11Processor.java" line="367" method="service"/>
<ns2:frame class="org.apache.coyote.AbstractProcessorLight" file="AbstractProcessorLight.java" line="65" method="process"/>
<ns2:frame class="org.apache.coyote.AbstractProtocol$ConnectionHandler" file="AbstractProtocol.java" line="860" method="process"/>
<ns2:frame class="org.apache.tomcat.util.net.NioEndpoint$SocketProcessor" file="NioEndpoint.java" line="1598" method="doRun"/>
<ns2:frame class="org.apache.tomcat.util.net.SocketProcessorBase" file="SocketProcessorBase.java" line="49" method="run"/>
<ns2:frame class="java.util.concurrent.ThreadPoolExecutor" file="ThreadPoolExecutor.java" line="1149" method="runWorker"/>
<ns2:frame class="java.util.concurrent.ThreadPoolExecutor$Worker" file="ThreadPoolExecutor.java" line="624" method="run"/>
<ns2:frame class="org.apache.tomcat.util.threads.TaskThread$WrappingRunnable" file="TaskThread.java" line="61" method="run"/>
<ns2:frame class="java.lang.Thread" file="Thread.java" line="748" method="run"/>
</ns2:stackTrace>
</ns2:exception>
</detail>
</S:Fault>
</S:Body>
</S:Envelope>

 

I am using TomEE as application server.

 

Please let me know in case of any information if required.

3 REPLIES 3
richie
Community Hero

Hey @psuresh547,

That "premature end of line" error response leads me to believe your xml payload is malformed xml (even though it looks fine...i suspect the error could be a bit of a red herring). Have you tried using an xml parser to check its wellformed xml?

If you do a search youll see this issue occurs for a variety of reasons.

Have a look at this stackoverflow https://stackoverflow.com/questions/10022796/why-am-i-getting-this-error-premature-end-of-file

Ta

Rich
if this helped answer the post, could you please mark it as 'solved'? Also if you consider whether the title of your post is relevant? Perhaps if the post is solved, it might make sense to update the Subject header field of the post to something more descriptive? This will help people when searching for problems. Ta

thanks for the reply. I have checked the xml format and the same format is working fine in other application servers. From Tomcat or TomEE when i am trying test SOAP webservices using SOAP UI, i am facing this issue.

Hey @psuresh547

Yeah. Error response is wrong as i suspected. Did you have a look at the stackoverflow link i posted. They have some suggestions....

Ta

Rich
if this helped answer the post, could you please mark it as 'solved'? Also if you consider whether the title of your post is relevant? Perhaps if the post is solved, it might make sense to update the Subject header field of the post to something more descriptive? This will help people when searching for problems. Ta
cancel
Showing results for 
Search instead for 
Did you mean: