私たちはWebサービスソリューションに取り組んでいます。Web サービス API は、クライアント Web サービスの実装から SOAP 応答を取得できるいくつかの呼び出しを提供します。
実装は AXIS フレームワークに基づいています。
すべての API 呼び出しは正常に機能しますが、応答が返されたときに SAXParseException が発生する場合を除きます。
SOAP UI で試すと、この特定の API に対して有効な応答が得られます。しかし、Java プロジェクトで試してみると、この SAXParseException が発生します。Java と SOAP UI プロジェクトの両方が同じ WSDL ファイルを使用して作成されました
以下のスタックトレースを見て、ここで何がうまくいかなかったのか、謙虚な意見を共有してください。
XML received:
2013-05-14 12:12:20,536 DEBUG http-bio-8080-exec-1 org.apache.axis.transport.http.HTTPSender - -----------------------------------------------
2013-05-14 12:12:20,536 DEBUG http-bio-8080-exec-1 org.apache.axis.SOAPPart - Enter: SOAPPart::getAsSOAPEnvelope()
2013-05-14 12:12:20,536 DEBUG http-bio-8080-exec-1 org.apache.axis.i18n.ProjectResourceBundle - org.apache.axis.i18n.resource::handleGetObject(currForm)
2013-05-14 12:12:20,536 DEBUG http-bio-8080-exec-1 org.apache.axis.SOAPPart - current form is FORM_INPUTSTREAM
2013-05-14 12:12:20,708 DEBUG http-bio-8080-exec-1 org.apache.axis.transport.http.HTTPSender - org.xml.sax.SAXParseException: The root element is required in a well-formed document.
2013-05-14 12:12:20,708 DEBUG http-bio-8080-exec-1 org.apache.axis.SOAPPart - Enter: SOAPPart ctor(FORM_FAULT)
2013-05-14 12:12:20,708 DEBUG http-bio-8080-exec-1 org.apache.axis.i18n.ProjectResourceBundle - org.apache.axis.i18n.resource::handleGetObject(setMsgForm)
2013-05-14 12:12:20,708 DEBUG http-bio-8080-exec-1 org.apache.axis.SOAPPart - Setting current message form to: FORM_FAULT (currentMessage is now org.apache.axis.AxisFault)
2013-05-14 12:12:20,708 DEBUG http-bio-8080-exec-1 org.apache.axis.SOAPPart - Exit: SOAPPart ctor()
2013-05-14 12:12:20,708 DEBUG http-bio-8080-exec-1 org.apache.axis.i18n.ProjectResourceBundle - org.apache.axis.i18n.resource::handleGetObject(toAxisFault00)
2013-05-14 12:12:20,740 DEBUG http-bio-8080-exec-1 org.apache.axis.enterprise - Mapping Exception to AxisFault
AxisFault
faultCode: {http://schemas.xmlsoap.org/soap/envelope/}Server.userException
faultSubcode:
faultString: org.xml.sax.SAXParseException: The root element is required in a well-formed document.
faultActor:
faultNode:
faultDetail:
{http://xml.apache.org/axis/}stackTrace:org.xml.sax.SAXParseException: The root element is required in a well-formed document.
at org.apache.xerces.framework.XMLParser.reportError(XMLParser.java:1213)
at org.apache.xerces.framework.XMLDocumentScanner.reportFatalXMLError(XMLDocumentScanner.java:570)
at org.apache.xerces.framework.XMLDocumentScanner$XMLDeclDispatcher.endOfInput(XMLDocumentScanner.java:790)
at org.apache.xerces.framework.XMLDocumentScanner.endOfInput(XMLDocumentScanner.java:418)
at org.apache.xerces.validators.common.XMLValidator.sendEndOfInputNotifications(XMLValidator.java:712)
at org.apache.xerces.readers.DefaultEntityHandler.changeReaders(DefaultEntityHandler.java:1031)
at org.apache.xerces.readers.XMLEntityReader.changeReaders(XMLEntityReader.java:168)
at org.apache.xerces.readers.AbstractCharReader.changeReaders(AbstractCharReader.java:150)
at org.apache.xerces.readers.AbstractCharReader.lookingAtChar(AbstractCharReader.java:217)
at org.apache.xerces.framework.XMLDocumentScanner$XMLDeclDispatcher.dispatch(XMLDocumentScanner.java:686)
at org.apache.xerces.framework.XMLDocumentScanner.parseSome(XMLDocumentScanner.java:381)
at org.apache.xerces.framework.XMLParser.parse(XMLParser.java:1098)
at javax.xml.parsers.SAXParser.parse(Unknown Source)
at org.apache.axis.encoding.DeserializationContext.parse(DeserializationContext.java:227)
at org.apache.axis.SOAPPart.getAsSOAPEnvelope(SOAPPart.java:696)
at org.apache.axis.Message.getSOAPEnvelope(Message.java:435)
at org.apache.axis.transport.http.HTTPSender.readFromSocket(HTTPSender.java:796)
at org.apache.axis.transport.http.HTTPSender.invoke(HTTPSender.java:144)
at org.apache.axis.strategies.InvocationStrategy.visit(InvocationStrategy.java:32)
at org.apache.axis.SimpleChain.doVisiting(SimpleChain.java:118)
at org.apache.axis.SimpleChain.invoke(SimpleChain.java:83)
at org.apache.axis.client.AxisClient.invoke(AxisClient.java:165)
at org.apache.axis.client.Call.invokeEngine(Call.java:2784)
at org.apache.axis.client.Call.invoke(Call.java:2767)
at org.apache.axis.client.Call.invoke(Call.java:2443)
at org.apache.axis.client.Call.invoke(Call.java:2366)
at org.apache.axis.client.Call.invoke(Call.java:1812)