SOAP Exception:com.ctc.wstx.exc.WstxParsingException: Unexpected close tag ; expected .

本文介绍了一个SOAP请求中因标签闭合错误导致的异常,并提供了正确的SOAP请求示例。作者在请求中误用了<fname>标签,正确的闭合方式为</fname>。

Issue:

When I sent a soap request to Server, I got following error response.

Exception:

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:Serverfaultcode>
         faultstring>Failed to read a response: javax.xml.bind.UnmarshalException
 - with linked exception:
[com.ctc.wstx.exc.WstxParsingException: Unexpected close tag </fintObjInst>; expected </fName>.
 at [row,col {unknown-source}]: [11,28]]faultstring>
         detail>
            ns2:exception class="com.sun.xml.ws.encoding.soap.DeserializationException" 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>Failed to read a response: javax.xml.bind.UnmarshalException
 - with linked exception:
[com.ctc.wstx.exc.WstxParsingException: Unexpected close tag </fintObjInst>; expected </fName>.
 at [row,col {unknown-source}]: [11,28]]message>
               ns2:stackTrace>
                  ns2:frame class="com.sun.xml.ws.server.sei.EndpointMethodHandler" file="EndpointMethodHandler.java" line="252" method="invoke"/>
                  ns2:frame class="com.sun.xml.ws.server.sei.SEIInvokerTube" file="SEIInvokerTube.java" line="93" method="processRequest"/>
                  ns2:frame class="com.sun.xml.ws.api.pipe.Fiber" file="Fiber.java" line="604" method="__doRun"/>
                  ns2:frame class="com.sun.xml.ws.api.pipe.Fiber" file="Fiber.java" line="563" method="_doRun"/>
                  ns2:frame class="com.sun.xml.ws.api.pipe.Fiber" file="Fiber.java" line="548" method="doRun"/>
                  ns2:frame class="com.sun.xml.ws.api.pipe.Fiber" file="Fiber.java" line="445" method="runSync"/>
                  ns2:frame class="com.sun.xml.ws.server.WSEndpointImpl$2" file="WSEndpointImpl.java" line="249" method="process"/>
                  ns2:frame class="com.sun.xml.ws.transport.http.HttpAdapter$HttpToolkit" file="HttpAdapter.java" line="453" method="handle"/>
                  ns2:frame class="com.sun.xml.ws.transport.http.HttpAdapter" file="HttpAdapter.java" line="250" method="handle"/>
                  ns2:frame class="com.sun.xml.ws.transport.http.servlet.ServletAdapter" file="ServletAdapter.java" line="140" method="handle"/>
                  ns2:frame class="weblogic.wsee.jaxws.HttpServletAdapter$AuthorizedInvoke" file="HttpServletAdapter.java" line="298" method="run"/>
                  ns2:frame class="weblogic.wsee.jaxws.HttpServletAdapter" file="HttpServletAdapter.java" line="211" method="post"/>
                  ns2:frame class="weblogic.wsee.jaxws.JAXWSServlet" file="JAXWSServlet.java" line="297" method="doPost"/>
                  ns2:frame class="javax.servlet.http.HttpServlet" file="HttpServlet.java" line="727" method="service"/>
                  ns2:frame class="weblogic.wsee.jaxws.JAXWSServlet" file="JAXWSServlet.java" line="87" method="service"/>
                  ns2:frame class="javax.servlet.http.HttpServlet" file="HttpServlet.java" line="820" method="service"/>
                  ns2:frame class="weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction" file="StubSecurityHelper.java" line="227" method="run"/>
                  ns2:frame class="weblogic.servlet.internal.StubSecurityHelper" file="StubSecurityHelper.java" line="125" method="invokeServlet"/>
                  ns2:frame class="weblogic.servlet.internal.ServletStubImpl" file="ServletStubImpl.java" line="292" method="execute"/>
                  ns2:frame class="weblogic.servlet.internal.TailFilter" file="TailFilter.java" line="26" method="doFilter"/>
                  ns2:frame class="weblogic.servlet.internal.FilterChainImpl" file="FilterChainImpl.java" line="56" method="doFilter"/>
                  ns2:frame class="oracle.dms.wls.DMSServletFilter" file="DMSServletFilter.java" line="202" method="doFilter"/>
                  ns2:frame class="weblogic.servlet.internal.FilterChainImpl" file="FilterChainImpl.java" line="56" method="doFilter"/>
                  ns2:frame class="weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction" file="WebAppServletContext.java" line="3588" method="run"/>
                  ns2:frame class="weblogic.security.acl.internal.AuthenticatedSubject" file="AuthenticatedSubject.java" line="321" method="doAs"/>
                  ns2:frame class="weblogic.security.service.SecurityManager" file="SecurityManager.java" line="121" method="runAs"/>
                  ns2:frame class="weblogic.servlet.internal.WebAppServletContext" file="WebAppServletContext.java" line="2200" method="securedExecute"/>
                  ns2:frame class="weblogic.servlet.internal.WebAppServletContext" file="WebAppServletContext.java" line="2106" method="execute"/>
                  ns2:frame class="weblogic.servlet.internal.ServletRequestImpl" file="ServletRequestImpl.java" line="1428" method="run"/>
                  ns2:frame class="weblogic.work.ExecuteThread" file="ExecuteThread.java" line="201" method="execute"/>
                  ns2:frame class="weblogic.work.ExecuteThread" file="ExecuteThread.java" line="173" method="run"/>
               ns2:stackTrace>
               ns2:cause class="javax.xml.bind.UnmarshalException" note="To disable this feature, set com.sun.xml.ws.fault.SOAPFaultBuilder.disableCaptureStackTrace system property to false">
                  ns2:stackTrace>
                     ns2:frame class="com.sun.xml.bind.v2.runtime.unmarshaller.UnmarshallerImpl" file="UnmarshallerImpl.java" line="422" method="handleStreamException"/>
                     ns2:frame class="com.sun.xml.bind.v2.runtime.unmarshaller.UnmarshallerImpl" file="UnmarshallerImpl.java" line="360" method="unmarshal0"/>
                     ns2:frame class="com.sun.xml.bind.v2.runtime.BridgeImpl" file="BridgeImpl.java" line="120" method="unmarshal"/>
                     ns2:frame class="com.sun.xml.bind.api.Bridge" file="Bridge.java" line="233" method="unmarshal"/>
                     ns2:frame class="com.sun.xml.ws.server.sei.EndpointArgumentsBuilder$DocLit" file="EndpointArgumentsBuilder.java" line="517" method="readRequest"/>
                     ns2:frame class="com.sun.xml.ws.server.sei.EndpointMethodHandler" file="EndpointMethodHandler.java" line="250" method="invoke"/>
                     ns2:frame class="com.sun.xml.ws.server.sei.SEIInvokerTube" file="SEIInvokerTube.java" line="93" method="processRequest"/>
                     ns2:frame class="com.sun.xml.ws.api.pipe.Fiber" file="Fiber.java" line="604" method="__doRun"/>
                     ns2:frame class="com.sun.xml.ws.api.pipe.Fiber" file="Fiber.java" line="563" method="_doRun"/>
                     ns2:frame class="com.sun.xml.ws.api.pipe.Fiber" file="Fiber.java" line="548" method="doRun"/>
                     ns2:frame class="com.sun.xml.ws.api.pipe.Fiber" file="Fiber.java" line="445" method="runSync"/>
                     ns2:frame class="com.sun.xml.ws.server.WSEndpointImpl$2" file="WSEndpointImpl.java" line="249" method="process"/>
                     ns2:frame class="com.sun.xml.ws.transport.http.HttpAdapter$HttpToolkit" file="HttpAdapter.java" line="453" method="handle"/>
                     ns2:frame class="com.sun.xml.ws.transport.http.HttpAdapter" file="HttpAdapter.java" line="250" method="handle"/>
                     ns2:frame class="com.sun.xml.ws.transport.http.servlet.ServletAdapter" file="ServletAdapter.java" line="140" method="handle"/>
                     ns2:frame class="weblogic.wsee.jaxws.HttpServletAdapter$AuthorizedInvoke" file="HttpServletAdapter.java" line="298" method="run"/>
                     ns2:frame class="weblogic.wsee.jaxws.HttpServletAdapter" file="HttpServletAdapter.java" line="211" method="post"/>
                     ns2:frame class="weblogic.wsee.jaxws.JAXWSServlet" file="JAXWSServlet.java" line="297" method="doPost"/>
                     ns2:frame class="javax.servlet.http.HttpServlet" file="HttpServlet.java" line="727" method="service"/>
                     ns2:frame class="weblogic.wsee.jaxws.JAXWSServlet" file="JAXWSServlet.java" line="87" method="service"/>
                     ns2:frame class="javax.servlet.http.HttpServlet" file="HttpServlet.java" line="820" method="service"/>
                     ns2:frame class="weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction" file="StubSecurityHelper.java" line="227" method="run"/>
                     ns2:frame class="weblogic.servlet.internal.StubSecurityHelper" file="StubSecurityHelper.java" line="125" method="invokeServlet"/>
                     ns2:frame class="weblogic.servlet.internal.ServletStubImpl" file="ServletStubImpl.java" line="292" method="execute"/>
                     ns2:frame class="weblogic.servlet.internal.TailFilter" file="TailFilter.java" line="26" method="doFilter"/>
                     ns2:frame class="weblogic.servlet.internal.FilterChainImpl" file="FilterChainImpl.java" line="56" method="doFilter"/>
                     ns2:frame class="oracle.dms.wls.DMSServletFilter" file="DMSServletFilter.java" line="202" method="doFilter"/>
                     ns2:frame class="weblogic.servlet.internal.FilterChainImpl" file="FilterChainImpl.java" line="56" method="doFilter"/>
                     ns2:frame class="weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction" file="WebAppServletContext.java" line="3588" method="run"/>
                     ns2:frame class="weblogic.security.acl.internal.AuthenticatedSubject" file="AuthenticatedSubject.java" line="321" method="doAs"/>
                     ns2:frame class="weblogic.security.service.SecurityManager" file="SecurityManager.java" line="121" method="runAs"/>
                     ns2:frame class="weblogic.servlet.internal.WebAppServletContext" file="WebAppServletContext.java" line="2200" method="securedExecute"/>
                     ns2:frame class="weblogic.servlet.internal.WebAppServletContext" file="WebAppServletContext.java" line="2106" method="execute"/>
                     ns2:frame class="weblogic.servlet.internal.ServletRequestImpl" file="ServletRequestImpl.java" line="1428" method="run"/>
                     ns2:frame class="weblogic.work.ExecuteThread" file="ExecuteThread.java" line="201" method="execute"/>
                     ns2:frame class="weblogic.work.ExecuteThread" file="ExecuteThread.java" line="173" method="run"/>
                  ns2:stackTrace>
                  ns2:cause class="com.ctc.wstx.exc.WstxParsingException" note="To disable this feature, set com.sun.xml.ws.fault.SOAPFaultBuilder.disableCaptureStackTrace system property to false">
                     message>Unexpected close tag </fintObjInst>; expected </fName>.
 at [row,col {unknown-source}]: [11,28]message>
                     ns2:stackTrace>
                        ns2:frame class="com.ctc.wstx.sr.StreamScanner" file="StreamScanner.java" line="605" method="constructWfcException"/>
                        ns2:frame class="com.ctc.wstx.sr.StreamScanner" file="StreamScanner.java" line="461" method="throwParseError"/>
                        ns2:frame class="com.ctc.wstx.sr.BasicStreamReader" file="BasicStreamReader.java" line="3256" method="reportWrongEndElem"/>
                        ns2:frame class="com.ctc.wstx.sr.BasicStreamReader" file="BasicStreamReader.java" line="3198" method="readEndElem"/>
                        ns2:frame class="com.ctc.wstx.sr.BasicStreamReader" file="BasicStreamReader.java" line="2830" method="nextFromTree"/>
                        ns2:frame class="com.ctc.wstx.sr.BasicStreamReader" file="BasicStreamReader.java" line="1019" method="next"/>
                        ns2:frame class="com.sun.xml.ws.encoding.MtomCodec$MtomXMLStreamReaderEx" file="MtomCodec.java" line="428" method="next"/>
                        ns2:frame class="com.sun.xml.bind.v2.runtime.unmarshaller.StAXStreamConnector" file="StAXStreamConnector.java" line="225" method="bridge"/>
                        ns2:frame class="com.sun.xml.bind.v2.runtime.unmarshaller.UnmarshallerImpl" file="UnmarshallerImpl.java" line="358" method="unmarshal0"/>
                        ns2:frame class="com.sun.xml.bind.v2.runtime.BridgeImpl" file="BridgeImpl.java" line="120" method="unmarshal"/>
                        ns2:frame class="com.sun.xml.bind.api.Bridge" file="Bridge.java" line="233" method="unmarshal"/>
                        ns2:frame class="com.sun.xml.ws.server.sei.EndpointArgumentsBuilder$DocLit" file="EndpointArgumentsBuilder.java" line="517" method="readRequest"/>
                        ns2:frame class="com.sun.xml.ws.server.sei.EndpointMethodHandler" file="EndpointMethodHandler.java" line="250" method="invoke"/>
                        ns2:frame class="com.sun.xml.ws.server.sei.SEIInvokerTube" file="SEIInvokerTube.java" line="93" method="processRequest"/>
                        ns2:frame class="com.sun.xml.ws.api.pipe.Fiber" file="Fiber.java" line="604" method="__doRun"/>
                        ns2:frame class="com.sun.xml.ws.api.pipe.Fiber" file="Fiber.java" line="563" method="_doRun"/>
                        ns2:frame class="com.sun.xml.ws.api.pipe.Fiber" file="Fiber.java" line="548" method="doRun"/>
                        ns2:frame class="com.sun.xml.ws.api.pipe.Fiber" file="Fiber.java" line="445" method="runSync"/>
                        ns2:frame class="com.sun.xml.ws.server.WSEndpointImpl$2" file="WSEndpointImpl.java" line="249" method="process"/>
                        ns2:frame class="com.sun.xml.ws.transport.http.HttpAdapter$HttpToolkit" file="HttpAdapter.java" line="453" method="handle"/>
                        ns2:frame class="com.sun.xml.ws.transport.http.HttpAdapter" file="HttpAdapter.java" line="250" method="handle"/>
                        ns2:frame class="com.sun.xml.ws.transport.http.servlet.ServletAdapter" file="ServletAdapter.java" line="140" method="handle"/>
                        ns2:frame class="weblogic.wsee.jaxws.HttpServletAdapter$AuthorizedInvoke" file="HttpServletAdapter.java" line="298" method="run"/>
                        ns2:frame class="weblogic.wsee.jaxws.HttpServletAdapter" file="HttpServletAdapter.java" line="211" method="post"/>
                        ns2:frame class="weblogic.wsee.jaxws.JAXWSServlet" file="JAXWSServlet.java" line="297" method="doPost"/>
                        ns2:frame class="javax.servlet.http.HttpServlet" file="HttpServlet.java" line="727" method="service"/>
                        ns2:frame class="weblogic.wsee.jaxws.JAXWSServlet" file="JAXWSServlet.java" line="87" method="service"/>
                        ns2:frame class="javax.servlet.http.HttpServlet" file="HttpServlet.java" line="820" method="service"/>
                        ns2:frame class="weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction" file="StubSecurityHelper.java" line="227" method="run"/>
                        ns2:frame class="weblogic.servlet.internal.StubSecurityHelper" file="StubSecurityHelper.java" line="125" method="invokeServlet"/>
                        ns2:frame class="weblogic.servlet.internal.ServletStubImpl" file="ServletStubImpl.java" line="292" method="execute"/>
                        ns2:frame class="weblogic.servlet.internal.TailFilter" file="TailFilter.java" line="26" method="doFilter"/>
                        ns2:frame class="weblogic.servlet.internal.FilterChainImpl" file="FilterChainImpl.java" line="56" method="doFilter"/>
                        ns2:frame class="oracle.dms.wls.DMSServletFilter" file="DMSServletFilter.java" line="202" method="doFilter"/>
                        ns2:frame class="weblogic.servlet.internal.FilterChainImpl" file="FilterChainImpl.java" line="56" method="doFilter"/>
                        ns2:frame class="weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction" file="WebAppServletContext.java" line="3588" method="run"/>
                        ns2:frame class="weblogic.security.acl.internal.AuthenticatedSubject" file="AuthenticatedSubject.java" line="321" method="doAs"/>
                        ns2:frame class="weblogic.security.service.SecurityManager" file="SecurityManager.java" line="121" method="runAs"/>
                        ns2:frame class="weblogic.servlet.internal.WebAppServletContext" file="WebAppServletContext.java" line="2200" method="securedExecute"/>
                        ns2:frame class="weblogic.servlet.internal.WebAppServletContext" file="WebAppServletContext.java" line="2106" method="execute"/>
                        ns2:frame class="weblogic.servlet.internal.ServletRequestImpl" file="ServletRequestImpl.java" line="1428" method="run"/>
                        ns2:frame class="weblogic.work.ExecuteThread" file="ExecuteThread.java" line="201" method="execute"/>
                        ns2:frame class="weblogic.work.ExecuteThread" file="ExecuteThread.java" line="173" method="run"/>
                     ns2:stackTrace>
                  ns2:cause>
               ns2:cause>
            ns2:exception>
         detail>
      S:Fault>
   S:Body>
S:Envelope>

Solution:

Please note bold Fonts. That indicates that I made a spelling mistake in soap request. Below is my Soap request.

env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://siebel.com/">
   env:Header/>
   env:Body>
      ns1:QueryByExample>
         QueryByExample_Input>
            fLOVLanguageMode>LICfLOVLanguageMode>
            fPageSize>10fPageSize>
	    fSiebelMessage>
               fintObjInst>
                  fName>linksfName/>    
               fintObjInst>
            fSiebelMessage>
            fStartRowNum>0fStartRowNum>
            fViewMode>AllfViewMode>
         QueryByExample_Input>
      ns1:QueryByExample>
   env:Body>
env:Envelope>
I’m wrong to write the end tag of <fname>. Correct spelling should be </fname>, but not <fname></fname>
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值