hello,
I want to make application to upload file in documentum with asp.net C#
can any one help me out with code and .dll file to write this code
thank you . happy coding..
Regards
ameya
Take a look at this - http://developer-content.emc.com/developer/Articles/ASP.NET_Sample/Overview_Article_0.htm
You have to develop other DFC through OLE COM.
Officially supported API from .NET is DFS, the web sevices API
i m using asp.net 3.5 with C# aslso using DFS webservice . getting following Error--
Code
________________________________________________________________________________________________________________________________
try
{
#region "Add Section"
string RepositoryName = ConfigurationManager.AppSettings["RepositoryName"].ToString();
string moduleName = ConfigurationManager.AppSettings["ModuleName"].ToString();
string addresss = ConfigurationManager.AppSettings["Address"].ToString();
string userName = ConfigurationManager.AppSettings["UserName"].ToString();
string password = ConfigurationManager.AppSettings["password"].ToString();
#endregion
//IDfClientX iu = new IDfClientX();
ContextFactory contextFactory = ContextFactory.Instance;
IServiceContext serviceContext = contextFactory.NewContext();
ServiceFactory serviceFactory = ServiceFactory.Instance;
IObjectService objectService = serviceFactory.GetRemoteService<IObjectService>(serviceContext, moduleName, addresss);
string documentFilePath = "D:\\DCTMView\\tmp.pdf";
//string documentStatus = "New";
//string documentPolicyId = "19423485";
string customer_name = "ameya";
string RSM_CODE = "70038007";
string CONTRACT_No = "9014750";
ContentTransferProfile transferProfile = new ContentTransferProfile();
transferProfile.TransferMode = ContentTransferMode.MTOM;
transferProfile.Geolocation = "Pleasanton";
serviceContext.SetProfile(transferProfile);
ObjectIdentity objIdentity = new ObjectIdentity(RepositoryName);
DataObject dataObject = new DataObject(objIdentity, "rli_grp_pproposal");
PropertySet properties = dataObject.Properties;
properties.Set("object_name", customer_name + "_" + RSM_CODE + "_" + CONTRACT_No);
properties.Set("contract_no", CONTRACT_No);
properties.Set("rsm_code", RSM_CODE);
properties.Set("customer_name", customer_name);
System.IO.FileInfo File = new System.IO.FileInfo(documentFilePath);
List<Emc.Documentum.FS.DataModel.Core.Content.Content> binContents = new List<Emc.Documentum.FS.DataModel.Core.Content.Content>();
BinaryContent binContent = new BinaryContent();
binContent.Value = makeBytes(documentFilePath);
binContent.Format = "pdf";
binContents.Add(binContent);
dataObject.Contents = binContents;
OperationOptions operationOptions = null;
DataPackage dataPakage = objectService.Create(new DataPackage(dataObject), operationOptions);
List<DataObject> dataObjectList = dataPakage.DataObjects;
foreach (DataObject resultDataObject in dataObjectList)
ObjectId resultObjId = (ObjectId)resultDataObject.Identity.Value;
//Response.Write("ObjectID " + resultObjId.Id);
lblError.Text = "ObjectID -->> " + resultObjId.Id;
}
catch (Exception ex)
lblError.Text = ex.ToString();
//throw;
_________________________________________________________________________________________________________________________________
Error:-
Emc.Documentum.FS.Runtime.ServiceInvocationException: Service method "Create" invocation failed. ---> System.ServiceModel.FaultException: Authorization failed, could not find identities in service context with token "temporary/127.0.0.1-1339146392130-744701469" Server stack trace: at System.ServiceModel.Channels.ServiceChannel.HandleReply(ProxyOperationRuntime operation, ProxyRpc& rpc) at System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins, Object[] outs, TimeSpan timeout) at System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins, Object[] outs) at System.ServiceModel.Channels.ServiceChannelProxy.InvokeService(IMethodCallMessage methodCall, ProxyOperationRuntime operation) at System.ServiceModel.Channels.ServiceChannelProxy.Invoke(IMessage message) Exception rethrown at [0]: at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg) at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type) at Emc.Documentum.FS.Services.Core.ObjectServicePort.create(createRequest request) at Emc.Documentum.FS.Services.Core.ObjectServicePortClient.Emc.Documentum.FS.Services.Core.ObjectServicePort.create(createRequest request) at Emc.Documentum.FS.Services.Core.ObjectServicePortClient.Create(DataPackage dataPackage, OperationOptions options) --- End of inner exception stack trace --- at Emc.Documentum.FS.Runtime.Context.Impl.ClientReflectionServiceInvoker.Invoke(Object proxy, MethodInfo method, Object[] args) at Emc.Documentum.FS.Runtime.Context.Impl.SoapClientInvocationHandler.Invoke(Object proxy, MethodInfo method, Object[] arguments) at Emc.Documentum.FS.Runtime.Context.Impl.UcfClientInvocationHandler.Invoke(Object proxy, MethodInfo method, Object[] args) at Emc.Documentum.FS.Runtime.Context.Impl.HttpSessionInvocationHandler.Invoke(Object proxy, MethodInfo method, Object[] args) at Emc.Documentum.FS.Runtime.Context.Impl.ContextThreadLocalInvocationHandler.Invoke(Object proxy, MethodInfo method, Object[] args) at Emc.Documentum.FS.Runtime.Context.Impl.ReturnedContentTransformationHandler.Invoke(Object proxy, MethodInfo method, Object[] args) at Emc.Documentum.FS.Runtime.Context.Impl.ServiceContextInvocationHandler.Invoke(Object proxy, MethodInfo method, Object[] args) at $Proxy0.Emc.Documentum.FS.Services.Core.IObjectService.Create(DataPackage , OperationOptions ) at uploadDocs.Page_Load(Object sender, EventArgs e) in c:\DCTMV\Testweb1\uploadDocs.aspx.cs:line 114
You created a new ServiceContext, but did not pass the user/pswd to it. Please get DFS samples from SDK.
Regards,
William
hello William
Stiil getting same error
_______________________________________________________________________________________
CODE :-
//ContextFactory contextFactory = ContextFactory.Instance;
////contextFactory.
//IServiceContext serviceContext = contextFactory.Register(serviceContext, moduleName, addresss);
//serviceContext = contextFactory.NewContext();
//ServiceFactory serviceFactory = ServiceFactory.Instance;
//IObjectService objectService = serviceFactory.GetRemoteService<IObjectService>(serviceContext, moduleName, addresss);
serviceContext = contextFactory.NewContext();
RepositoryIdentity repositoryIdentity = new RepositoryIdentity(RepositoryName, userName, password, addresss);
serviceContext.AddIdentity(repositoryIdentity);
string documentFilePath = "D:\\Dfstemp\\temp.pdf";
//string documentPolicyId = "87945612";
//ContentTransferProfile ct = new ContentTransferProfile();
//ct.TransferMode = ContentTransferMode.UCF;
//serviceContext.SetProfile(ct);
binContent.Format = Path.GetExtension(documentFilePath);
________________________________________________________________________________________________
EROOR:-
Emc.Documentum.FS.Runtime.ServiceInvocationException: Service method "Create" invocation failed. ---> System.ServiceModel.FaultException: Authorization failed, please review identities provided in service context "temporary/127.0.0.1-1339161107757-341506162" Server stack trace: at System.ServiceModel.Channels.ServiceChannel.HandleReply(ProxyOperationRuntime operation, ProxyRpc& rpc) at System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins, Object[] outs, TimeSpan timeout) at System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins, Object[] outs) at System.ServiceModel.Channels.ServiceChannelProxy.InvokeService(IMethodCallMessage methodCall, ProxyOperationRuntime operation) at System.ServiceModel.Channels.ServiceChannelProxy.Invoke(IMessage message) Exception rethrown at [0]: at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg) at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type) at Emc.Documentum.FS.Services.Core.ObjectServicePort.create(createRequest request) at Emc.Documentum.FS.Services.Core.ObjectServicePortClient.Emc.Documentum.FS.Services.Core.ObjectServicePort.create(createRequest request) at Emc.Documentum.FS.Services.Core.ObjectServicePortClient.Create(DataPackage dataPackage, OperationOptions options) --- End of inner exception stack trace --- at Emc.Documentum.FS.Runtime.Context.Impl.ClientReflectionServiceInvoker.Invoke(Object proxy, MethodInfo method, Object[] args) at Emc.Documentum.FS.Runtime.Context.Impl.SoapClientInvocationHandler.Invoke(Object proxy, MethodInfo method, Object[] arguments) at Emc.Documentum.FS.Runtime.Context.Impl.UcfClientInvocationHandler.Invoke(Object proxy, MethodInfo method, Object[] args) at Emc.Documentum.FS.Runtime.Context.Impl.HttpSessionInvocationHandler.Invoke(Object proxy, MethodInfo method, Object[] args) at Emc.Documentum.FS.Runtime.Context.Impl.ContextThreadLocalInvocationHandler.Invoke(Object proxy, MethodInfo method, Object[] args) at Emc.Documentum.FS.Runtime.Context.Impl.ReturnedContentTransformationHandler.Invoke(Object proxy, MethodInfo method, Object[] args) at Emc.Documentum.FS.Runtime.Context.Impl.ServiceContextInvocationHandler.Invoke(Object proxy, MethodInfo method, Object[] args) at $Proxy0.Emc.Documentum.FS.Services.Core.IObjectService.Create(DataPackage , OperationOptions ) at uploadDocs.Page_Load(Object sender, EventArgs e) in d:\dms\Testweb1\uploadDocs.aspx.cs:line 104
Have you confirmed that the calls to
string RepositoryName = ConfigurationManager.AppSettings["RepositoryName"].ToString();string userName = ConfigurationManager.AppSettings["UserName"].ToString();string password = ConfigurationManager.AppSettings["password"].ToString();
return the values you expect, i.e. a valid repository that is accessible by the server side DFS and a valid username/password combination for that repository?
You may also want to check the server side logs to see if you have related messages there.
hello andy
All values are valid but still getting error. can you give sample code to upload file in in documentum with help of asp.net C# and DFS 6.5
Thanks & Regards
Ameya
The best place to look for samples are the files that ship with the DFS SDK. There is also some advice around using .NET in the DFS developer guide documentation.
You may also want to turn on SOAP tracing from the .NET client to make sure that it is working as expected an passing the credentials in the header.