【发布时间】:2014-09-02 20:22:45
【问题描述】:
这是由 here 发起的极其痛苦的 QuickBooks WebConnector 传奇的延续。
目标
我正在尝试将 Clojure 与 Axis 2 结合使用,以使用 QuickBooks WebConnector(从现在开始为 QBWC)访问 QuickBooks 数据。 QBWC 使用 SOAP 与外部应用程序通信,这就是我的 Clojure 应用程序使用 Axis 2 的原因。
进展
经过数十次排列和 150 多个小时,我终于找到了创建 Axis2 (SOAP) WebService 的简单方法。我使用 WSDL2Java 生成器从我从 Intuit 的开发人员门户获得的 QBWC WSDL 生成 Java 代码。我关注了this method from the Axis2 site's user guide,并且与 QuickBooks SDK 提供的(令人难以忍受的古老)示例类一样,它会自动生成类以及我修改的框架类的方法以适当地处理请求和输出响应。
问题
但是,问题是由于某种奇怪的原因,在 QBWC(即 SOAP 客户端)和我创建的 SOAP 服务之间传递的所有消息似乎都是 null 或空的。例如,下面是System.out 窗格中的几行(通过等效于System.out.println 打印):
ServerVersionResponse below!
Input: nil
ClientVersionResponse below!
Input: #<ClientVersion com.intuit.developer.ClientVersion@214a61eb>
Proceeding with client version nil... ; client version here should be a String and is retrieved using clientVersion.getStrVersion()
AuthenticateResponse below!
Input: #<Authenticate com.intuit.developer.Authenticate@2f8d9bb2>
Attempting to log in as nil with password nil... ; both should be Strings - retrieved using authenticate.getStrUserName() and .getStrPassword()
日志文件
在 QBWC 日志文件中显示如下:
QBWebConnector.SOAPWebService.do_serverVersion() : *** Calling serverVersion().
QBWebConnector.SOAPWebService.do_serverVersion() : Received from serverVersion() following parameter:<serverVersionRet="">
QBWebConnector.SOAPWebService.do_serverVersion() : This application sent a null for server version. Allowing update operation.
QBWebConnector.SOAPWebService.do_clientVersion() : *** Calling clientVersion() with following parameter:<productVersion="2.1.0.27">
QBWebConnector.SOAPWebService.do_clientVersion() : Received from clientVersion() following parameter:<clientVersionRet="">
QBWebConnector.SOAPWebService.do_clientVersion() : This application agrees with the current version of QBWebConnector. Allowing update operation.
QBWebConnector.SOAPWebService.do_authenticate() : Authenticating to application 'SOCAccess', username = 'alexandergunnarson'
QBWebConnector.SOAPWebService.do_authenticate() : *** Calling authenticate() with following parameters:<userName="alexandergunnarson"><password=<MaskedForSecurity>
QBWebConnector.SOAPWebService.do_authenticate() : QBWC1012: Authentication failed due to following error message.
Object reference not set to an instance of an object.
More info:
StackTrace = at QBWebConnector.WebService.do_authenticate(String& ticket, String& companyFileName)
结论
我完全遵循了 Axis2 指令似乎所说的内容,比我尝试过的其他配置排列要多得多。是什么导致了这里的问题?
提前感谢您的帮助!
【问题讨论】:
标签: soap clojure quickbooks wsdl2java