2015-02-05 93 views
0

我试图在Railo 4.x到实施的Quickbooks网络连接器(QBWC)无法验证使用的Quickbooks网络连接器/ CFML

<cfcomponent output="false"> 

<cffunction name = "authenticate" access="remote" returntype="string"> 
    <cfargument name = "username" type="string" required="true"> 
    <cfargument name = "password" type = "string" required="true"> 

    <cfset var loc = {}> 

    <cfset loc.retVal= []> 

    <cfset loc.retVal[1] = "MYSESSIONTOKEN"> 
    <cfset loc.retVal[2] = "NONE"> 
    <cfset loc.retVal[3] = ""> 
    <cfset loc.retVal[4] = ""> 


    <cfreturn loc.retVal > 
</cffunction> 

<cffunction name = "clientVersion" access="remote" returnType ="string"> 
    <cfargument name = "productVersion" type="string" required="true"> 

    <cfset var loc = {}> 

    <cfset loc.retVal = ""> 

    <cfreturn loc.retVal> 
</cffunction> 



</cfcomponent> 

这是我的QWC文件:

<?xml version="1.0"?> 
<QBWCXML> 
<AppName>QuickCellarSVC</AppName> 
<AppID></AppID> 
<AppURL>http://localhost:8080/QuickCellar.cfc</AppURL> 
<AppDescription>Quick Cellar railo component</AppDescription> 
<AppSupport>http://localhost:8080/support.cfm</AppSupport> 
<UserName>Joe</UserName> 
<OwnerID>{57F3B9B1-86F1-4fcc-B1EE-566DE1813D20}</OwnerID> 
<FileID>{90A44FB5-33D9-4815-AC85-BC87A7E7D1EB}</FileID> 
<QBType>QBFS</QBType> 
<Scheduler> 
<RunEveryNMinutes>2</RunEveryNMinutes> 
</Scheduler> 
</QBWCXML> 

QBWC跟踪显示问题:

Object reference not set to an instance of an object. 
More info: 
StackTrace = at QBWebConnector.WebService.do_authenticate(String& ticket, String& companyFileName) 
Source = QBWebConnector 

我能够深入一点,发现在Rail中存在铸造问题或许?

<?xml version="1.0" encoding="UTF-8"?> 
-<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">-<soap:Body>- 

无法施展复杂对象结构类型为String


使用内置功能“连载(结构):字符串”从结构

创建一个字符串

现在我知道一些你正在想“只是序列化”结构。那么,Railo中没有这样的功能(我知道)。

任何想法,不胜感激。

回答

0

我看到的第一个问题是你的“authenticate”方法有返回字符串类型,但是你正在返回一个数组。如果你试图返回一个字符串,你可以使用return serializeJSON(loc.retVal)而不是retVal,这会将它作为JSON格式的字符串返回。

相关问题