实现IOrganizationService

时间:2014-01-14 00:21:54

标签: wcf web-services dynamics-crm-2011

我一直在努力在CRM 2011 SDK中实现IOrganizationService接口 - 起初我写了一个简单的Windows服务包装器,这在我尝试连接它时会抛出序列化异常。所以我为IIS写了一个简单的主机。起初它似乎工作,但任何时候服务中出现故障,它会在第一次尝试后尝试连接到服务时引发相同的错误。

The formatter threw an exception while trying to deserialize the message: There was an error whi
trying to deserialize parameter http://schemas.microsoft.com/xrm/2011/Contracts/Services:request. The InnerException
message was 'Error in line 1 position 497. Element 'http://schemas.microsoft.com/xrm/2011/Contracts/Services:request
contains data from a type that maps to the name 'http://schemas.microsoft.com/crm/2011/Contracts:WhoAmIRequest'. The
deserializer has no knowledge of any type that maps to this name. Consider changing the implementation of the
ResolveName method on your DataContractResolver to return a non-null value for name 'WhoAmIRequest' and namespace
'http://schemas.microsoft.com/crm/2011/Contracts'.'. 

我在这里有点亏 - 它工作正常 - 在某处发生故障 - 尝试重新连接并抛出此错误。之后我必须重新编译并再次将DLL部署到IIS站点bin目录。如果需要,我可以提供一些小代码示例,但请记住,我是直接从SDK程序集继承接口。

编辑: 并且我无法更改连接到WCF服务的程序,因为它是第三方工具。使用传统的网络服务时很好。

编辑(实施守则 - 不包括已实施的方法......>):

[AspNetCompatibilityRequirements(RequirementsMode = AspNetCompatibilityRequirementsMode.Allowed)]
    [ServiceBehavior(
        ConcurrencyMode = ConcurrencyMode.Multiple,
         MaxItemsInObjectGraph = int.MaxValue,
        Name = "OrganizationServiceImplementation",
        Namespace = "http://schemas.microsoft.com/xrm/2011/Contracts")]
    public class OrganizationServiceImplementation : IOrganizationService
    {
    }

0 个答案:

没有答案