的SAXParseException; lineNumber:1; columnNumber:1;序言中不能有内容

时间:2018-04-27 09:25:35

标签: xml web-services axis

我使用axis命中webservice,我提供了Object []参数,偶尔会发生异常,如下所示:

  

AxisFault    faultCode:{http://schemas.xmlsoap.org/soap/envelope/} Server.userException    faultSubcode:    faultString:org.xml.sax.SAXParseException; lineNumber:1; columnNumber:1;序言中不能有内容。    faultActor:    faultNode:    faultDetail:       {http://xml.apache.org/axis/}堆栈跟踪:org.xml.sax.SAXParseException; lineNumber:1; columnNumber:1;序言中不能有内容。       at org.apache.xerces.util.ErrorHandlerWrapper.createSAXParseException(Unknown Source)       在org.apache.xerces.util.ErrorHandlerWrapper.fatalError(未知来源)       在org.apache.xerces.impl.XMLErrorReporter.reportError(未知来源)       在org.apache.xerces.impl.XMLErrorReporter.reportError(未知来源)       at org.apache.xerces.impl.XMLScanner.reportFatalError(未知来源)       at org.apache.xerces.impl.XMLDocumentScannerImpl $ PrologDispatcher.dispatch(Unknown Source)       at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)       在org.apache.xerces.parsers.XML11Configuration.parse(未知来源)       在org.apache.xerces.parsers.XML11Configuration.parse(未知来源)       在org.apache.xerces.parsers.XMLParser.parse(未知来源)       在org.apache.xerces.parsers.AbstractSAXParser.parse(未知来源)       在org.apache.xerces.jaxp.SAXParserImpl $ JAXPSAXParser.parse(未知来源)       在org.apache.xerces.jaxp.SAXParserImpl.parse(未知来源)       在org.apache.axis.encoding.DeserializationContext.parse(DeserializationContext.java:227)       在org.apache.axis.SOAPPart.getAsSOAPEnvelope(SOAPPart.java:696)       在org.apache.axis.Message.getSOAPEnvelope(Message.java:435)       在org.apache.axis.handlers.soap.MustUnderstandChecker.invoke(MustUnderstandChecker.java:62)       在org.apache.axis.client.AxisClient.invoke(AxisClient.java:206)       在org.apache.axis.client.Call.invokeEngine(Call.java:2784)       在org.apache.axis.client.Call.invoke(Call.java:2767)       在org.apache.axis.client.Call.invoke(Call.java:2443)       在org.apache.axis.client.Call.invoke(Call.java:2366)       在org.apache.axis.client.Call.invoke(Call.java:1812)

异常似乎是它使用的xml是BOM或一些错误的字符,但我只提供Object [] params,而不是xml.And异常只发生。  快速的帮助将不胜感激,谢谢。 以下是我的代码:

**public java.lang.String fireRule(java.lang.String arg0, java.lang.String arg1, java.lang.String arg2,
        java.lang.String arg3, boolean arg4) throws java.rmi.RemoteException {
    org.apache.axis.client.Call _call = createCall();
    _call.setOperation(_operations[0]);
    _call.setUseSOAPAction(true);
    _call.setSOAPActionURI("");
    _call.setEncodingStyle(null);
    _call.setProperty(org.apache.axis.client.Call.SEND_TYPE_ATTR, Boolean.FALSE);
    _call.setProperty(org.apache.axis.AxisEngine.PROP_DOMULTIREFS, Boolean.FALSE);
    _call.setSOAPVersion(org.apache.axis.soap.SOAPConstants.SOAP11_CONSTANTS);
    _call.setOperationName(new javax.xml.namespace.QName("http://service.databus.brms.sinosoft.com/", "fireRule"));
    setRequestHeaders(_call);
    setAttachments(_call);
    Log.debug(RuleServiceImplServiceSoapBindingStub.class,
            " begin::::_call.invoke" + arg0 + ", " + arg1 + ", " + arg2 + ", " + arg3 + ", " + arg4);
    try {
        java.lang.Object _resp = _call
                .invoke(new java.lang.Object[] { arg0, arg1, arg2, arg3, new java.lang.Boolean(arg4) });**

0 个答案:

没有答案