...
Info |
---|
Your Projector account may be hosted on any one of multiple Projector servers. Before consuming web services, it is necessary that your program ascertain the url of the server that hosts your company's data. Therefore, the first thing that your web services code should do is get the correct url by calling the GetWebServiceUrl service. Below is a C# example of retrieving your service url. |
Code Blocktip | |||||
---|---|---|---|---|---|
| |||||
This example assumes that you can create a session ticket. To learn how to create session tickets see C Sharp Example. You must use the v2 web services to generate session tickets. They can be used by the v1 services. |
Code Block | ||||
---|---|---|---|---|
| ||||
OpsProjectorSvc svc = new OpsProjectorSvc (); svc.OpsAuthenticationHeaderValue = new OpsAuthenticationHeader (); svc.OpsAuthenticationHeaderValue.AccountName = "(sessionticket)"; //you can log in using your credentials directly, but we strongly discourage this approach. You should generate session tickets to log in. Direct credentials are fine for some simple tests //svc.OpsAuthenticationHeaderValue.AccountName = "(account-name)"; //svc.OpsAuthenticationHeaderValue.EmailAddress = "(user-name)"; //svc.OpsAuthenticationHeaderValue.Password = "(password)"; GetWebServiceUrlRq rq = new GetWebServiceUrlRq (); GetWebServiceUrlRs rs = svc.GetWebServiceUrl (rq); if (rs.WebServiceUrl != null) { svc.Url = string.Format("{0}/OpsProjectorWebSvc/OpsProjectorSvc.asmx", rs.WebServiceUrl); } // Use svc to invoke further web services |
...