//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:2.0.50215.44
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
//
// This source code was auto-generated by Microsoft.VSDesigner, Version 2.0.50215.44.
//
namespace SmartInstitute.Automation.SmartInstituteServices.StudentService {
using System.Diagnostics;
using System.Web.Services;
using System.ComponentModel;
using System.Web.Services.Protocols;
using System;
using System.Xml.Serialization;
/// <remarks/>
[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.ComponentModel.DesignerCategoryAttribute("code")]
[System.Web.Services.WebServiceBindingAttribute(Name="StudentServiceSoap", Namespace="http://oazabir.com/webservices/smartinstitute")]
[System.Xml.Serialization.XmlIncludeAttribute(typeof(AccountBase))]
[System.Xml.Serialization.XmlIncludeAttribute(typeof(AssessmentBase))]
[System.Xml.Serialization.XmlIncludeAttribute(typeof(CourseTakenByStudentBase))]
[System.Xml.Serialization.XmlIncludeAttribute(typeof(StudentBase))]
public partial class StudentService : System.Web.Services.Protocols.SoapHttpClientProtocol {
private CredentialSoapHeader credentialSoapHeaderValueField;
private System.Threading.SendOrPostCallback GetStudentDetailsOperationCompleted;
private System.Threading.SendOrPostCallback GetAllStudentsOperationCompleted;
private System.Threading.SendOrPostCallback SyncStudentOperationCompleted;
private bool useDefaultCredentialsSetExplicitly;
/// <remarks/>
public StudentService() {
this.Url = SmartInstitute.Automation.Properties.Settings.Default.SmartInstitute_Automation_SmartInstituteServices_StudentService_StudentService;
if ((this.IsLocalFileSystemWebService(this.Url) == true)) {
this.UseDefaultCredentials = true;
this.useDefaultCredentialsSetExplicitly = false;
}
else {
this.useDefaultCredentialsSetExplicitly = true;
}
}
public CredentialSoapHeader CredentialSoapHeaderValue {
get {
return this.credentialSoapHeaderValueField;
}
set {
this.credentialSoapHeaderValueField = value;
}
}
public new string Url {
get {
return base.Url;
}
set {
if ((((this.IsLocalFileSystemWebService(base.Url) == true)
&& (this.useDefaultCredentialsSetExplicitly == false))
&& (this.IsLocalFileSystemWebService(value) == false))) {
base.UseDefaultCredentials = false;
}
base.Url = value;
}
}
public new bool UseDefaultCredentials {
get {
return base.UseDefaultCredentials;
}
set {
base.UseDefaultCredentials = value;
this.useDefaultCredentialsSetExplicitly = true;
}
}
/// <remarks/>
public event GetStudentDetailsCompletedEventHandler GetStudentDetailsCompleted;
/// <remarks/>
public event GetAllStudentsCompletedEventHandler GetAllStudentsCompleted;
/// <remarks/>
public event SyncStudentCompletedEventHandler SyncStudentCompleted;
/// <remarks/>
[System.Web.Services.Protocols.SoapHeaderAttribute("CredentialSoapHeaderValue")]
[System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://oazabir.com/webservices/smartinstitute/GetStudentDetails", RequestNamespace="http://oazabir.com/webservices/smartinstitute", ResponseNamespace="http://oazabir.com/webservices/smartinstitute", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)]
public Student GetStudentDetails(int userID) {
object[] results = this.Invoke("GetStudentDetails", new object[] {
userID});
return ((Student)(results[0]));
}
/// <remarks/>
public void GetStudentDetailsAsync(int userID) {
this.GetStudentDetailsAsync(userID, null);
}
/// <remarks/>
public void GetStudentDetailsAsync(int userID, object userState) {
if ((this.GetStudentDetailsOperationCompleted == null)) {
this.GetStudentDetailsOperationCompleted = new System.Threading.SendOrPostCallback(this.OnGetStudentDetailsOperationCompleted);
}
this.InvokeAsync("GetStudentDetails", new object[] {
userID}, this.GetStudentDetailsOperationCompleted, userState);
}
private void OnGetStudentDetailsOperationCompleted(object arg) {
if ((this.GetStudentDetailsCompleted != null)) {
System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg));
this.GetStudentDetailsCompleted(this, new GetStudentDetailsCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState));
}
}
/// <remarks/>
[System.Web.Services.Protocols.SoapHeaderAttribute("CredentialSoapHeaderValue")]
[System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://oazabir.com/webservices/smartinstitute/GetAllStudents", RequestNamespace="http://oazabir.com/webservices/smartinstitute", ResponseNamespace="http://oazabir.com/webservices/smartinstitute", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)]
public Student[] GetAllStudents() {
object[] results = this.Invoke("GetAllStudents", new object[0]);
return ((Student[])(results[0]));
}
/// <remarks/>
public void GetAllStudentsAsync() {
this.GetAllStudentsAsync(null);
}
/// <remarks/>
public void GetAllStudentsAsync(object userState) {
if ((this.GetAllStudentsOperationCompleted == null)) {
this.GetAllStudentsOperationCompleted = new System.Threading.SendOrPostCallback(this.OnGetAllStudentsOperationCompleted);
}
this.InvokeAsync("GetAllStudents", new object[0], this.GetAllStudentsOperationCompleted, userState);
}
private void OnGetAllStudentsOperationCompleted(object arg) {
if ((this.GetAllStudentsCompleted != null)) {
System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg));
this.GetAllStudentsCompleted(this, new GetAllStudentsCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState));
}
}
/// <remarks/>
[System.Web.Services.Protocols.SoapHeaderAttribute("CredentialSoapHeaderValue")]
[System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://oazabir.com/webservices/smartinstitute/SyncStudent", RequestNamespace="http://oazabir.com/webservices/smartinstitute", ResponseNamespace="http://oazabir.com/webservices/smartinstitute", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)]
public bool SyncStudent(Student student) {
object[] results = this.Invoke("SyncStudent", new object[] {
student});
return ((bool)(results[0]));
}
/// <remarks/>
public void SyncStudentAsync(Student student) {
this.SyncStudentAsync(student, null);
}
/// <remarks/>
public void SyncStudentAsync(Student student, object userState) {
if ((this.SyncStudentOperationCompleted == null)) {
this.SyncStudentOperationCompleted = new System.Threading.SendOrPostCallback(this.OnSyncStudentOperationCompleted);
}
this.InvokeAsync("SyncStudent", new object[] {
student}, this.SyncStudentOperationCompleted, userState);
}
private void OnSyncStudentOperationCompleted(object arg) {
if ((this.SyncStudentCompleted != null)) {
System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg));
this.SyncStudentCompleted(this, new SyncStudentCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState));
}
}
/// <remarks/>
public new void CancelAsync(object userState) {
base.CancelAsync(userState);
}
private bool IsLocalFileSystemWebService(string url) {
if (((url == null)
|| (url == string.Empty))) {
return false;
}
System.Uri wsUri = new System.Uri(url);
if ((((wsUri.Port >= 1024)
&& (wsUri.Port <= 5000))
&& (string.Compare(wsUri.Host, "localHost", true) == 0))) {
return true;
}
return false;
}
}
/// <remarks/>
[System.SerializableAttribute()]
[System.Xml.Serialization.XmlTypeAttribute(Namespace="http://oazabir.com/webservices/smartinstitute")]
[System.Xml.Serialization.XmlRootAttribute(Namespace="http://oazabir.com/webservices/smartinstitute", IsNullable=false)]
public partial class CredentialSoapHeader : System.Web.Services.Protocols.SoapHeader {
private string usernameField;
private string passwordHashField;
private string versionNoField;
private string securityKeyField;
/// <remarks/>
public string Username {
get {
return this.usernameField;
}
set {
this.usernameField = value;
}
}
/// <remarks/>
public string PasswordHash {
get {
return this.passwordHashField;
}
set {
this.passwordHashField = value;
}
}
/// <remarks/>
public string VersionNo {
get {
return this.versionNoField;
}
set {
this.versionNoField = value;
}
}
/// <remarks/>
public string SecurityKey {
get {
return this.securityKeyField;
}
set {
this.securityKeyField = value;
}
}
}
/// <remarks/>
public delegate void GetStudentDetailsCompletedEventHandler(object sender, GetStudentDetailsCompletedEventArgs e);
/// <remarks/>
public partial class GetStudentDetailsCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs {
private object[] results;
internal GetStudentDetailsCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) :
base(exception, cancelled, userState) {
this.results = results;
}
/// <remarks/>
public Student Result {
get {
this.RaiseExceptionIfNecessary();
return ((Student)(this.results[0]));
}
}
}
/// <remarks/>
public delegate void GetAllStudentsCompletedEventHandler(object sender, GetAllStudentsCompletedEventArgs e);
/// <remarks/>
public partial class GetAllStudentsCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs {
private object[] results;
internal GetAllStudentsCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) :
base(exception, cancelled, userState) {
this.results = results;
}
/// <remarks/>
public Student[] Result {
get {
this.RaiseExceptionIfNecessary();
return ((Student[])(this.results[0]));
}
}
}
/// <remarks/>
public delegate void SyncStudentCompletedEventHandler(object sender, SyncStudentCompletedEventArgs e);
/// <remarks/>
public partial class SyncStudentCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs {
private object[] results;
internal SyncStudentCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) :
base(exception, cancelled, userState) {
this.results = results;
}
/// <remarks/>
public bool Result {
get {
this.RaiseExceptionIfNecessary();
return ((bool)(this.results[0]));
}
}
}
}