2022

Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  1. Authentication variable
  2. Profile variable
  3. Payload - Process Definition Language
    Info
    titleHTTP Post Request

    Post URL: http(s)://<<server>>:<<port>>/dbsync2/dbsyncrestservice.m
    Post Parameters:
    1. authenticationXML:

...

  1.   It provides the authentication username/password

...

2. profileXML

3. payload

  1. and name of the profile.
    2. *profileXML: *Defines the connection profile for the integration process to execute. See "Profile" section below
    3. *payload: *Defines the process to execute. The name is in the form of "processdefinition_"<<process_name>>".xml 

    All post parameters should be UTF-8 encoded.

The following section illustrates how these parameters can be found within DBSync intallation and modify as per to your DBSync and Adapter configurations.

...

The authentication module verifies your DBSync UserIdUsername, Password and Profile used for Integration. The following is a sample DBSync credential which is used for authentication.

Username : Avinashyour_username@company.r@avankia.com
Password : Password
Profile Name : IntacctToDatabase

Code Block


<authentication>
<userName>username@yourcompany.com</userName>
<password>your_password</password>
<profile>IntacctToDatabase</profile>
</authentication>

Profile :

Defines the process to execute. The name is in the form of "processdefinition_"<<process_name>>".xml

Profile.xml file stores configuration details of your integration adapters for which you have registered at the time of purchase. The default installation folder of DBSync would be "C:\DBSyncIS292". Presuming that DBSync is installed in the default directory, you can find the path of the profile.xml as shown below.

...

Code Block
<?xml version="1.0" encoding="UTF-8"?>

<!-- DBSYncDBSync User Details -- >

<profile id="avinash.r@avankia.com" name="IntacctToDatabase" loglevel="ALL" email="" guid="0006FBC6">

<!-- Intacct Adapter Configuration -- >

<adapter name="Intacct" type="com.avankia.appmashups.adapter.intacct.IntacctAdapter">
<property name="userid">username</property>
<property name="password" encrypted="true">b0mp03M2WA=<>XXXXXX</property>
<property name="senderid">avankia</property>
<property name="dtdversion">2.1</property>
<property name="hostUrl">www.intacct.com</property>
<property name="companyid">company-DEV</property>
<property name="controlpassword">YGgH4f267<>XXXXXXX</property>
</adapter>
<adapter name="ConsoleAdapter" type="com.avankia.appmashups.engine.conversion.adapters.ConsoleAdapter" />

<!-- Database Adapter Configuration  -- >

<adapter name="database" type="com.avankia.appmashups.engine.conversion.adapters.DatabaseAdapter">
<property name="password" encrypted="true">gQkrFAtGxQjkfeVQ==<>XXXXXX</property>
<property name="url">jdbc:sqlserver://localhost:1433;databaseName=Intacct</property>
<property name="autocommit">true</property>
<property name="driver">sqlserver</property>
<property name="dbname">intacct</property>
<property name="username">sa</property>
</adapter>
</profile>

...

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>localhost@avankia<userName>username@company.com</userName>" + "<password>localhost<<password>password</password>" + "<profile>INTACCT<<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">b0mp03MygWA=<>XXXXXXXXX</property>"+ //Encrypted Intacct Password
"<property name="senderid">avankia<>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">YGgH4f3567<>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">HCQpwukG7brzQu3pZW2wjQ==<>XXXXXXX</property>"\+ //Database Password
"<property name="url">jdbc:mysql://localhost:3306/intacct<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);
}
}