Question
V8 Webservice throws error with returnType="array"
Can anyone help me understand why the following simple code
is throwiing an error. I get this error:
Detail The fault returned when invoking the web service operation is:<br> <pre>'' java.lang.NullPointerException</pre>
Message Cannot perform web service invocation authenticate.
when this routine routine:
<cfset ws = CreateObject("webservice", " http://localhost/opensource/QBWC_Shell.cfc") />
<cfset ret = ws.clientVersion(strVersion="2.0.0.135") />
<cfset soapresp = GetSOAPResponse(ws)>
<h2>SOAP Response for clientVersion</h2>
<cfdump var="#soapresp#">
<cfset ret = ws.authenticate(strUserName="User", strPassword="PW") />
<cfset soapresp = GetSOAPResponse(ws)>
<h2>SOAP Response for authenticate</h2>
<cfdump var="#soapresp#">
Calls this WebService:
<CFCOMPONENT style="RPC" namespace=" http://developer.intuit.com/">
<cffunction access="remote" name="clientVersion" returntype="String">
<cfargument name="strVersion" type="string" required="yes">
<cfreturn "O:2.0.0.135">
</cffunction>
<cffunction access="remote" name="authenticate" returntype="array">
<cfargument name="strUserName" type="string" required="yes" >
<cfargument name="strPassword" type="string" required="yes" >
<cfset var aryReturn = arrayNew(1) />
<cfset arrayAppend(aryReturn, "") >
<cfset arrayAppend(aryReturn, "nvu") >
<cfreturn aryReturn>
</cffunction>
</CFCOMPONENT>
If I change the return type and data to String in Authenticate, it works fine.
Any help is much appreciated,
Andy
Detail The fault returned when invoking the web service operation is:<br> <pre>'' java.lang.NullPointerException</pre>
Message Cannot perform web service invocation authenticate.
when this routine routine:
<cfset ws = CreateObject("webservice", " http://localhost/opensource/QBWC_Shell.cfc") />
<cfset ret = ws.clientVersion(strVersion="2.0.0.135") />
<cfset soapresp = GetSOAPResponse(ws)>
<h2>SOAP Response for clientVersion</h2>
<cfdump var="#soapresp#">
<cfset ret = ws.authenticate(strUserName="User", strPassword="PW") />
<cfset soapresp = GetSOAPResponse(ws)>
<h2>SOAP Response for authenticate</h2>
<cfdump var="#soapresp#">
Calls this WebService:
<CFCOMPONENT style="RPC" namespace=" http://developer.intuit.com/">
<cffunction access="remote" name="clientVersion" returntype="String">
<cfargument name="strVersion" type="string" required="yes">
<cfreturn "O:2.0.0.135">
</cffunction>
<cffunction access="remote" name="authenticate" returntype="array">
<cfargument name="strUserName" type="string" required="yes" >
<cfargument name="strPassword" type="string" required="yes" >
<cfset var aryReturn = arrayNew(1) />
<cfset arrayAppend(aryReturn, "") >
<cfset arrayAppend(aryReturn, "nvu") >
<cfreturn aryReturn>
</cffunction>
</CFCOMPONENT>
If I change the return type and data to String in Authenticate, it works fine.
Any help is much appreciated,
Andy
