UCM connection to a file from Java


Here is the snippet to connect to UCM from java


// create the IDC Client Manager manager
IdcClientManager manager = new IdcClientManager();

// build a client that will communicate using the HTTP protocol
IdcClient idcClient;

try {
//context with ucm username and password
IdcContext user = new IdcContext ("webadmin", "passw0rd");
//ucm link
idcClient = manager.createClient("idc://ucmwebcenterqa01.group.com:4444");

// get the binder
DataBinder binder = idcClient.createBinder();

// populate the binder with the parameters
binder.putLocal ("IdcService", "GET_FILE");
binder.putLocal("dDocName", "UCM_CLUSTER1001204");
binder.putLocal("RevisionSelectionMethod", "Latest");

try {
ServiceResponse response = idcClient.sendRequest (user, binder);

// get the response as a string
String responseString = response.getResponseAsString ();
//dispaly the content of the file
System.out.println ("" + responseString);

} catch (IdcClientException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}
} catch (IdcClientException e) {
e.printStackTrace();
}
}

Advertisements

2 thoughts on “UCM connection to a file from Java

  1. cheapuggsonsalebuy.webeden.co.uk

    After a pause he continued his story.Don’t count on me.He repaired his house.There are lots of huge buildings in Beijing.That’s all!I am on my way to the grocery store.I am on my way to the grocery store.I don’t mean it.He has completed the task.She’s been quite different since coming back from America.

    Reply
  2. Akshya

    Getting error with this code. Do you have nay suggestion.

    java.lang.RuntimeException: Failed to Instantiate WsMetaFactory due to missing class “oracle.j2ee.ws.client.OracleWsMetaFactory” in the classpath. Please add appropriate jar for “JRF” client in the classpath.

    Reply

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s