/**************************************************************
	DO NOT MODIFY THIS FILE
	File is create automatically by
	Hivext WSDL2JS XSL Transformation Utility
**************************************************************/

HNamespace.Define("Users", {

	AccountService : HClass.Define("Users.AccountService", { extend : HWebService.Provider, props : {

		construct : function() {},

		ConstructClient : function() {
			var oClient = new this.AccountPortType;
			oClient.oServiceBind = new this.AccountBinding;
			return oClient;
		},

		AccountPort : HClass.Define("AccountPort", { extend : HRest.Client, props : {
			sNamespace : "http://api.hivext.ru/1.0/users/account/cross/",
			sLocation : "http://api.hivext.ru/1.0/users/account/cross/",
			construct : function() {}
		}}),

		AccountBinding : HClass.Define("AccountBinding", { extend : AccountPort, props : {
			aOperationLocation : {
				ChangeEmail : "changeemail",
				ChangePassword : "changepassword",
				ChangeName : "changename",
				GetUserInfo : "getuserinfo",
				RecoverPassword : "recoverpassword"
			},

			construct : function() {}

		}}),

		AccountPortType : HClass.Define("AccountPortType", { props : {
			oServiceBind : null,

			construct : function() {},

			ChangeEmailInput : {
				appid : "string",
				session : "string",
				password : "string",
				email : "string"
			},

			ChangeEmailOutput : {
				result : "int",
				error : "string"
			},

			ChangePasswordInput : {
				appid : "string",
				session : "string",
				oldPassword : "string",
				newPassword : "string"
			},

			ChangePasswordOutput : {
				result : "int",
				error : "string"
			},

			ChangeNameInput : {
				appid : "string",
				session : "string",
				password : "string",
				name : "string"
			},

			ChangeNameOutput : {
				result : "int",
				error : "string"
			},

			GetUserInfoInput : {
				appid : "string",
				session : "string"
			},

			GetUserInfoOutput : {
				result : "int",
				error : "string",
				uid : "",
				email : "string",
				name : "string"
			},

			RecoverPasswordInput : {
				appid : "string",
				email : "string"
			},

			RecoverPasswordOutput : {
				result : "int",
				error : "string"
			},

			ChangeEmail : function() {
				var oServiceBind = this.oServiceBind;
				if(!oServiceBind) { throw Error("Method name : ChangeEmail : binding not found"); }
				var sUrl = oServiceBind.ConstructUrl("ChangeEmail");
				var fnCallback = HWebService.Client.FindCallback(arguments);

				// Construct request.
				sUrl += "?" + oServiceBind.ConstructRequest(arguments, this.ChangeEmailInput);	

				// Send request.
				var ChangeEmailOutput = this.ChangeEmailOutput;
				(new HNet.ScriptRequest()).Get(sUrl, function(oResponse) {
					if(fnCallback) fnCallback(oResponse);
				});
			},

			ChangePassword : function() {
				var oServiceBind = this.oServiceBind;
				if(!oServiceBind) { throw Error("Method name : ChangePassword : binding not found"); }
				var sUrl = oServiceBind.ConstructUrl("ChangePassword");
				var fnCallback = HWebService.Client.FindCallback(arguments);

				// Construct request.
				sUrl += "?" + oServiceBind.ConstructRequest(arguments, this.ChangePasswordInput);

				// Send request.
				var ChangePasswordOutput = this.ChangePasswordOutput;
				(new HNet.ScriptRequest()).Get(sUrl, function(oResponse) {
					if(fnCallback) fnCallback(oResponse);
				});
			},

			ChangeName : function() {
				var oServiceBind = this.oServiceBind;
				if(!oServiceBind) { throw Error("Method name : ChangeName : binding not found"); }
				var sUrl = oServiceBind.ConstructUrl("ChangeName");
				var fnCallback = HWebService.Client.FindCallback(arguments);

				// Construct request.
				sUrl += "?" + oServiceBind.ConstructRequest(arguments, this.ChangeNameInput);

				// Send request.
				var ChangeNameOutput = this.ChangeNameOutput;
				(new HNet.ScriptRequest()).Get(sUrl, function(oResponse) {
					if(fnCallback) fnCallback(oResponse);
				});
			},

			GetUserInfo : function() {
				var oServiceBind = this.oServiceBind;
				if(!oServiceBind) { throw Error("Method name : GetUserInfo : binding not found"); }
				var sUrl = oServiceBind.ConstructUrl("GetUserInfo");
				var fnCallback = HWebService.Client.FindCallback(arguments);

				// Construct request.
				sUrl += "?" + oServiceBind.ConstructRequest(arguments, this.GetUserInfoInput);

				// Send request.
				var GetUserInfoOutput = this.GetUserInfoOutput;
				(new HNet.ScriptRequest()).Get(sUrl, function(oResponse) {
					if(fnCallback) fnCallback(oResponse);
				});
			},

			RecoverPassword : function() {
				var oServiceBind = this.oServiceBind;
				if(!oServiceBind) { throw Error("Method name : RecoverPassword : binding not found"); }
				var sUrl = oServiceBind.ConstructUrl("RecoverPassword");
				var fnCallback = HWebService.Client.FindCallback(arguments);

				// Construct request.
				sUrl += "?" + oServiceBind.ConstructRequest(arguments, this.RecoverPasswordInput);

				// Send request.
				var RecoverPasswordOutput = this.RecoverPasswordOutput;
				(new HNet.ScriptRequest()).Get(sUrl, function(oResponse) {
					if(fnCallback) fnCallback(oResponse);
				});
			}

		}})

	}})

});

// !!! STATIC LINK !!!
Users.Account = (new Users.AccountService).ConstructClient();
// !!! STATIC LINK !!!
