在WCF层中调用Web服务方法 [英] Calling web service method in WCF layer

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

问题描述


我正在尝试实现WCF层,在其中必须调用Web服务(service1).我必须调用方法consultationClient().从此Web服务开始,该服务应显示与输入的标识符(在我们的示例中为ID_CLIENT)相对应的客户端列表.

当我在Web服务中测试此方法时,协商进行得很好,但是当我在WCF层customer_id 中调用此方法并点击ID_CLIENT时,它将显示一个包含10个客户端及其ID_CLIENT = 0的列表.客户端的所有其他字段根据其类型为0或null.

这是包含在WCF层中的方法调用ConsultationClient()的代码:

Hi,
I am trying to implement a WCF layer, in which I must make a call to a web service (service1). I must make a call to a method consultationClient(). FROM this web service which should show the list of clients that corresponds to the identifier entered (in our case ID_CLIENT).

When I test this method in the Web service, the consultation goes well, but when I''m calling this method in the WCF layer customer_id and I tapped the ID_CLIENT, it shows me a list containing 10 clients with its ID_CLIENT = 0 and all other fields of the client are 0 or null according to their types.

Here is the code containing the method call consultationClient () in the layer WCF:

public List ConsultationClientWCF (int customer_id)
{
Service1 service = new Service1 ();
ClientTopNet ClientTopNet CL = new ClientTopNet ();
List test = ser.ConsultationClient (CL.ID_CLIENT);
return test;
} 


知道我是一个初学者.
请帮助我


Knowing that I am a beginner.
Please help me

推荐答案

aida1986写道:
aida1986 wrote:

WCF层,我必须在其中呼叫网络服务(service1

WCF layer, in which I must make a call to a web service (service1


首先,您的术语需要更正-您不需要从WCF层调用Web服务,而是在 WCF层中调用 Web服务.


其次,我看不到您的错误在哪里.是不是您希望使用其他客户列表?您的查询可能有误.


First your terminology needs to be corrected - you don''t call a web service from the WCF layer, you call a web service in the WCF layer.


Secondly, I dont see where you error is. Is it that you are expecting a different list of clients - your query may be wrong.


对不起,我的英语不熟练

我的意思是,在WCF层中调用Web服务是正确的.

其次,返回的列表不正确,
例如,如果我在这里输入ID_CLIENT = 218,它应该向我显示一个列表,其中包含ID_CLIENT = 218的客户

但是,它向我显示了具有相同ID_CLIENT = 0的10个客户端的列表.
Sorry, i''m not good at english

you are right, I meant, calling a web service in WCF layer.

secondly, the list returned is not true,
for example wehere i enter ID_CLIENT= 218, it supposed to show me a list which contain the clients who has an ID_CLIENT= 218

but ,it show me a list of 10 clients who have the same ID_CLIENT=0.


这篇关于在WCF层中调用Web服务方法的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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