473,396 Members | 1,764 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

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.SoapDocumentMethodAt 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
Nov 17 '05 #1
3 1933
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" <mc******@wsdot.wa.gov> wrote in message
news:Oe****************@TK2MSFTNGP10.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.SoapDocumentMethodAt 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

Nov 17 '05 #2
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.
Nov 17 '05 #3
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! - www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.

--------------------
!From: "Marty McDonald" <mc******@wsdot.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**************@TK2MSFTNGP10.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.SoapDocumentMethodAt 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
!
!
!

Nov 17 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Arthur Mnev | last post by:
I'm a little confused about autogenerated proxy stubs for web services. Creating the stubs manually works fine; if I attempt to use "Web Reference" with automatic class generation the framwork (or...
3
by: Chakra | last post by:
I have a Entity class defined in a assembly. I then have a web service in the same solution, which takes an object of this class as a parameter. It expects me to give the fully qualified name of...
1
by: Sarge | last post by:
Hi all, tough question. Apologies for the cross posting but it is an interesting architectural problem and I think deserves a wide audience. What is the best way to extend web service proxy...
3
by: GT | last post by:
I have a .NET client that consumes an Axis web service. A change was made recently to the AXIS web service, and ever since then my .NET proxy class has been throwing an InvalidCastException. The...
3
by: Jens Jensen | last post by:
Does Microsoft now support Document style web service as part of .NET 3.0 (Windows communication foundations)?
0
by: Nik Loutchanski | last post by:
Hi, I'm using dynamic code generation in an ASP.NET 2.0 web service to create proxy classes for other web services with the intention to cache the dynamically compiled proxy types (methodInfo...
2
by: gartnerjmoody | last post by:
I have a web service that has a method that takes a created .NET class like this: method(my.Shared.BO.InfoClass info, bool isItem) The actual web service gets this class from an assembly,...
5
by: cj | last post by:
Back some time ago I was playing with a little app in VB 2005 that used a google web service to get search results. I was rebuilding this app in 2008 today. I added the web service...
0
by: adrya1984 | last post by:
Hi, I have a Java service that has the following method signature: @WebMethod(operationName = "getContactList") public MyListClass getContactList(@WebParam(name = "myList")...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.