0

wsdl.exe によって生成されたサンプルの SOAP コードを使用しています。オブジェクトlastErrorは次のように宣言されます。

private Exception lastError;

この行のビルドで Visual Studio がエラーを出している

String msg = lastError.Message;

言って

'Exception' does not contain a definition for 'Message' and no extension method 'Message' accepting a first argument of type 'Exception' could be found (are you missing a using directive or an assembly reference?):

wsdl.exeExceptionによって生成されるクラスは次のようになります。

/// <remarks/>
[System.Xml.Serialization.XmlIncludeAttribute(typeof(NestedException))]
[System.Xml.Serialization.XmlIncludeAttribute(typeof(PersistenceException))]
[System.Xml.Serialization.XmlIncludeAttribute(typeof(BbSecurityException))]
[System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")]
[System.SerializableAttribute()]
[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.ComponentModel.DesignerCategoryAttribute("code")]
[System.Xml.Serialization.XmlTypeAttribute(Namespace="http://gradebook.ws.blackboard")]
public partial class Exception {

    private object exception1Field;

    /// <remarks/>
    [System.Xml.Serialization.XmlElementAttribute("Exception", IsNullable=true)]
    public object Exception1 {
        get {
            return this.exception1Field;
        }
        set {
            this.exception1Field = value;
        }
    }
}
4

1 に答える 1