If you plan to use it, you will need to choose between the sitecore webservice or the sitecore rocks webservice.
- The sitecore webservice
- + Included in sitecore by default
- + Secured (you need to pass some credentials to execute the methods)
- – Very basic
- The sitecore rocks webservice
- + Include all feature from the basic one and add some functionalities
- + Secured (you need to pass some credentials to execute the methods)
- – Need to add the webservice before using in (not by default in sitecore but it is only 2-3 files to copy)
- Create a reference to your webservice into your project
- Sitecore WS: http://[HOSTNAME]/sitecore/shell/Webservice/Service.asmx
- Rocks WS: http://[HOSTNAME]/sitecore/shell/Webservice/Service2.asmx
- Create some credentials
- Sitecore WS:
OldWS.Credentials oldCredentials = new OldWS.Credentials(); oldCredentials.UserName = @"sitecore\admin"; oldCredentials.Password = "b";
- Rocks WS:
RocksWS.Credentials credentials = new RocksWS.Credentials(); credentials.UserName = @"sitecore\admin"; credentials.Password = "b";
- Create an instance of the webservice
- Sitecore WS
OldWS.VisualSitecoreServiceSoapClient oldWs = new OldWS.VisualSitecoreServiceSoapClient();
- Rocks WS
RocksWS.SitecoreWebService2SoapClient ws = new RocksWS.SitecoreWebService2SoapClient();
- Sitecore WS
- Use the methods of the webservice for example
- GetChildren:
- Sitecore WS
//The parent item const string dictionaryId = "{504AE189-9F36-4C62-9767-66D73D6C3084}"; var dictionaryChildren = oldWs.GetChildren(dictionaryId, "master", OldCredentials);
- Rocks WS
//The parent item const string dictionaryId = "{504AE189-9F36-4C62-9767-66D73D6C3084}"; var dictionaryChildren = Ws.GetChildren(dictionaryId, "master", Credentials);
No comments:
Post a Comment