Web服务异常发生 [英] Webservice exception happening

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

问题描述



我正在尝试寻找上个星期的解决方案,请帮助我.我有Communicator DLL,它是使用net.pipe协议托管的WCF服务,而使用者是WCF REST服务,它将调用Communicator DLL.一切正常,都可以在ASP.NET开发服务器中找到,但是当我在IIS上托管我的REST服务时收到错误消息.

错误2012-06-12 09:18:12,640 8230ms DLL.Communicator.CommonCode LogError-模块:DisplayMangerClient发送请求System.ServiceModel.EndpointNotFoundException时发生异常:无法分发消息,因为该服务位于端点地址"net". pipe://localhost/DIGI/Pipe1''对于该地址的协议不可用.

在查看博客后,我已经执行了以下步骤,但是仍然面临问题.

(1)我已经安装并配置了WAS.

2个appcmd.exe设置站点默认网站"-+ bindings.[protocol =''net.pipe'',bindingInformation =''*'']

3]所有列表器服务均已启动并正在运行.

DLL代码段

Hi,

I am trying find solution from last one week please help me. I have Communicator DLL which is hosted WCF service using net.pipe protocol and consumer is WCF REST service which will invoke Communicator DLL. Everything works find in ASP.NET development server but when i am hosting my REST service on IIS getting error message.

ERROR 2012-06-12 09:18:12,640 8230ms DLL.Communicator.CommonCode LogError - Module : DisplayMangerClient Exception occur while sending request System.ServiceModel.EndpointNotFoundException: The message could not be dispatched because the service at the endpoint address ''net.pipe://localhost/DIGI/Pipe1'' is unavailable for the protocol of the address.

I have done following steps after looking at blogs but still facing issue.

(1) I have installed and configured WAS.

2 appcmd.exe set site "Default Web Site" -+bindings.[protocol=''net.pipe'',bindingInformation=''*'']

3] All listner service are up and running.

DLL Code snippet

string _address = "net.pipe://localhost/DIGIUI/Pipe1";

                
   private bool HostThisService()
        {

            try
            {

                _host = new ServiceHost(_serviceDisplay, new Uri(_address));

                // Usage BasicHttpBinding can be used if this is 
                // not going to be on the local machine.
                _host.AddServiceEndpoint(typeof(IServiceDisply),
                                          new NetNamedPipeBinding(),
                                          _address);
                _host.Open();

                _operational = true;
            }
            catch (Exception ex)
            {

                _operational = false;
            }

            return _operational;

        }
 public void ServiceOff()
        {
            if (_host != null)
                if (_host.State != CommunicationState.Closed)
                    _host.Close();
            _operational = false;

        }

//Code of Consuming REST Service

 IServiceDisply proxy = null;
        public  Sender()
        {
            string address =  "net.pipe://localhost/DIGIUI/Pipe1";
            EndpointAddress endPointAddress = new EndpointAddress(address);
            proxy = ChannelFactory<iservicedisply>.CreateChannel(new NetNamedPipeBinding(),endPointAddress);
            //proxy = ChannelFactory<iservicedisply>.CreateChannel(new BasicHttpBinding(), endPointAddress);
        }

      

        public string SendMessage(string stratergyCode)
        {
            return proxy.PlayContent(stratergyCode);
        }


感谢

推荐答案

在服务器端或服务端,必须配置一个端点,地址应为"net.pipe://localhost /DIGIUI/Pipe1"
检查您的app.config以找到此端点.这可能是您的app.config中缺少的一个问题.还要在调用代理之前确保服务主机正在运行.
At your server side, or at the service side, you have to have an end point configured and the address should be "net.pipe://localhost/DIGIUI/Pipe1"
Check your app.config to find this endpoint. This may be missing in your app.config which can be the issue. also make sure the service host is running before you invoke the proxy.


这篇关于Web服务异常发生的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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