...
Code Block |
---|
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
namespace WebApplication1
{
using Projector = com.projectorpsa.secure;
public partial class index : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
//create an instance of the Projector Service
Projector.OpsProjectorSvc svc = new Projector.OpsProjectorSvc();
//Authenticate with server and ensure we have the correct Service URL
svc.OpsAuthenticationHeaderValue = new Projector.OpsAuthenticationHeader();
svc.OpsAuthenticationHeaderValue.AccountName = "yourAccountName";
svc.OpsAuthenticationHeaderValue.EmailAddress = "yourEmailAddress";
svc.OpsAuthenticationHeaderValue.Password = "yourPassword";
Projector.GetWebServiceUrlRq gwsuRq = new Projector.GetWebServiceUrlRq();
Projector.GetWebServiceUrlRs gwsuRs = svc.GetWebServiceUrl(gwsuRq);
if (gwsuRs.WebServiceUrl != null)
{
svc.Url = string.Format("{0}/OpsProjectorWebSvc/OpsProjectorSvc.asmx", gwsuRs.WebServiceUrl);
}
//Retrieve some data from the installation using Rq/Rs
Projector.ExportResourcesRq erRq = new Projector.ExportResourcesRq();
erRq.Parameters = new Projector.ExportResourcesRequest();
erRq.Parameters.OnlyCountRows = true;
Projector.ExportResourcesRs erRs = svc.ExportResources(erRq);
int iResources = erRs.Data.RowCount;
//Retrieve some more data from the installation using Request/Response
Projector.ExportResourcesRequest erRequest = new Projector.ExportResourcesRequest();
erRequest.OnlyCountRows = true;
Projector.ExportResourcesResponse erResponse = svc.ExportResources(erResponse);
int iResources2 = erResponse.RowCount;
}
}
} |