在windows8手机中连接到WCF服务 [英] Connecting to WCF service in windows8 phone

查看:80
本文介绍了在windows8手机中连接到WCF服务的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述





如何连接到另一个项目中的wcf服务。我想连接到那个服务方法



这是服务中的方法



公共类UserLoginService:IUserLoginService

{

public bool ValidateUser(CreateUserProfileArg createUserProfileArg)

{

bool Result = false;

// hxUserDTO userLoginArgs = null;

UserLoginArgs userLoginArgs = null;

if(createUserProfileArg!= null)

{

// userLoginArgs = new hxUserDTO() ;

userLoginArgs = new UserLoginArgs();

userLoginArgs.UserId = createUserProfileArg.UserID;

userLoginArgs.Password = createUserProfileArg.Password;

userLoginArgs.UserType = createUserProfileArg.UserTyp e;

userLoginArgs.GroupId = createUserProfileArg.GroupID;

}



结果= UserLoginController.ValidateUserCredentials(userLoginArgs );

返回结果;

}





其中CreateUserProfileArg是一个带有一些参数的类



我需要在我的Windows手机登录页面中调用该方法,并且应该返回一个布尔值





我该怎么办?

解决方案

在IIS中部署服务并添加对该服务的引用,然后创建客户对象和调用所需方法。

参考此链接

使用-wcf-service-in-windows-phone-application /

Hi,

How to connect to a wcf service which is in another project.I want to connect to that that service method

This is the method in service

public class UserLoginService : IUserLoginService
{
public bool ValidateUser(CreateUserProfileArg createUserProfileArg)
{
bool Result = false;
// hxUserDTO userLoginArgs = null;
UserLoginArgs userLoginArgs = null;
if (createUserProfileArg != null)
{
// userLoginArgs = new hxUserDTO();
userLoginArgs = new UserLoginArgs();
userLoginArgs.UserId = createUserProfileArg.UserID;
userLoginArgs.Password = createUserProfileArg.Password;
userLoginArgs.UserType = createUserProfileArg.UserType;
userLoginArgs.GroupId = createUserProfileArg.GroupID;
}

Result = UserLoginController.ValidateUserCredentials(userLoginArgs);
return Result;
}


where CreateUserProfileArg is a class with some parameters

I need to call that method in my windows phone login page and that should return a Boolean value


How can I do it?

解决方案

Deploy the service in IIS and add reference to that service and then create a client object and call required methods.
Refer this link
consuming-wcf-service-in-windows-phone-application/


这篇关于在windows8手机中连接到WCF服务的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆