Thanks for response.
1. I have given an example in the code snippet, even thought I have provided host name of the CS server (CS in separate machine and portal running in separate) ,still the issue persists.
2. I am using user (weblogic) and he has sufficient privileges to create and manage content in content server.
Requesting you to please suggest.