我正在向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问题吗?
答案 0 :(得分:2)
我们遇到了同样的情况(VS2008代理和VS2010代理之间的差异),正如这位博主所做的那样:
http://www.fransson.net/blog/cannot-access-faultexception-details/
“在与微软的Andrea Liberatore进行了一些沟通之后,他参与了微软的产品组,他们确认我确实在Visual Studio 2010中发现了一个错误。”
这是有道理的,因为代理缺少故障类型。