Hi,
I'm not a skilled hand at Web Services, but a few months ago I had managed to use WS to create a new Customer in a demo account. Today I tried to run the exact same code, and it's not working.
I'm not getting any exceptions or anything meaningful. The code runs, then stops, but nothing happens. The only ouptut I get is a little message that says "- Unable to find required classes (javax.activation.DataHandler and javax.mail.internet.MimeMultipart). Attachment support is disabled." which seems pretty harmless.
Here is the code I'm using:
public class MyFirstClass { public MyFirstClass() {} public static void main(String args[]) { try { NetSuiteServiceLocator service = new NetSuiteServiceLocator(); service.setMaintainSession(true); NetSuitePortType port; port = service.getNetSuitePort(); //set your login passport RecordRef role = new RecordRef(); role.setInternalId( "3" ); //admin role Passport passport = new Passport("***", "***", "TSTDRV*****", role); StatusDetail[] statusDetail = port.login( passport ).getStatus(); //business logic Customer cust = new Customer(); cust.setEntityId("TWS 1"); cust.setCompanyName("TWS 1"); WriteResponse response = port.add( cust ); /* // Process the results if(response.getStatus().isIsSuccess()) { RecordRef ref = (RecordRef)(response.getBaseRef()); System.out.println("Successful. Record ID = " + ref.getInternalId()); } else { for(int i = 0; i < response.getStatus().getStatusDetail().length; i++) { System.err.println(response.getStatus().getStatusDetail (i).getMessage()); } }*/ //logout port.logout(); } catch (Exception e) { // TODO Auto-generated catch block e.printStackTrace(); } } } (Login information censored)What am I doing wrong?Also, you'll notice I have a "Process the results" section in comments. This is code I took from a post here. I wanted to try to read the response message to try and see if that had anything interesting. However, the code I took seems to be written for something entirely else - MY code tells me "response.getStatus()" returns an Array, so you can't call .isIsSuccess() on it, and in fact .isIsSuccess doesn't even exist! Que??Much confusion here, if anyone can shed some light on this it would be appreciated.