Skip to main content
Participant
February 15, 2009
Question

V8 Webservice throws error with returnType="array"

  • February 15, 2009
  • 2 replies
  • 341 views
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
    This topic has been closed for replies.

    2 replies

    Participant
    February 15, 2009
    Thanks for the quick reply! It was as simple as adding "?wsdl"

    Andy
    BKBK
    Community Expert
    Community Expert
    February 15, 2009
    I expected something like:

    http://localhost:8500/opensource/QBWC_Shell.cfc?wsdl

    Apart from that, your code looks right.