Hi DFS Gurus,
I am implementing DFS WebServices SP3 with C# .net 3.5. I have added WSDL link to web reference and using .net WCF. I have managed to write a SOAP message header part on fly. There are two options I can create service context on server. 1) Register service context and use token next time to call services. OR 2) Do NOT register service context and use username and password everytime you call services.
I am prettymuch new to DFS and documentum.
1) Register service context
----------------------------------------------
ServiceContext serviceContext = new ServiceContext();
RepositoryIdentity repositoryIdentity = new RepositoryIdentity();repositoryIdentity.repositoryName = docbase;
repositoryIdentity.userName = userName;
repositoryIdentity.password = password;
serviceContext.Identities = new Identity[1];serviceContext.Identities[0] = repositoryIdentity;
token = reg.register(serviceContext,
null);
ContextRegistryHeader crh = new ContextRegistryHeader();crh.Token = token;
OperationContext.Current.OutgoingMessageHeaders.Add(crh);
----------------------------------------------
Here I am planning to save this token in ASP.net cookies, so I can use it later on. But not sure about how long registered service context will stay alive on server, So I can kill my cookie after that period.
====================
2) DO NOT register service context // This is actually I prefer to use services.
----------------------------------------------
ServiceContextHeader
scx = new ServiceContextHeader();
RepositoryIdentity repositoryIdentity = new RepositoryIdentity();repositoryIdentity .repositoryName = docbase;
repositoryIdentity .userName = userName;
repositoryIdentity .password = password;
scx.AddRepositoryIdentity(repositoryIdentity);
OperationContext
.Current.OutgoingMessageHeaders.Add(scx);
----------------------------------------------
I have tested this snipet with SearchServices and sometime it works and sometime it throw error : Authorization failed, Could not find Identities in Service context.
I was testing with ObjectServices and everytime getting an error: Authorization failed, Could not find Identities in Service context.
Any one who worked with DFS webservices with .net please help me out.