C# 无法调用web服务

C# 无法调用web服务,c#,.net,web-services,C#,.net,Web Services,我已收到物理的WSDL文件,将在我的C#Windows服务项目中使用 我替换了项目文件夹中的文件,并从“添加服务引用”中添加 它被添加到项目中&我设法创建客户机对象并调用其类 但当我运行服务时,出现了以下错误 Could not find default endpoint element that references contract 'ABRECONService.ServiceIF' in the ServiceModel client configuration section.

我已收到物理的
WSDL
文件,将在我的
C#
Windows服务项目中使用

我替换了项目文件夹中的文件,并从“添加服务引用”中添加

它被添加到项目中&我设法创建客户机对象并调用其类 但当我运行服务时,出现了以下错误

    Could not find default endpoint element that references contract 'ABRECONService.ServiceIF' in the ServiceModel client configuration section. This might be because no configuration file was found for your application, or because no endpoint element matching this contract could be found in the client element.
   at System.ServiceModel.Description.ConfigLoader.LoadChannelBehaviors(ServiceEndpoint serviceEndpoint, String configurationName)
   at System.ServiceModel.ChannelFactory.ApplyConfiguration(String configurationName, Configuration configuration)
   at System.ServiceModel.ChannelFactory.ApplyConfiguration(String configurationName)
   at System.ServiceModel.ChannelFactory.InitializeEndpoint(String configurationName, EndpointAddress address)
   at System.ServiceModel.ChannelFactory`1..ctor(String endpointConfigurationName, EndpointAddress remoteAddress)
   at System.ServiceModel.EndpointTrait`1.CreateSimplexFactory()
   at System.ServiceModel.ClientBase`1.CreateChannelFactoryRef(EndpointTrait`1 endpointTrait)
   at System.ServiceModel.ClientBase`1.InitializeChannelFactoryRef()
   at System.ServiceModel.ClientBase`1..ctor()
   at sample.eZeePayService.DateExchangeServiceIFClient..ctor() in C:\Users\Hani\Documents\Visual Studio 2010\Projects\sample\sample\Service References\ABRECONService\Reference.cs:line 32
   at sample.ABRECONHandler.ABRECONCaller(String message) in C:\Users\Hani\Documents\Visual Studio 2010\Projects\sample\sample\ABRECONHandler.cs:line 15
而app.config是


请注意,web服务提供商位于不同的LAN上 我错过什么了吗?
请建议urgenlt

仅从WSDL文件创建服务类是不够的。您需要向客户端的配置文件(
app.config
)中添加指示如何访问服务的信息


您可以尝试直接将服务引用对话框指向
http://localhost:8732/Design_Time_Addresses/ABRECON/Main/
(MEX配置文件的地址)。确保服务正在运行


如果一切正常,将自动将相应的配置条目添加到您的
app.config

仅从WSDL文件创建服务类是不够的。您需要向客户端的配置文件(
app.config
)中添加指示如何访问服务的信息


您可以尝试直接将服务引用对话框指向
http://localhost:8732/Design_Time_Addresses/ABRECON/Main/
(MEX配置文件的地址)。确保服务正在运行


如果一切正常,将自动将相应的配置条目添加到您的
app.config

是的,正如您所说,基址指向其他LAN中的地址,这就是您无法连接到它的原因

是的,正如您所说,基址正指向其他LAN中的地址,这就是您无法连接到它的原因