【发布时间】:2012-03-02 07:42:13
【问题描述】:
我正在向 Peoplesoft WSDL 添加服务引用。现有应用程序具有在不同版本的 .NET(我认为是 4.0)或 svcutil 中生成的代理。旧的代理是这样开始的:
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.235
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace PeopleSoft.CustomerService {
using System.Runtime.Serialization;
using System;
[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.CodeDom.Compiler.GeneratedCodeAttribute("System.Runtime.Serialization", "4.0.0.0")]
[System.Runtime.Serialization.CollectionDataContractAttribute(Name="CIFaultTypeShape", Namespace="http://xmlns.oracle.com/Enterprise/FSCM/schema/M866879.V1", ItemName="IBResponse")]
[System.SerializableAttribute()]
但是新的代理看起来像这样:
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.239
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace Tasks.Services.ServiceReference1 {
/// <remarks/>
[System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.0.30319.233")]
[System.SerializableAttribute()]
[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.ComponentModel.DesignerCategoryAttribute("code")]
[System.Xml.Serialization.XmlTypeAttribute(Namespace="http://xmlns.oracle.com/Enterprise/FSCM/schema/M866879.V1")]
很明显,相同的 WSDL 会导致不同的代理类。我们有旧代码依赖于代理类中没有生成的 FaultType (CIFaultTypeShape)。
这是导致该 FaultType 被忽略的 WCF 问题吗?
【问题讨论】:
-
第一个代理是使用 svcutil.exe 生成的,而第二个是使用 Visual Studio 中的添加服务引用生成的吗?问题可能在于使用了不同的序列化程序(Xml 与 DataContract)。
-
谢谢,但我们将其追溯到 VS 2010 的错误。
标签: wcf