tag:blogger.com,1999:blog-31425501.post-1156774209868914562006-08-28T09:01:00.000-05:002006-11-09T04:48:17.090-06:002006-11-09T04:48:17.090-06:00Netsuite, ColdFusion, Java, and a lot of gray hairOk, so I'm more likely to lose my hair over this than have it turn gray, but I'm working with creating a ColdFusion interface with Netsuite's web service. I'm running into the source of a common complaint from other developers trying to use Netsuite's web service: the documentation is spotty, and what is available is often outright wrong, leaving us to a maddening cycle of herky jerky trial and error. Some of my issues have been solved handily by Netsuite's support staff through their user forum and a conversation with one of their engineers, but this one is particularly puzzling and troubling. <br /><br />Here is a paraphrased version of an issue I posted in the Netsuite support forum (note that I had moved to writing the code directly in Java since most of the sample code in the documentation is in Java, and I wanted to ensure my problems were not ColdFusion-specific). If you have any ideas, I'm all ears, but if I find or am given a solution, I will be certain to post it here.<br /><br />I'm trying to write what I thought would be a simple search that will return all of the subcustomers of a given customer. I'm trying to get my feet wet with the following Java sample code from page 91 of the Platform Guide. I'm using the 2.0 wsdl, and the Platform Guide document I'm reading also says it's for 2.0.<br /><br /><pre>RecordRef[] rr = new RecordRef[] {new RecordRef("1", Recordtype.customer), new RecordRef("2", RecordType.customer), new RecordRef("3", RecordType.customer)};<br />CustomerSearchBasic customerSearchBasic = new CustomerSearchBasic();<br />customerSearchBasic.setInternalId(new SearchMultiSelectField(rr, SearchMultiSelectFieldOperator.anyOf));</pre><br /><br />When I try to run this code, it complains about my trying to pass a SearchMultiSelectField object to the setInternalId method. Looking at the java source generated by Axis 1.2 wsdl2java, it does look like the setInternalId method for CustomerSearchBasic is supposed to accept a SearchMultiSelectField object as a parameter. Here is the code snippet from the generated CustomerSearchBasic.java file:<br /><br /><pre>public void setInternalId(com.netsuite.webservices.platform.core_2_0.SearchMultiSelectField internalId) {<br /> this.internalId = internalId;<br /> }<br /></pre><br /><br /><br />However, I became suspicious and found some code to retrieve the list of available methods and parameter types from the CustomerSearchBasic object. It appeared that the setInternalId parameter actually is expecting an array of RecordRef objects. <br /><br />So I compiled and ran the following. No errors!<br /><br /><pre>RecordRef[] rr = new RecordRef[] {new RecordRef("1", Recordtype.customer), new RecordRef("2", RecordType.customer), new RecordRef("3", RecordType.customer)};<br />CustomerSearchBasic customerSearchBasic = new CustomerSearchBasic();<br />customerSearchBasic.setInternalId(rr);</pre><br /><br />Am I missing something? Is it possible I'm somehow referencing an old java class from the 1.3.2 wsdl?Jeremy "King Skidz" Gibbensnoreply@blogger.com5