Siebel EAI: Create a account with EJB3.x using AccountAttachment Business Service

來源:互聯網
上載者:User

This is a new feature in 8.1.1. And since my env is not a published release, may be you cannot achieve same thing in your env. However, may be you can approach this functional in 8.2 in future.

 

1. Go to Siebel Code Generator to generate EJB codes for BS:AccountAttachment. You can find this toolkit in Siebel Tools.

2. Deploy your EJB to application server

3. following is my codes of creating 1000 accounts.

package accountattachment;import com.siebel.data.SiebelException;import com.siebel.ejb.jca.accountattachment.AccountAttachmentSessionEJBRemote;import com.siebel.integration.util.JCASessionProperties;import java.util.Hashtable;import java.util.ArrayList;import javax.naming.Context;import javax.naming.InitialContext;import javax.naming.NamingException;import javax.rmi.PortableRemoteObject;import com.siebel.local.account.Account_AttachmentIC;import com.siebel.local.account.AccountIO;import com.siebel.local.account.AccountIC;import com.siebel.local.account.Document;import com.siebel.service.jca.accountattachment.QueryByExampleInput;import com.siebel.service.jca.accountattachment.QueryByExampleOutput; //.QueryPageOutput;import com.siebel.service.jca.accountattachment.InsertInput;import com.siebel.service.jca.accountattachment.InsertOutput;import com.siebel.service.jca.accountattachment.InsertInput;import com.siebel.service.jca.accountattachment.InsertOutput;import java.io.File;import java.io.FileInputStream;import java.io.FileOutputStream;public class AccountAttachment_Insert1000Accounts {    private static InitialContext jndi ;        private static void init() throws Exception    {        Hashtable ht = new Hashtable();        ht.put(Context.INITIAL_CONTEXT_FACTORY,               "weblogic.jndi.WLInitialContextFactory");        ht.put(Context.PROVIDER_URL, "t3://localhost:7101");        ht.put(Context.SECURITY_PRINCIPAL, "weblogic");        ht.put(Context.SECURITY_CREDENTIALS, "weblogic1");        jndi = new InitialContext(ht);    }        private static AccountAttachmentSessionEJBRemote getEJBHome(String EJBName) throws NamingException {        AccountAttachmentSessionEJBRemote m_cf_home =            (AccountAttachmentSessionEJBRemote)PortableRemoteObject.narrow(jndi.lookup(EJBName),                                                                           AccountAttachmentSessionEJBRemote.class);        System.out.println("m_cf_home " + m_cf_home.toString());        return m_cf_home ;    }        private static void createAccount(String accountName) throws NamingException {        AccountAttachmentSessionEJBRemote m_cf_home = getEJBHome("yxyTest.AccountAttachmentSessionEJB") ;        ArrayList<AccountIC> ioc = null;        AccountIO objAccountIO = new AccountIO();        InsertInput objInsertInput = new InsertInput();        InsertOutput objInsertOutput = new InsertOutput();        objInsertInput.setfLOVLanguageMode("LIC");        objInsertInput.setfViewMode("All");                        JCASessionProperties objJCAEJBStructure= new JCASessionProperties();        objJCAEJBStructure.setSessionUserName("SADMIN");        objJCAEJBStructure.setSessionPassword("SADMIN");        AccountIC objAccountIC = new AccountIC();        objAccountIC.setfName(accountName);        objAccountIC.setfLocation("Beijing");        objAccountIC.setfPrimary_Organization("Default Organization");        objAccountIC.setfAccount_Status("Active");                AccountIC[] objAccountICArray = new AccountIC[1];        objAccountICArray[0] = objAccountIC;                objAccountIO.setfintObjInst(objAccountICArray[0]);        objAccountIO.setfdocObjInst(null);        objInsertInput.setfSiebelMessage(objAccountIO);        objInsertOutput = m_cf_home.Insert(objInsertInput, objJCAEJBStructure);    }        public static void main(String[] ars) throws Exception {        init() ;            for(int i=1 ; i<=1000 ; i++)        {            createAccount("Account_"+i) ;        }                    }}
相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.