FORUMS

c360 Forums
 Home        Members    Calendar    Who's On

Welcome Guest ( Login | Register )
      



Ways to retrieve CrmService/MetadataService...Expand / Collapse
Message
Posted 6/13/2007 11:07:23 AMPost #1557
 

Forum MemberForum MemberForum MemberForum MemberForum MemberForum MemberForum MemberForum Member
I know that each page instance has CrmService and MetadataService but I want to use them independantly in a class but using c360.config settings.  Is there a way to get these or the urls and credentials globally?  I see c360.Toolkit.Util class has some ways to retrieve the necessary settings but I don't see all.

Util.GetCrmServicesUrl()

Util.GetCrmServicesUrl(string webServiceName)

Util.GetWebConfigSetting(string strWebConfigKeyName)

I could also extract them and save it on the first page hit (any page) but I'm looking for another method.

Posted 6/15/2007 3:48:35 PMPost #1567
 

c360 Product Guruc360 Product Guruc360 Product Guruc360 Product Guruc360 Product Guruc360 Product Guruc360 Product Guruc360 Product Guru
jihohan (6/13/2007)
I know that each page instance has CrmService and MetadataService but I want to use them independantly in a class but using c360.config settings.  Is there a way to get these or the urls and credentials globally?  I see c360.Toolkit.Util class has some ways to retrieve the necessary settings but I don't see all.

Util.GetCrmServicesUrl()

Util.GetCrmServicesUrl(string webServiceName)

Util.GetWebConfigSetting(string strWebConfigKeyName)

I could also extract them and save it on the first page hit (any page) but I'm looking for another method.

There is a way but please note that it isn't supported. The reason why it's not supported is because if you use this technique in your class outside of a web application with the expected folder structure, this method may not work, it may or may not be able to find the expected configuration files and therfore we are not supporting this scenario.

Now that the disclaimer is out of the way , here's how you can do it:

ICrmService crmService = CrmServiceFactory.CreateCrmService();

IMetadataService metadataService = MetadataServiceFactory.CreateMetadataService();



 

« Prev Topic | Next Topic »


Reading This TopicExpand / Collapse
Active Users: 0 (0 guests, 0 members, 0 anonymous members)
No members currently viewing this topic.
Forum Moderators: kanika.jackson, Ken Champion

PermissionsExpand / Collapse

All times are GMT -5:00, Time now is 3:22pm

Powered by InstantForum.NET v4.1.4 © 2008
Execution: 7.656. 14 queries. Compression Enabled.