部署WCF服务在IIS 7.5 [英] Deploy WCF service in IIS 7.5
问题描述
我是新手,WCF。我期待措施,在IIS上部署WCF和消费服务。
我也跟着同部署在IIS网站的步骤,还设置了默认的文件Service1.svc
现在,当我想这个消费。WCF服务这是给我下面的错误
元数据包含无法解析的引用:HTTP:// manish- PC:8000 / Service1.svc WSDL。
WSDL文档包含无法解析的链接。
有一个错误下载的http://马尼什-PC:8000 / Service1.svc XSD = xsd0。
基础连接已关闭:接收时发生意外错误。
无法读取传输连接的数据:一个现有的连接被强行关闭远程主机。
的现有连接被强行远程主机$ B $关门了。B元数据包含无法解析的引用:HTTP://本地主机:8000 / Service1.svc。
内容类型的应用/肥皂+ xml的;字符集= UTF-8没有得到服务支持的http://本地主机:8000 / Service1.svc。客户端和服务绑定可能不匹配。
远程服务器返回错误:(415)无法处理消息,因为内容类型应用程序/肥皂+ xml的;字符集= UTF-8'是不是预期的类型文本/ XML;字符集= utf-8'..
如果该服务在当前的解决方案定义,尝试构建解决方案,并再次添加服务引用。
Follwing在web.config中的文件我的服务详情
< system.serviceModel>
<服务和GT;
<服务behaviorConfiguration =DemoWCF.Service1BehaviorNAME =DemoWCF.Service1>
<主机>
< baseAddresses>
<添加baseAddress =HTTP://本地主机:8000 / Service1.svc/>
< / baseAddresses>
< /主机>
<端点地址=HTTP://本地主机:8000 / Service1.svc
结合=basicHttpBinding的
合同=DemoWCF.IService1
bindingConfiguration =basicBinding >
<同一性GT;
< DNS值=本地主机/>
< /身份>
< /端点>
<端点地址=MEX
结合=mexHttpBinding
合同=IMetadataExchange接口/>
< /服务>
< /服务>
<&绑定GT;
<&basicHttpBinding的GT;
<绑定名称=basicBindingtextEncoding =UTF-8>< /&结合GT;
< / basicHttpBinding的>
< /绑定>
<&行为GT;
< serviceBehaviors>
<行为NAME =DemoWCF.Service1Behavior>
< serviceMetadata httpGetEnabled =真/>
< serviceDebug includeExceptionDetailInFaults =FALSE/>
< /行为>
< / serviceBehaviors>
< /行为>
< /system.serviceModel>
请指引我,我欠缺的,并做什么步骤。
感谢。
在谷歌和观看视频搜索之后。最后,我得到了解决。
此错误的发生是由于IIS配置,我没有理会。 p>
- 打开你的IIS管理器控制台。
- 请一个独立的应用程序了游泳池。结果
A)。设置.NET Framework版本为4.0结果
B)。托管管道模式:经典 - 设置应用程序了池标识为本地系统
- 按照相同的步骤,以像创建在IIS上部署Web应用程序。一个虚拟目录。
- Creatig虚拟目录设置应用程序池已创建的。
和消费WCF服务的客户端应用程序。
请更新此问题/答案线程,如果你发现更多有关这个结果
谢谢。)
I am newbie to WCF. I am looking to steps to deploy WCF on IIS and consume the service. I have follow the steps same as to deploy the Website on IIS, also set the default document to Service1.svc
Now when I am trying to consume this wcf service it is giving me the following error.
Metadata contains a reference that cannot be resolved: 'http://manish-pc:8000/Service1.svc?wsdl'.
The WSDL document contains links that could not be resolved.
There was an error downloading 'http://manish-pc:8000/Service1.svc?xsd=xsd0'.
The underlying connection was closed: An unexpected error occurred on a receive.
Unable to read data from the transport connection: An existing connection was forcibly closed by the remote host.
An existing connection was forcibly closed by the remote host
Metadata contains a reference that cannot be resolved: 'http://localhost:8000/Service1.svc'.
Content Type application/soap+xml; charset=utf-8 was not supported by service http://localhost:8000/Service1.svc. The client and service bindings may be mismatched.
The remote server returned an error: (415) Cannot process the message because the content type 'application/soap+xml; charset=utf-8' was not the expected type 'text/xml; charset=utf-8'..
If the service is defined in the current solution, try building the solution and adding the service reference again.
Follwing is my Service Details in Web.Config file
<system.serviceModel>
<services>
<service behaviorConfiguration="DemoWCF.Service1Behavior" name="DemoWCF.Service1">
<host>
<baseAddresses>
<add baseAddress="http://localhost:8000/Service1.svc"/>
</baseAddresses>
</host>
<endpoint address="http://localhost:8000/Service1.svc"
binding="basicHttpBinding"
contract="DemoWCF.IService1"
bindingConfiguration="basicBinding">
<identity>
<dns value="localhost"/>
</identity>
</endpoint>
<endpoint address="mex"
binding="mexHttpBinding"
contract="IMetadataExchange" />
</service>
</services>
<bindings>
<basicHttpBinding>
<binding name="basicBinding" textEncoding="utf-8"></binding>
</basicHttpBinding>
</bindings>
<behaviors>
<serviceBehaviors>
<behavior name="DemoWCF.Service1Behavior">
<serviceMetadata httpGetEnabled="True" />
<serviceDebug includeExceptionDetailInFaults="false" />
</behavior>
</serviceBehaviors>
</behaviors>
</system.serviceModel>
Please guide me where I'm lacking and what steps to make. Thanks.
After search on google and watching videos. Finally I got the solution.
This error occur due to IIS configuration that I was not bother about.
- open your IIS Manager console.
- Make a separate applicaiton pool.
a). Set .NET Framework version to 4.0
b). Managed pipeline mode : Classic - Set Applicaiton Pool Identity to "LocalSystem".
- Follow the steps same as to deploy a web application on IIS like creating a Virtual Directory.
- Creatig the Virtual Directory set that Application Pool you have created.
And consume the WCF Service in Client application.
Kindly Update this question / answer thread, if you find more about this.
Thanks :)
这篇关于部署WCF服务在IIS 7.5的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!