Siebel: Call from java

Here is the code:

    import java.io.*;
    import com.siebel.data.*;
    import com.siebel.data.SiebelException;
    import com.siebel.data.SiebelPropertySet;
    import com.siebel.data.SiebelService;
    public class BasicDataBeanTest
    {
    public static void contacts_add()
    {
    SiebelDataBean m_dataBean = new SiebelDataBean();

    //Create Siebel JDB instance
    SiebelBusObject m_busObject = null;

    SiebelBusComp m_busComp = null;
    SiebelService bs=null;
    SiebelPropertySet ps = null;

    //Define Connection variables
    String strHost = “siebelserver”; // Siebel Server host
    String strEnt = “siebelenterprisename”; // Enterprise
    String strObj = “objectmanager_enu”; // OBJ manager.
    try {

    //Handles Siebel Exceptions
    //Login to Siebel Object Manager (AOM)
    System.setProperty(“file.encoding”, “cp1252″);
    m_dataBean.login(“siebel.TCPIP.None.None://”+strHost+”:1901/”+strEnt+”/”+strObj, “xxxxx”, “xxxx”, “enu”);
    m_busObject = m_dataBean.getBusObject(“Contact”);
    m_busComp = m_busObject.getBusComp(“Contact”);
    ps = m_dataBean.newPropertySet();
    ps.setProperty(“First Name”, “Again-Oracle1″);
    ps.setProperty(“Last Name”, “Again-Databean1″);
    ps.setProperty(“Email Address”, “some@some.com”);
    ps.setProperty(“Work Phone #”, “82082938″);
    m_busComp.activateField (“First Name”);
    m_busComp.activateField (“Last Name”);
    m_busComp.activateField (“Email Address”);
    m_busComp.activateField (“Work Phone #”);
    m_busComp.newRecord(true);
    m_busComp.setMultipleFieldValues(ps);
    m_busComp.writeRecord();
    m_dataBean.logoff(); //Log off from Siebel AOM
    }catch (SiebelException e) {
    status[0] = “Error Calling BS:”+e.toString();
    }

Leave a Reply