2012-09-12 71 views
0

将WCF服务部署到坐在WinServer2008标准SP2上的IIS7服务器。WCF部署奇怪的合同行为

DataContract INT成员被“丢失”

即由客户端发送的所有整数脱颖而出,0到合同处理逻辑

我做了一个反思的合同在服务器上(以进入INT转它串并返回它)。当测试工具指向在IDE中运行的WCF Contract时,ints会反映OK。当它指向已部署的合同时,零被反映出来。

部署: 在服务器上创建IIS应用程序,并将文件部署到物理目录。

已部署的服务显示正常。即真正的客户端应用程序(VS2008 WinMobile 6.5应用程序正在开发独立解决方案)具有WebService引用,可以看到已部署的WCF“正常”。只是客户端生成的变量值在线路上丢失了。只发生在客户端生成的变量。客户端能够使用服务器生成的DataContract变量和预期值。这与基本类型有关。第一个受害者是客户端生成日期,因此我将这些日期转换为字符串。 Web.config如下。 感谢 鲍勃

<?xml version="1.0"?> 
<configuration> 
    <system.web> 
    <compilation debug="true" targetFramework="4.0"/> 
    <pages controlRenderingCompatibilityVersion="3.5" clientIDMode="AutoID"/> 
    </system.web> 
    <system.serviceModel> 
    <behaviors> 
     <serviceBehaviors> 
     <behavior> 
      <!-- To avoid disclosing metadata information, set the value below to false and remove  the metadata endpoint above before deployment --> 
      <serviceMetadata httpGetEnabled="true"/> 
     <!-- To receive exception details in faults for debugging purposes, set the value below to true. Set to false before deployment to avoid disclosing exception information --> 
      <serviceDebug includeExceptionDetailInFaults="true"/> 
     </behavior> 
     </serviceBehaviors> 
    </behaviors> 
    <serviceHostingEnvironment multipleSiteBindingsEnabled="true"/> 
    </system.serviceModel> 
    <system.webServer> 
    <modules runAllManagedModulesForAllRequests="true"/> 
    </system.webServer> 
</configuration> 

回答

0

删除从生产服务器上的Web应用程序并改过。问题部分解决。测试窗口应用程序现在可以看到反射的整数。但是,WinMobile客户端仍然没有。测试使用字符串值的合同,它的作品。这样的生活太短暂了。我将把合同改为字符串字符串。非常适合强类型的数据合同。