این کدها برای فراخوانی همون نتیجه بالا هستن (XML پست قبلی از این تابع بدست اومده)
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Services;
using CookComputing.XmlRpc;
using System.Data;
[WebService(Namespace = "192.168.10.76")]
[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
public class Service : System.Web.Services.WebService {
private XmlRpcStruct _arguments;
public Service() {
this._arguments = new XmlRpcStruct();
this._arguments.Add("auth_name", "system");// Web Service User Name
this._arguments.Add("auth_pass", "sys");// Web Service User Pass
this._arguments.Add("auth_type", "ADMIN");// Web Service User Type
}
[WebMethod]
public bool CheckUser(string username, string password) {
try {
Isend_recv proxy = (Isend_recv)XmlRpcProxyGen.Create(typeof(Isend_rec v));
XmlRpcStruct arguments = this._arguments;// Create new arguments connection
arguments.Add("login_auth_type", "NORMAL_USER");
arguments.Add("login_auth_name", username);
arguments.Add("login_auth_pass", password);
return proxy.login(arguments);
}
catch (Exception ex) {
return false;
}
}
[WebMethod]
public UserInfo getUserInfoByUserId(string userid)
{
try
{
Isend_recv proxy = (Isend_recv)XmlRpcProxyGen.Create(typeof(Isend_rec v));
XmlRpcStruct arguments = this._arguments;// Create new arguments connection
arguments.Add("user_id", userid);
UserInfo ret = proxy.getUserInfo(arguments);
return (ret);
}
catch (Exception ex)
{
throw ex;
}
}
}
[XmlRpcUrl("http://192.168.10.76:1235/")]
public interface Isend_recv : IXmlRpcProxy {
[XmlRpcMethod("user.getUserInfo")]
UserInfo getUserInfo(XmlRpcStruct arguments);
[XmlRpcMethod("login.login")]
bool login(XmlRpcStruct arguments);
}
[XmlRpcMissingMapping(MappingAction.Ignore)]
public struct UserInfo
{
public bool online_status;
public string user_repr;
public UserInfoAttrs attrs;
}
[XmlRpcMissingMapping(MappingAction.Ignore)]
public struct UserInfoAttrs
{
public string normal_password;
public string normal_username;
public int user_id;
public string real_first_login;
}