Friends when I was working on Siebel Android App, I had a very big question: How to make connection with Siebel to get Siebel data and display it on mobile app ?
At that time I struggled for 2-3 days then finally I came to know that there are two ways of making connection with Siebel and get Siebel data access.
1.) Access Siebel Web Services through ksoap2 connections
2.) Make a direct entry in Siebel through Siebel JAVA DATA BEAN
In this post, I will explain second method. It’s pros and cons, what problems I had faced and full explanation of how to implement this. Well I am a Siebel guy, so you will find a working java code only.
Let’s start one by one…
At that time I struggled for 2-3 days then finally I came to know that there are two ways of making connection with Siebel and get Siebel data access.
1.) Access Siebel Web Services through ksoap2 connections
2.) Make a direct entry in Siebel through Siebel JAVA DATA BEAN
In this post, I will explain second method. It’s pros and cons, what problems I had faced and full explanation of how to implement this. Well I am a Siebel guy, so you will find a working java code only.
Let’s start one by one…
Pros: We can have direct Siebel data access where we can write our code as if we writing any business script.
Cons: It makes separate connection for each request, so it can be show stopper if we haven’t managed connection pooling or something.
How to implement:
A Java client that uses the Siebel Java Data Bean to connect to the Siebel Server requires JAR files. These files allow the Java language to access the objects and methods of the Siebel Object Interface.
To access the Siebel Java Data Bean
- Add the following JAR files to the CLASSPATH:
- To install the Siebel Java Data Bean interface, do one of the following:
- Start a new SiebelDataBean Java object.
-
dataBean = new SiebelDataBean();
- To call the Login method for the object you started in Step 3, use the following code:
connectString = String.format("Siebel://"+gateway_server+":"+gateway_port+"/"+entrpr_name+"/SSEObjMgr_enu");
-
dataBean.login(connectString, username, password, "enu");
-
sample
connectString = siebel.TCPIP.None.None://13.129.57.30:2014/eagleprodunt/EAIObjMgr_enu
Example of Accessing the Siebel Java Data Bean
The following example code accesses the Siebel Java Data Bean. You can use a Java IDE to compile and run this code:
[su_accordion][su_spoiler title=”Click to see the code” style=”fancy”]
import com.siebel.data.*; import com.siebel.data.SiebelException; public class DataBeanDemo { private SiebelDataBean m_dataBean = null; private SiebelBusObject m_busObject = null; private SiebelBusComp m_busComp = null; public static void main(String[] args) { DataBeanDemo demo = new DataBeanDemo(); } public DataBeanDemo() { try { // instantiate the Siebel Java Data Bean m_dataBean = new SiebelDataBean(); // log in to the Siebel Server // SiebelServerhost = the name or IP address of your Siebel Server // SCBPort = listening port number for the SCBroker component (default 2321) m_dataBean.login("Siebel://SiebelServerhost:SCBPort/enterpriseServer/ AppObjMgr_enu", Username, Passw, "enu"); // get the business object SiebelBusObject busObject = dataBean.getBusObject("Contact"); // get the business component SiebelBusComp busComp = busObject.getBusComp("Contact"); SiebelService bsOCMgr = dataBean.getService("Outbound Communications Manager"); SiebelPropertySet psInp = new SiebelPropertySet(); SiebelPropertySet psOut = new SiebelPropertySet(); busComp.setViewMode(3); busComp.clearToQuery(); busComp.activateField("Id"); busComp.activateField("First Name"); busComp.activateField("Last Name"); busComp.activateField("Email Address"); busComp.setSearchSpec("Login Name", "SADMIN"); busComp.setSearchSpec("First Name", "CHRISTINA"); busComp.executeQuery2(true,true); if (busComp.firstRecord()) { String Email = busComp.getFieldValue("Email Address"); System.out.println("Email Address"+ Email); } bsOCMgr.release(); busComp.release(); busObject.release(); // log off m_dataBean.logoff(); } catch (SiebelException e) { System.out.println(e.getErrorMessage()); } } }
[/su_spoiler]
[/su_accordion]
We can find more detailed version of this on below links:
Hope this will help someone in need. Thanks for reading this. Please feel free to have your comments below.
[su_divider]
@AskmeSiebel
Thanks for subscribing to SimplySiebel.
28 comments for “Siebel JAVA DATA BEAN”