当我尝试从WCF发送[qbxml request] [1]时出现异常...我正在使用web连接器从wcf服务发送qbxml请求以快速预订桌面以获取报告摘要并使用GeneralDetailReportQueryRq查询xml 。但得到" QBWC1042:ReceiveResponseXML失败 错误消息:请求失败,HTTP状态为413:请求实体太大" Web连接器上的错误消息并检查了日志,并在详细日志中找到了所有响应但Web连接器显示[1]" QBWC1042:ReceiveResponseXML失败"。
这是qbxml请求
<?xml version="1.0" encoding="UTF-8"?>
<?qbxml version="13.0"?>
<QBXML>
<QBXMLMsgsRq onError="continueOnError">
<GeneralDetailReportQueryRq>
<GeneralDetailReportType>OpenInvoices</GeneralDetailReportType>
<ReportDateMacro>Today</ReportDateMacro>
<IncludeColumn>TxnID</IncludeColumn>
<IncludeColumn>TxnNumber</IncludeColumn>
<IncludeColumn>RefNumber</IncludeColumn>
<IncludeColumn>Name</IncludeColumn>
<IncludeColumn>TxnType</IncludeColumn>
<IncludeColumn>Date</IncludeColumn>
<IncludeColumn>Account</IncludeColumn>
<IncludeColumn>Aging</IncludeColumn>
<IncludeColumn>Amount</IncludeColumn>
<IncludeColumn>OpenBalance</IncludeColumn>
<IncludeColumn>RunningBalance</IncludeColumn>
<IncludeColumn>Terms</IncludeColumn>
<IncludeColumn>DueDate</IncludeColumn>
</GeneralDetailReportQueryRq>
</QBXMLMsgsRq>
</QBXML>
这是Web连接器中的日志
20170720.08:03:33 UTC : QBWebConnector.SOAPWebService.do_sendRequestXML() : cfn=""
20170720.08:03:33 UTC : QBWebConnector.SOAPWebService.do_sendRequestXML() : qbNationality="US"
20170720.08:03:33 UTC : QBWebConnector.SOAPWebService.do_sendRequestXML() : qbXMLMajorVers="13"
20170720.08:03:33 UTC : QBWebConnector.SOAPWebService.do_sendRequestXML() : qbXMLMinorVers="0"
20170720.08:03:33 UTC : QBWebConnector.SOAPWebService.do_sendRequestXML() : Received from sendRequestXML() following parameter:
20170720.08:03:33 UTC : QBWebConnector.SOAPWebService.do_sendRequestXML() : strRequestXML =
20170720.08:03:33 UTC : QBWebConnector.SOAPWebService.do_sendRequestXML() : XML dump follows: -
<?xml version="1.0" encoding="utf-8"?><?qbxml version="13.0"?><QBXML><QBXMLMsgsRq onError="continueOnError"><GeneralDetailReportQueryRq><GeneralDetailReportType>OpenInvoices</GeneralDetailReportType><ReportDateMacro>Today</ReportDateMacro><IncludeColumn>TxnID</IncludeColumn><IncludeColumn>TxnNumber</IncludeColumn><IncludeColumn>RefNumber</IncludeColumn><IncludeColumn>Name</IncludeColumn><IncludeColumn>TxnType</IncludeColumn><IncludeColumn>Date</IncludeColumn><IncludeColumn>Account</IncludeColumn><IncludeColumn>Aging</IncludeColumn><IncludeColumn>Amount</IncludeColumn><IncludeColumn>OpenBalance</IncludeColumn><IncludeColumn>RunningBalance</IncludeColumn><IncludeColumn>Terms</IncludeColumn><IncludeColumn>DueDate</IncludeColumn></GeneralDetailReportQueryRq></QBXMLMsgsRq></QBXML>
20170720.08:03:33 UTC : QBWebConnector.SOAPWebService.do_sendRequestXML() : Request xml received.
20170720.08:03:33 UTC : QBWebConnector.SOAPWebService.ProcessRequestXML() : Processing request #1
20170720.08:03:33 UTC : QBWebConnector.SOAPWebService.ProcessRequestXML() : REQUEST: received from application: size (bytes) = 786
20170720.08:03:33 UTC : QBWebConnector.SOAPWebService.ProcessRequestXML() : Sending request to QuickBooks.
20170720.08:03:37 UTC : QBWebConnector.SOAPWebService.ProcessRequestXML() : Response received from QuickBooks: size (bytes) = 93980
20170720.08:03:37 UTC : QBWebConnector.SOAPWebService.ProcessRequestXML() : Sending response back to application.
20170720.08:03:37 UTC : QBWebConnector.SOAPWebService.do_receiveResponseXML() : *** Calling receiveResponseXML() with following parameters:
20170720.08:03:37 UTC : QBWebConnector.SOAPWebService.do_receiveResponseXML() : wcTicket="d8bf5ba7-5e03-422a-a8ce-185cb86cf168"
20170720.08:03:37 UTC : QBWebConnector.SOAPWebService.do_receiveResponseXML() : response =
20170720.08:03:37 UTC : QBWebConnector.SOAPWebService.do_receiveResponseXML() : XML dump follows: -
<?xml version="1.0" ?>
<QBXML>
<QBXMLMsgsRs>
<GeneralDetailReportQueryRs statusCode="0" statusSeverity="Info" statusMessage="Status OK">
<ReportRet>
<ReportTitle>Open Invoices</ReportTitle>
<ReportSubtitle>As of July 20, 2017</ReportSubtitle>
<ReportBasis>Accrual</ReportBasis>
<NumRows>246</NumRows>
<NumColumns>14</NumColumns>
<NumColTitleRows>1</NumColTitleRows>
<ColDesc colID="1" dataType="STRTYPE">
<ColTitle titleRow="1" />
<ColType>Blank</ColType>
</ColDesc>
<TotalRow rowNumber="246">
<ColData colID="1" value="TOTAL" />
<ColData colID="9" value="1202982.55" />
<ColData colID="10" value="1089736.86" />
<ColData colID="11" value="1202982.55" />
</TotalRow>
</ReportData>
</ReportRet>
</GeneralDetailReportQueryRs>
</QBXMLMsgsRs>
</QBXML>
20170720.08:03:37 UTC : QBWebConnector.SOAPWebService.do_receiveResponseXML() : hresult=""
20170720.08:03:37 UTC : QBWebConnector.SOAPWebService.do_receiveResponseXML() : message=""
20170720.08:03:37 UTC : QBWebConnector.SOAPWebService.do_receiveResponseXML() : QBWC1042: ReceiveResponseXML failed
Error message: The request failed with HTTP status 413: Request Entity Too Large.
More info:
StackTrace = at System.Web.Services.Protocols.SoapHttpClientProtocol.ReadResponse(SoapClientMessage message, WebResponse response, Stream responseStream, Boolean asyncCall)
at System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke(String methodName, Object[] parameters)
at QBWebConnector.localhost.WCWebServiceDoc.receiveResponseXML(String ticket, String response, String hresult, String message)
at QBWebConnector.localhost.WCWebService.receiveResponseXML(String ticket, String response, String hresult, String message)
at QBWebConnector.SOAPWebService.receiveResponseXML(String wcTicket, String response, String hresult, String message)
at QBWebConnector.WebService.do_receiveResponseXML(String wcTicket, String response, String hresult, String message, Boolean& success, Boolean& timeout)
Source = System.Web.Services
This is the error screen short.
注意:我已更新上述日志并删除响应数据。我在日志文件中获得完整响应,但在某些请求的Web连接器上收到错误。
我已根据https://developer-static.intuit.com/qbSDK-current/doc/PDF/QBWC_proguide.pdf doc实施了我的服务。第10章中的receiveResponseXML方法。
答案 0 :(得分:2)
您的网络服务器拒绝HTTP请求,并显示以下消息:
如果您进行Google搜索,您会发现默认情况下,WCF会将请求限制为最多65千字节。
QuickBooks想要发送给你的请求是:
QuickBooks: size (bytes) = 93980
(或93.98千字节,超过最大大小约30千字节)
重新配置您的WCF服务/ Web服务器,以便它允许更大的有效负载。以下是: