House of Fusion
Search over 2,500 ColdFusion resources here
  
Home of the ColdFusion Community

Mailing Lists
Home / Groups / ColdFusion Talk (CF-Talk)

web service API problems (data conversion)

Author:
sam Detweiler
07/01/2009 12:50 PM

one of the products I need to talk to with my CF application, provides a web service interface.  CF generates the stubs underneath..   I CreateObject() the web service             wsparm = StructNew();             wsparm["refreshWSDL"]="yes";             wsparm["saveJava"]="yes";             wsparm["wsdl2javaArgs"]="-p com.ca.dsm.webservice";             wsparm["port"]="DSMWebServiceAPIService";             if(arguments.server eq "")                arguments.server=this.server;             this.ws=CreateObject("webservice","http://"& arguments.server  &                                   this.wsdl_path,wsparm); then call methods on this object. one in particular is giving me fits. the (wsdl2java called by CF) generated stub looks like this public void openUnitGroupComputerMembersList(java.lang.String sessionId,                                              java.lang.String unitGroupId,     com.ca.dsm.webservice.ComputerPropertyFilter[]computerPropertyFilters, com.ca.dsm.webservice.ComputerPropertiesRequired computerPropertiesRequired,                      javax.xml.rpc.holders.LongWrapperHolder openListHandle,                      javax.xml.rpc.holders.LongWrapperHolder totalNoOfComputers){} I call it like this outcount = CreateObject("java","javax.xml.rpc.holders.LongWrapperHolder").init(); handle = CreateObject("java","javax.xml.rpc.holders.LongWrapperHolder").init();          this.ws.openUnitGroupComputerMembersList(this.session, group_uuid,toJavaArray("com.ca.dsm.webservice.UnitPropertyFilter",filter),  parms , "handle", "outcount");          handle and outcount in quotes tells CF to to the mapping conversions. but.. I get this error java.lang.IllegalArgumentException: Can not set java.lang.Long field javax.xml.rpc.holders.LongWrapperHolder.value to javax.xml.rpc.holders.LongWrapperHolder --------------- now, this code has worked since Jan this year without problem.. but I had to reinstall the server with the web service provider on it. (using the same CD I used before), and the wsdl (used for the stubs), is identical to that used before. CF on my development/test system has not changed since then. the error points to the line of code above calling openUnitGroupComputerMembersList   at cfDSMWs2ecfc1883901126$funcGETCOMPUTERS.runFunction(C:\Program Files\Apache Software Foundation\Tomcat 5.5\webapps\cfusion\home1\DSMWs.cfc:171) SO, what am I missing? if the last two parms were correct, the stub code copies the results from the web service response data like this (into the long variable 'value' in the holder class. try {                 openListHandle.value = (java.lang.Long) _output.get(new javax.xml.namespace.QName("urn://www.ca.com/Unicenter/DSM/r11", "OpenListHandle"));             } catch (java.lang.Exception _exception) {                 openListHandle.value = (java.lang.Long) org.apache.axis.utils.JavaUtils.convert(_output.get(new javax.xml.namespace.QName("urn://www.ca.com/Unicenter/DSM/r11", "OpenListHandle")), java.lang.Long.class);             }             try {                 totalNoOfComputers.value = (java.lang.Long) _output.get(new javax.xml.namespace.QName("urn://www.ca.com/Unicenter/DSM/r11", "totalNoOfComputers"));             } catch (java.lang.Exception _exception) {                 totalNoOfComputers.value = (java.lang.Long) org.apache.axis.utils.JavaUtils.convert(_output.get(new javax.xml.namespace.QName("urn://www.ca.com/Unicenter/DSM/r11", "totalNoOfComputers")), java.lang.Long.class);             } Sam


Search cf-talk

March 11, 2010

<<   <   Today   >   >>
Su Mo Tu We Th Fr Sa
   1 2 3 4 5 6
7 8 9 10 11 12 13
14 15 16 17 18 19 20
21 22 23 24 25 26 27
28 29 30 31