2022
...
The following section illustrates how these parameters can be found within DBSync intallation and modified modify as per to your DBSync and Adapter configurations.
...
Code Block |
---|
package com.avankia.appmashups.rest; import java.io.File; import java.net.URLEncoder; import org.apache.commons.io.FileUtils; public class TestClient { public static void main(String[] args) throws Exception { String authenticationXML = "<authentication>" + "<userName>username@company.com</userName>" + "<password>password</password>" + "<profile>IntacctToDatabase</profile>" + "</authentication>"; String profileXML2=""; String profileXML = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>"\+ /* Intacct Adapter Configuration */ "<profile id="localhost@avankia.com" name="INTACCT" loglevel="ALL" email=""guid="01F6CCDC">"+ "<adapter name="Intacct" type="com.avankia.appmashups.adapter.intacct.IntacctAdapter">"+ "<property name="userid">admin</property>"+ // Intacct UserId "<property name="password" encrypted="true">XXXXXXXXX</property>"+ //Encrypted Intacct Password "<property name="senderid">company</property>"+ // Intacct SenderId "<property name="dtdversion">2.1</property>"+ // Intacct DTD Version "<property name="hostUrl">www.intacct.com</property>"+ // Host URL "<property name="companyid">Company-ID</property>"+ // Intacct Company Id "<property name="controlpassword">YYYYYYYY</property>"\+ // Intacct Control Password "</adapter>"+ /* Database Adapter Configuration */ "<adapter name="database" type="com.avankia.appmashups.engine.conversion.adapters.DatabaseAdapter">"+ "<property name="password" encrypted="true">XXXXXXX</property>"\+ //Database Password "<property name="url">jdbc:mysql://localhost:3306/yourdb</property>"+ // Database Connection String "<property name="autocommit">true</property>"+ "<property name="driver">mysql</property>"+ // Database Driver "<property name="dbname">mysql</property>"+ "<property name="username">root</property>"+ // Database User "</adapter>"+ "</profile>"; \\ StringBuilder content = new StringBuilder(); content.ppend("authenticationXML="); content.append(URLEncoder.encode(authenticationXML, "UTF-8")); content.append("&"); content.append("profileXML="); content.append(URLEncoder.encode(profileXML, "UTF-8")); content.append("&"); content.append("payload=processdefinition_testpdl.xml"); String response = Http.post("http://localhost:8080/dbsync2/dbsyncrestservice.m", content.toString(), "application/x-www-form-urlencoded"); System.out.println("HTTP Response:\n"+response); } } |
If successfully submitted, the return value is "success"
If there is an error, an HTTP Error is returned with HTTP Error string with the error message.