2013-05-03 43 views
-1

我的问题是,当我跑我的解决方案,我没有问题问题形成

这里是劳务输出看起来像

enter image description here

当我做在我的链接喜欢这个

enter image description here

而且它是正确的

但是当我部署的解决方案,使用安装程序,我创建

我仍然可以访问,但输出是这样的

enter image description here

安装程序安装它,我尝试导航,它像这样因为它没有输出

enter image description here

如何解决它,它是不正确的?我认为它已经可以,因为当我在Visual Studio中运行它时,它会给我预期的输出,但是当我部署它时不会。

服务App.Config中

<?xml version="1.0"?> 
<configuration> 

    <configSections> 
    <sectionGroup name="applicationSettings" type="System.Configuration.ApplicationSettingsGroup, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" > 
     <section name="WcfServiceLibrary.Properties.Settings" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" /> 
    </sectionGroup> 
    </configSections> 
    <system.web> 
    <compilation debug="true"/> 
    </system.web> 

<startup> 
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/> 
</startup> 
    <system.serviceModel> 
    <behaviors> 
     <endpointBehaviors> 
     <behavior name="NewBehavior0"> 
      <webHttp defaultOutgoingResponseFormat="Json" /> 
     </behavior> 
     </endpointBehaviors> 
    </behaviors> 
    <services> 
     <service name="WcfServiceLibrary.Service"> 
     <endpoint address="" behaviorConfiguration="NewBehavior0" binding="webHttpBinding" 
      bindingConfiguration="" name="Basic" contract="WcfServiceLibrary.IService" /> 
     <host> 
      <baseAddresses> 
      <add baseAddress="http://PHWS13:8080/service" /> 
      </baseAddresses> 
     </host> 
     </service> 
    </services> 
    </system.serviceModel> 
</configuration> 
+0

您可以请分享您的web.config这项服务? Becausse根据您需要在服务行为标记中添加的消息。 – 2013-05-03 06:45:05

+0

@SandeepKumar,更新的先生。 – SHINHAN 2013-05-03 06:48:26

+0

也许你应该尝试以管理员模式执行你的winforms应用程序? (右键单击并以管理员身份运行) – 2013-05-03 06:54:22

回答

1

<behaviors>部分中,您需要添加

 <serviceBehaviors> 
      <behavior name="NewSVCBehavior0"> > 
       <serviceMetadata httpGetEnabled="true" httpsGetEnabled="true" /> 
       <serviceDebug includeExceptionDetailInFaults="true" /> 
      </behavior> 
      </serviceBehaviors> 

而不是

  <service name="WcfServiceLibrary.Service"> 

  <service name="WcfServiceLibrary.Service" behaviorConfiguration="NewSVCBehavior0"> 

并尝试在配置中进行此更改。

+0

仍然是相同的,无法访问时,我部署 – SHINHAN 2013-05-03 07:03:38

+0

现在它可能是IIS中的权限问题。您正在使用哪个版本的IIS?在IIS 5.2中,您可以在主目录选项卡中设置执行权限。并设置执行权限为“脚本和可执行文件” – 2013-05-03 07:10:59

+0

对于iis 7您可以查看[这里] [http://technet.microsoft.com/en-us/library/cc725855(v=ws.10).aspx] – 2013-05-03 07:15:09