Professional Web Applications Themes

BUG - web service proxy generation - ASP.NET General

Using Visual Studio.Net... I have two classes, one derives from the other. My web service accepts the base class as input, it returns the derived class as the return value. When I set a web reference to that web service, the web service proxy is incorrect! It creates its own version of the base class fine, but when it creates its own version of the derived class, it shows it as simply deriving from the base, but its own members are not there. Here are my classes, then I'll show the web proxy portion... using System; ///TODO: write comments. namespace ...

  1. #1

    Default BUG - web service proxy generation

    Using Visual Studio.Net...
    I have two classes, one derives from the other.
    My web service accepts the base class as input, it returns the derived class
    as the return value.
    When I set a web reference to that web service, the web service proxy is
    incorrect! It creates its own version of the base class fine, but when it
    creates its own version of the derived class, it shows it as simply deriving
    from the base, but its own members are not there.
    Here are my classes, then I'll show the web proxy portion...
    using System;

    ///TODO: write comments.
    namespace FunHouse.Business
    {
    /// <summary>
    /// This class serves as input parameters for the Fun.
    /// </summary>
    public class FunParameters
    {
    private string _transId = "";
    private string _refereeYYYYMMDD = "";
    private float _arm = 0f;
    private float _srmp = 0f;
    private string _rahYYYYMMDD = "";

    public string TransId
    {
    get{return _transId;}
    set{_transId = value;}
    }

    public string RefereeYYYYMMDD
    {
    get{return _refereeYYYYMMDD;}
    set{_refereeYYYYMMDD = value;}
    }

    public System.Single ARM
    {
    get{return _arm;}
    set{_arm = value;}
    }

    public System.Single SRMP
    {
    get{return _srmp;}
    set{_srmp = value;}
    }

    public string RahYYYYMMDD
    {
    get{return _rahYYYYMMDD;}
    set{_rahYYYYMMDD = value;}
    }

    }//end class


    /// <summary>
    /// Serves as Fun output parameters. Extends FunParameters.
    /// </summary>
    public class FunParametersOut : FunParameters
    {
    private string _testingYYYYMMDD = "";

    private Int32 _calculationReturnCode = 0;

    private string _calculationReturnMessage = "";

    public FunParametersOut()
    {
    _testingYYYYMMDD = "";
    _calculationReturnCode = 0;
    _calculationReturnMessage = "";

    }

    public string testingYYYYMMDD
    {
    get
    {
    return _testingYYYYMMDD;
    }
    }


    public Int32 CalculationReturnCode
    {
    get{return _calculationReturnCode;}
    }

    public string CalculationReturnMessage
    {
    get{return _calculationReturnMessage;}
    }

    protected internal void SettestingYYYYMMDD(string realignmentDate)
    {
    _testingYYYYMMDD = realignmentDate;
    }

    protected internal void SetCalculationReturnCode(Int32 returnCode)
    {
    _calculationReturnCode = returnCode;
    }

    protected internal void SetCalculationReturnMessage(string returnMessage)
    {
    _calculationReturnMessage = returnMessage;
    }
    }


    }//end namespace

    Here is the proxy generated by Visual Studio.Net...
    //--------------------------------------------------------------------------
    ----
    // <autogenerated>
    // This code was generated by a tool.
    // Runtime Version: 1.0.3705.288
    //
    // Changes to this file may cause incorrect behavior and will be lost if
    // the code is regenerated.
    // </autogenerated>
    //--------------------------------------------------------------------------
    ----

    //
    // This source code was auto-generated by Microsoft.VSDesigner, Version
    1.0.3705.288.
    //
    namespace Fun33.localhost {
    using System.Diagnostics;
    using System.Xml.Serialization;
    using System;
    using System.Web.Services.Protocols;
    using System.ComponentModel;
    using System.Web.Services;


    /// <remarks/>
    [System.Diagnostics.DebuggerStepThroughAttribute()]
    [System.ComponentModel.DesignerCategoryAttribute("c ode")]
    [System.Web.Services.WebServiceBindingAttribute(Nam e="Service1Soap",
    Namespace="http://tempuri.org/")]
    public class Service1 :
    System.Web.Services.Protocols.SoapHttpClientProtoc ol {

    /// <remarks/>
    public Service1() {
    this.Url = "http://localhost/websvc1/service1.asmx";
    }

    /// <remarks/>

    [System.Web.Services.Protocols.SoapDoentMethodAt tribute("http://tempuri.o
    rg/HaveFun", RequestNamespace="http://tempuri.org/",
    ResponseNamespace="http://tempuri.org/",
    Use=System.Web.Services.Description.SoapBindingUse .Literal,
    ParameterStyle=System.Web.Services.Protocols.SoapP arameterStyle.Wrapped)]
    public FunParametersOut HaveFun(FunParameters input) {
    object[] results = this.Invoke("HaveFun", new object[] {
    input});
    return ((FunParametersOut)(results[0]));
    }

    /// <remarks/>
    public System.IAsyncResult BeginHaveFun(FunParameters input,
    System.AsyncCallback callback, object asyncState) {
    return this.BeginInvoke("HaveFun", new object[] {
    input}, callback, asyncState);
    }

    /// <remarks/>
    public FunParametersOut EndHaveFun(System.IAsyncResult asyncResult)
    {
    object[] results = this.EndInvoke(asyncResult);
    return ((FunParametersOut)(results[0]));
    }
    }

    /// <remarks/>

    [System.Xml.Serialization.XmlTypeAttribute(Namespac e="http://tempuri.org/")]
    [System.Xml.Serialization.XmlIncludeAttribute(typeo f(FunParametersOut))]
    public class FunParameters {

    /// <remarks/>
    public string TransId;

    /// <remarks/>
    public string RefereeYYYYMMDD;

    /// <remarks/>
    public System.Single ARM;

    /// <remarks/>
    public System.Single SRMP;

    /// <remarks/>
    public string RahYYYYMMDD;
    }

    /// <remarks/>
    HERE IS THE ERROR, THE DERIVED CLASS IS INCOMPLETE

    [System.Xml.Serialization.XmlTypeAttribute(Namespac e="http://tempuri.org/")]
    public class FunParametersOut : FunParameters {
    }
    }
    -- Marty


    Marty McDonald Guest

  2. #2

    Default Re: BUG - web service proxy generation

    Actually it is not incomplete. In FunParametersOut your other properties
    are read-only (no set) or protected. As for the other fields off
    FunParametersOut (the ones inherited from FunParameters), they are handled
    through the base class.

    --
    Kevin Cunningham
    Software Architects, Inc.

    "Marty McDonald" <mcdonamawsdot.wa.gov> wrote in message
    news:Oe%23PTSTXDHA.1888TK2MSFTNGP10.phx.gbl...
    > Using Visual Studio.Net...
    > I have two classes, one derives from the other.
    > My web service accepts the base class as input, it returns the derived
    class
    > as the return value.
    > When I set a web reference to that web service, the web service proxy is
    > incorrect! It creates its own version of the base class fine, but when it
    > creates its own version of the derived class, it shows it as simply
    deriving
    > from the base, but its own members are not there.
    > Here are my classes, then I'll show the web proxy portion...
    > using System;
    >
    > ///TODO: write comments.
    > namespace FunHouse.Business
    > {
    > /// <summary>
    > /// This class serves as input parameters for the Fun.
    > /// </summary>
    > public class FunParameters
    > {
    > private string _transId = "";
    > private string _refereeYYYYMMDD = "";
    > private float _arm = 0f;
    > private float _srmp = 0f;
    > private string _rahYYYYMMDD = "";
    >
    > public string TransId
    > {
    > get{return _transId;}
    > set{_transId = value;}
    > }
    >
    > public string RefereeYYYYMMDD
    > {
    > get{return _refereeYYYYMMDD;}
    > set{_refereeYYYYMMDD = value;}
    > }
    >
    > public System.Single ARM
    > {
    > get{return _arm;}
    > set{_arm = value;}
    > }
    >
    > public System.Single SRMP
    > {
    > get{return _srmp;}
    > set{_srmp = value;}
    > }
    >
    > public string RahYYYYMMDD
    > {
    > get{return _rahYYYYMMDD;}
    > set{_rahYYYYMMDD = value;}
    > }
    >
    > }//end class
    >
    >
    > /// <summary>
    > /// Serves as Fun output parameters. Extends FunParameters.
    > /// </summary>
    > public class FunParametersOut : FunParameters
    > {
    > private string _testingYYYYMMDD = "";
    >
    > private Int32 _calculationReturnCode = 0;
    >
    > private string _calculationReturnMessage = "";
    >
    > public FunParametersOut()
    > {
    > _testingYYYYMMDD = "";
    > _calculationReturnCode = 0;
    > _calculationReturnMessage = "";
    >
    > }
    >
    > public string testingYYYYMMDD
    > {
    > get
    > {
    > return _testingYYYYMMDD;
    > }
    > }
    >
    >
    > public Int32 CalculationReturnCode
    > {
    > get{return _calculationReturnCode;}
    > }
    >
    > public string CalculationReturnMessage
    > {
    > get{return _calculationReturnMessage;}
    > }
    >
    > protected internal void SettestingYYYYMMDD(string realignmentDate)
    > {
    > _testingYYYYMMDD = realignmentDate;
    > }
    >
    > protected internal void SetCalculationReturnCode(Int32 returnCode)
    > {
    > _calculationReturnCode = returnCode;
    > }
    >
    > protected internal void SetCalculationReturnMessage(string
    returnMessage)
    > {
    > _calculationReturnMessage = returnMessage;
    > }
    > }
    >
    >
    > }//end namespace
    >
    > Here is the proxy generated by Visual Studio.Net...
    >
    //--------------------------------------------------------------------------
    > ----
    > // <autogenerated>
    > // This code was generated by a tool.
    > // Runtime Version: 1.0.3705.288
    > //
    > // Changes to this file may cause incorrect behavior and will be lost
    if
    > // the code is regenerated.
    > // </autogenerated>
    >
    //--------------------------------------------------------------------------
    > ----
    >
    > //
    > // This source code was auto-generated by Microsoft.VSDesigner, Version
    > 1.0.3705.288.
    > //
    > namespace Fun33.localhost {
    > using System.Diagnostics;
    > using System.Xml.Serialization;
    > using System;
    > using System.Web.Services.Protocols;
    > using System.ComponentModel;
    > using System.Web.Services;
    >
    >
    > /// <remarks/>
    > [System.Diagnostics.DebuggerStepThroughAttribute()]
    > [System.ComponentModel.DesignerCategoryAttribute("c ode")]
    > [System.Web.Services.WebServiceBindingAttribute(Nam e="Service1Soap",
    > Namespace="http://tempuri.org/")]
    > public class Service1 :
    > System.Web.Services.Protocols.SoapHttpClientProtoc ol {
    >
    > /// <remarks/>
    > public Service1() {
    > this.Url = "http://localhost/websvc1/service1.asmx";
    > }
    >
    > /// <remarks/>
    >
    >
    [System.Web.Services.Protocols.SoapDoentMethodAt tribute("http://tempuri.o
    > rg/HaveFun", RequestNamespace="http://tempuri.org/",
    > ResponseNamespace="http://tempuri.org/",
    > Use=System.Web.Services.Description.SoapBindingUse .Literal,
    > ParameterStyle=System.Web.Services.Protocols.SoapP arameterStyle.Wrapped)]
    > public FunParametersOut HaveFun(FunParameters input) {
    > object[] results = this.Invoke("HaveFun", new object[] {
    > input});
    > return ((FunParametersOut)(results[0]));
    > }
    >
    > /// <remarks/>
    > public System.IAsyncResult BeginHaveFun(FunParameters input,
    > System.AsyncCallback callback, object asyncState) {
    > return this.BeginInvoke("HaveFun", new object[] {
    > input}, callback, asyncState);
    > }
    >
    > /// <remarks/>
    > public FunParametersOut EndHaveFun(System.IAsyncResult
    asyncResult)
    > {
    > object[] results = this.EndInvoke(asyncResult);
    > return ((FunParametersOut)(results[0]));
    > }
    > }
    >
    > /// <remarks/>
    >
    >
    [System.Xml.Serialization.XmlTypeAttribute(Namespac e="http://tempuri.org/")]
    >
    [System.Xml.Serialization.XmlIncludeAttribute(typeo f(FunParametersOut))]
    > public class FunParameters {
    >
    > /// <remarks/>
    > public string TransId;
    >
    > /// <remarks/>
    > public string RefereeYYYYMMDD;
    >
    > /// <remarks/>
    > public System.Single ARM;
    >
    > /// <remarks/>
    > public System.Single SRMP;
    >
    > /// <remarks/>
    > public string RahYYYYMMDD;
    > }
    >
    > /// <remarks/>
    > HERE IS THE ERROR, THE DERIVED CLASS IS INCOMPLETE
    >
    >
    [System.Xml.Serialization.XmlTypeAttribute(Namespac e="http://tempuri.org/")]
    > public class FunParametersOut : FunParameters {
    > }
    > }
    > -- Marty
    >
    >

    Kevin Cunningham Guest

  3. #3

    Default Re: BUG - web service proxy generation

    But FunParametersOut does have three properties (testingYYYYMMDD,
    CalculationReturnCode, CalculationReturnMessage) that should be available,
    but they are not. Isn't that still an error? It would seem that a consumer
    of the web service should have access to those properties.


    Marty McDonald Guest

  4. #4

    Default RE: BUG - web service proxy generation

    Hello Marty,

    I will look into it and reply you with my finding here. Thanks.

    Best regards,
    Yanhong Huang
    Microsoft Online Partner Support

    Get Secure! - [url]www.microsoft.com/security[/url]
    This posting is provided "AS IS" with no warranties, and confers no rights.

    --------------------
    !From: "Marty McDonald" <mcdonamawsdot.wa.gov>
    !Subject: BUG - web service proxy generation
    !Date: Thu, 7 Aug 2003 15:38:06 -0700
    !Lines: 214
    !X-Priority: 3
    !X-MSMail-Priority: Normal
    !X-Newsreader: Microsoft Outlook Express 6.00.2600.0000
    !X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000
    !Message-ID: <Oe#PTSTXDHA.1888TK2MSFTNGP10.phx.gbl>
    !Newsgroups: microsoft.public.dotnet.framework.aspnet
    !NNTP-Posting-Host: 164.110.202.164
    !Path: cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTN GP10.phx.gbl
    !Xref: cpmsftngxa06.phx.gbl microsoft.public.dotnet.framework.aspnet:165959
    !X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet
    !
    !Using Visual Studio.Net...
    !I have two classes, one derives from the other.
    !My web service accepts the base class as input, it returns the derived
    class
    !as the return value.
    !When I set a web reference to that web service, the web service proxy is
    !incorrect! It creates its own version of the base class fine, but when it
    !creates its own version of the derived class, it shows it as simply
    deriving
    !from the base, but its own members are not there.
    !Here are my classes, then I'll show the web proxy portion...
    !using System;
    !
    !///TODO: write comments.
    !namespace FunHouse.Business
    !{
    ! /// <summary>
    ! /// This class serves as input parameters for the Fun.
    ! /// </summary>
    ! public class FunParameters
    ! {
    ! private string _transId = "";
    ! private string _refereeYYYYMMDD = "";
    ! private float _arm = 0f;
    ! private float _srmp = 0f;
    ! private string _rahYYYYMMDD = "";
    !
    ! public string TransId
    ! {
    ! get{return _transId;}
    ! set{_transId = value;}
    ! }
    !
    ! public string RefereeYYYYMMDD
    ! {
    ! get{return _refereeYYYYMMDD;}
    ! set{_refereeYYYYMMDD = value;}
    ! }
    !
    ! public System.Single ARM
    ! {
    ! get{return _arm;}
    ! set{_arm = value;}
    ! }
    !
    ! public System.Single SRMP
    ! {
    ! get{return _srmp;}
    ! set{_srmp = value;}
    ! }
    !
    ! public string RahYYYYMMDD
    ! {
    ! get{return _rahYYYYMMDD;}
    ! set{_rahYYYYMMDD = value;}
    ! }
    !
    ! }//end class
    !
    !
    ! /// <summary>
    ! /// Serves as Fun output parameters. Extends FunParameters.
    ! /// </summary>
    ! public class FunParametersOut : FunParameters
    ! {
    ! private string _testingYYYYMMDD = "";
    !
    ! private Int32 _calculationReturnCode = 0;
    !
    ! private string _calculationReturnMessage = "";
    !
    ! public FunParametersOut()
    ! {
    ! _testingYYYYMMDD = "";
    ! _calculationReturnCode = 0;
    ! _calculationReturnMessage = "";
    !
    ! }
    !
    ! public string testingYYYYMMDD
    ! {
    ! get
    ! {
    ! return _testingYYYYMMDD;
    ! }
    ! }
    !
    !
    ! public Int32 CalculationReturnCode
    ! {
    ! get{return _calculationReturnCode;}
    ! }
    !
    ! public string CalculationReturnMessage
    ! {
    ! get{return _calculationReturnMessage;}
    ! }
    !
    ! protected internal void SettestingYYYYMMDD(string realignmentDate)
    ! {
    ! _testingYYYYMMDD = realignmentDate;
    ! }
    !
    ! protected internal void SetCalculationReturnCode(Int32 returnCode)
    ! {
    ! _calculationReturnCode = returnCode;
    ! }
    !
    ! protected internal void SetCalculationReturnMessage(string returnMessage)
    ! {
    ! _calculationReturnMessage = returnMessage;
    ! }
    ! }
    !
    !
    !}//end namespace
    !
    !Here is the proxy generated by Visual Studio.Net...
    !//-------------------------------------------------------------------------
    -
    !----
    !// <autogenerated>
    !// This code was generated by a tool.
    !// Runtime Version: 1.0.3705.288
    !//
    !// Changes to this file may cause incorrect behavior and will be lost
    if
    !// the code is regenerated.
    !// </autogenerated>
    !//-------------------------------------------------------------------------
    -
    !----
    !
    !//
    !// This source code was auto-generated by Microsoft.VSDesigner, Version
    !1.0.3705.288.
    !//
    !namespace Fun33.localhost {
    ! using System.Diagnostics;
    ! using System.Xml.Serialization;
    ! using System;
    ! using System.Web.Services.Protocols;
    ! using System.ComponentModel;
    ! using System.Web.Services;
    !
    !
    ! /// <remarks/>
    ! [System.Diagnostics.DebuggerStepThroughAttribute()]
    ! [System.ComponentModel.DesignerCategoryAttribute("c ode")]
    ! [System.Web.Services.WebServiceBindingAttribute(Nam e="Service1Soap",
    !Namespace="http://tempuri.org/")]
    ! public class Service1 :
    !System.Web.Services.Protocols.SoapHttpClientProto col {
    !
    ! /// <remarks/>
    ! public Service1() {
    ! this.Url = "http://localhost/websvc1/service1.asmx";
    ! }
    !
    ! /// <remarks/>
    !
    ![System.Web.Services.Protocols.SoapDoentMethodAt tribute("http://tempuri.
    o
    !rg/HaveFun", RequestNamespace="http://tempuri.org/",
    !ResponseNamespace="http://tempuri.org/",
    !Use=System.Web.Services.Description.SoapBindingUs e.Literal,
    !ParameterStyle=System.Web.Services.Protocols.Soap ParameterStyle.Wrapped)]
    ! public FunParametersOut HaveFun(FunParameters input) {
    ! object[] results = this.Invoke("HaveFun", new object[] {
    ! input});
    ! return ((FunParametersOut)(results[0]));
    ! }
    !
    ! /// <remarks/>
    ! public System.IAsyncResult BeginHaveFun(FunParameters input,
    !System.AsyncCallback callback, object asyncState) {
    ! return this.BeginInvoke("HaveFun", new object[] {
    ! input}, callback, asyncState);
    ! }
    !
    ! /// <remarks/>
    ! public FunParametersOut EndHaveFun(System.IAsyncResult asyncResult)
    !{
    ! object[] results = this.EndInvoke(asyncResult);
    ! return ((FunParametersOut)(results[0]));
    ! }
    ! }
    !
    ! /// <remarks/>
    !
    ![System.Xml.Serialization.XmlTypeAttribute(Namespac e="http://tempuri.org/")
    ]
    !
    [System.Xml.Serialization.XmlIncludeAttribute(typeo f(FunParametersOut))]
    ! public class FunParameters {
    !
    ! /// <remarks/>
    ! public string TransId;
    !
    ! /// <remarks/>
    ! public string RefereeYYYYMMDD;
    !
    ! /// <remarks/>
    ! public System.Single ARM;
    !
    ! /// <remarks/>
    ! public System.Single SRMP;
    !
    ! /// <remarks/>
    ! public string RahYYYYMMDD;
    ! }
    !
    ! /// <remarks/>
    !HERE IS THE ERROR, THE DERIVED CLASS IS INCOMPLETE
    !
    ![System.Xml.Serialization.XmlTypeAttribute(Namespac e="http://tempuri.org/")
    ]
    ! public class FunParametersOut : FunParameters {
    ! }
    !}
    !-- Marty
    !
    !
    !

    Yan-Hong Huang[MSFT] Guest

Similar Threads

  1. WSE 1.0 proxy class generation
    By mtnmike in forum ASP.NET Web Services
    Replies: 2
    Last Post: March 2nd, 07:13 PM
  2. web service client i/o class generation
    By Brendan C in forum ASP.NET Web Services
    Replies: 2
    Last Post: February 15th, 11:04 PM
  3. Web Service Proxy Generation
    By Mark in forum ASP.NET Web Services
    Replies: 0
    Last Post: August 6th, 01:37 PM
  4. Strange behaviour in WS-Proxy generation
    By Colin Basterfield in forum ASP.NET Web Services
    Replies: 1
    Last Post: December 18th, 09:13 PM
  5. Web service Behind Proxy
    By Mohamed Hobby in forum ASP.NET Web Services
    Replies: 0
    Last Post: October 25th, 01:44 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139