web services - The XML document is not well formed error in Paperless Document API -
i sending post request ups paperless document api upload user created form getting the xml document not formed my request message is.
<?xml version=\"1.0\"?> <upssecurity> <usernametoken> <username>******</username> <password>******</password> </usernametoken> <serviceaccesstoken> <accesslicensenumber>*************</accesslicensenumber> </serviceaccesstoken> </upssecurity> <?xml version=\"1.0\"?> <uploadrequest> <request> <transactionreference> <customercontext></customercontext> </transactionreference> </request> <shippernumber>??????</shippernumber> <usercreatedform> <usercreatedformfilename>sample test file</usercreatedformfilename> <usercreatedformfile>sgvsbg8gqw5rdxi=</usercreatedformfile> <usercreatedformfileformat>txt</usercreatedformfileformat> <usercreatedformdocumenttype>011</usercreatedformdocumenttype> </usercreatedform> </uploadrequest>
after posting request rest i getting response..
<soapenv:envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"> <soapenv:header/> <soapenv:body> <soapenv:fault> <faultcode>client</faultcode> <faultstring>an exception has been raised result of client data.</faultstring> <detail> <err:errors xmlns:err="http://www.ups.com/schema/xpci/1.0/error"> <err:errordetail> <err:severity>hard</err:severity> <err:primaryerrorcode> <err:code>10001</err:code> <err:description>the xml document not formed</err:description> <err:digest>xml declaration not well-formed org.apache.xmlbeans.impl.piccolo.io.fileformatexception: xml declaration not well-formed @ org.apache.xmlbeans.impl.piccolo.xml.xmldeclparser.parse(xmldeclparser.java:907) @ org.apache.xmlbeans.impl.piccolo.xml.xmlinputreader.parsexmldeclaration(xmlinputreader.java:56) @ org.apache.xmlbeans.impl.piccolo.xml.xmlstreamreader.processxmldecl(xmlstreamreader.java:687) @ org.apache.xmlbeans.impl.piccolo.xml.xmlstreamreader.reset(xmlstreamreader.java:119) @ org.apache.xmlbeans.impl.piccolo.xml.documententity.open(documententity.java:94) @ org.apache.xmlbeans.impl.piccolo.xml.piccololexer.reset(piccololexer.java:982) @ org.apache.xmlbeans.impl.piccolo.xml.piccolo.parse(piccolo.java:709) @ org.apache.xmlbeans.impl.store.locale$saxloader.load(locale.java:3456) @ org.apache.xmlbeans.impl.schema.schematypeloaderbase.parse(schematypeloaderbase.java:345) @ org.apache.xmlbeans.xmlobject$factory.parse(xmlobject.java:663) @ com.ups.uxf.process.servicerequest.setmessage(servicerequest.java:545) @ com.ups.uxf.servlet.uxfservlet._dopost(uxfservlet.java:185) @ com.ups.wsf.servlet.wsfservlet.dopost(wsfservlet.java:511) @ javax.servlet.http.httpservlet.service(httpservlet.java:751) @ javax.servlet.http.httpservlet.service(httpservlet.java:845) @ weblogic.servlet.internal.stubsecurityhelper$servletserviceaction.run(stubsecurityhelper.java:242) @ weblogic.servlet.internal.servletstubimpl.execute(servletstubimpl.java:338) @ weblogic.servlet.internal.tailfilter.dofilter(tailfilter.java:25) @ weblogic.servlet.internal.filterchainimpl.dofilter(filterchainimpl.java:75) @ com.ups.webappcommon.filter.akamaifilter.dofilter(akamaifilter.java:33) @ weblogic.servlet.internal.webappservletcontext$servletinvocationaction.run(webappservletcontext.java:3262) @ weblogic.servlet.provider.wlssubjecthandle.run(wlssubjecthandle.java:57) @ weblogic.servlet.internal.webappservletcontext.dosecuredexecute(webappservletcontext.java:2171) @ weblogic.servlet.internal.webappservletcontext.execute(webappservletcontext.java:2075) @ weblogic.servlet.internal.servletrequestimpl.run(servletrequestimpl.java:1514) @ weblogic.servlet.provider.containersupportproviderimpl$wlsrequestexecutor.run(containersupportproviderimpl.java:255) @ weblogic.work.executethread.run(executethread.java:221) </err:digest> </err:primaryerrorcode> <err:location/> </err:errordetail> </err:errors> </detail> </soapenv:fault> </soapenv:body> </soapenv:envelope>
i using restclient. please help. in advance.
your request message not well-formed because:
the first xml declaration incorrect.
remedy: delete
\
characters.the second xml declaration incorrect because has
\
characters , because there can @ 1 xml declaration and, if appears, must @ top of xml document.remedy: delete second xml declaration.
the request has 2 root elements.
remedy: delete 1 of them, or wrap them both in single root element.
Comments
Post a Comment