This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//getting an entry (the one we just set) | |
//setting up parameters for get_entry | |
Link_name_to_fields_array[] link_name_to_fields_array = null; | |
String[] select_fields = null; | |
Get_entry_result_version2 getEntryResponse = null; | |
//trying to get entry | |
try { | |
getEntryResponse = stub.get_entry(loginResponse.getId(), MODULE_NAME, setEntryResponse.getId(), select_fields , link_name_to_fields_array); | |
} catch (RemoteException e) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//setting a new entry | |
//setting up parameters for set_entry call. | |
//creating a name value list array from a hash map. This is not necessary | |
//just more elegant way to initialize and add name values to an array. | |
HashMap<String, String> nameValueMap = new HashMap<String, String>(); | |
nameValueMap.put("first_name", "foo"); | |
nameValueMap.put("last_name", "bar"); | |
nameValueMap.put("description", "this is a contact created from a SOAP web service call"); | |
nameValueMap.put("email1", "foo@bar.com"); | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//login | |
//setting up parameters for login method | |
User_auth auth = new User_auth(); | |
auth.setUser_name(USER_NAME); | |
auth.setPassword(PASSWORD); | |
//sending an empty name_value_list | |
Name_value nameValueListLogin[] = null; | |
//trying to login |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//trying to create a stub | |
SugarsoapBindingStub stub = null; | |
try { | |
stub = new SugarsoapBindingStub(url, new Service()); | |
} catch (AxisFault e) { | |
System.out.println("stub creation failed. Message: "+e.getMessage()); | |
e.printStackTrace(); | |
} | |
System.out.println("stub created successfully!"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class SOAPClient { | |
private static final String ENDPOINT_URL = "http://localhost:8888/Mango/build/rome/builds/ent/sugarcrm/service/v3/soap.php"; | |
private static final String USER_NAME = "admin"; | |
private static final String PASSWORD = "0cc175b9c0f1b6a831c399e269772661"; | |
private static final String APPLICATION_NAME = "sugarcrm"; | |
private static final String MODULE_NAME = "Contacts"; | |
public static void main (String args[]){ | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private static final String ENDPOINT_URL = "http://localhost:8888/Mango/build/rome/builds/ent/sugarcrm/service/v3/soap.php"; | |
private static final String USER_NAME = "admin"; | |
private static final String PASSWORD = "0cc175b9c0f1b6a831c399e269772661"; | |
private static final String APPLICATION_NAME = "sugarcrm"; | |
private static final String MODULE_NAME = "Contacts"; |