473,394 Members | 1,916 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,394 software developers and data experts.

WebService proxy does not generate methods for a class, only properties.

I have a web service, which has a reference to a class. I want to be able to
accept this class as a parameter to my web service method. When the consumer
consumes the web service, proxy class is created. This proxy has my class
but for some reason it does not generate methods, only properties.

Here is my code....

****Class*****
[Serializable]
public class Class1
{
string str;
public Class1()
{
//
// TODO: Add constructor logic here
//
}
public void Test(int a)
{
}
public string IntReturn(int b)
{
return str;
}
public string PropTest
{
set { str = value; }
get { return str; }
}
}

*****WebService*****
[WebMethod]
public void Obj(ClassLibrary1.Class1 cls)
{
cls.Test(5);
}
****webservice proxy******
[System.Xml.Serialization.XmlTypeAttribute(Namespac e="http://tempuri.org/")]
public class Class1 {
/// <remarks/>
public string PropTest;
}

As you can see above, proxy generates only property and not methods. Does
any one have any idea why that is?

Thanks,
Alex.
Nov 21 '05 #1
1 1662
This is by definition how Web services work. You can only pass data between
the caller and the Web service. Ideally, you should define the data that you
will pass in the Web service in XSD first, but .NET does this step behind
the scenes for you.

If you are looking for functionality in addition to your data, maybe you can
consider making Class1 another Web service.

Eric

--
Eric Cherng
MCP, MCDBA, MCSD
http://echerng.com
"Alexander Kaplunov" <ak*******@nvidia.com> wrote in message
news:uF*************@tk2msftngp13.phx.gbl...
I have a web service, which has a reference to a class. I want to be able
to
accept this class as a parameter to my web service method. When the
consumer
consumes the web service, proxy class is created. This proxy has my class
but for some reason it does not generate methods, only properties.

Here is my code....

****Class*****
[Serializable]
public class Class1
{
string str;
public Class1()
{
//
// TODO: Add constructor logic here
//
}
public void Test(int a)
{
}
public string IntReturn(int b)
{
return str;
}
public string PropTest
{
set { str = value; }
get { return str; }
}
}

*****WebService*****
[WebMethod]
public void Obj(ClassLibrary1.Class1 cls)
{
cls.Test(5);
}
****webservice proxy******
[System.Xml.Serialization.XmlTypeAttribute(Namespac e="http://tempuri.org/")]
public class Class1 {
/// <remarks/>
public string PropTest;
}

As you can see above, proxy generates only property and not methods. Does
any one have any idea why that is?

Thanks,
Alex.

Nov 21 '05 #2

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

Similar topics

5
by: Benne Smith | last post by:
Hi, I have three enviroments; a development, a testing and a production enviroment. I'm making a big application (.exe), which uses alot of different webservices. I don't use the webservices...
6
by: Brad | last post by:
I have a web service which returns a collection of class object (see below). I want to consume this service in another web application by binding it to a List control The data returns from the...
1
by: Smugsboy | last post by:
Hi, I have a problem with a web service proxy written in .NET and used from VS6's C++ as COM object. This proxy works great when used from a .NET application. It does not seem to work when used...
7
by: stephan querengaesser | last post by:
hi ng, i try to invoke a webservice-method with an filter-object, that contains value types. if i donīt want to filter the return value of the method, i have to pass a new instance of the...
7
by: Nalaka | last post by:
Hi, I created a sinple web service that returns a dataSet. Then I created a client program that uses this web service (that returns the Dataset). My question is, how did the client figure...
2
by: Paul Whygle | last post by:
Is it possible to inherit a class that is a part of a Consumed Webservice? I have been trying to get this to work and i cant seem to figure it out. When i look at the "code-behind" (for lack of a...
3
by: Arpan | last post by:
Web Services make use of proxy classes whose methods & properties are accessed in exactly the same way as how a normal class' methods & properties are accessed. So what for does ASP.NET generate...
9
by: Greger | last post by:
Hi, I am building an architecture that passes my custom objects to and from webservices. (Our internal architecture requires me to use webservices to any suggestion to use other remoting...
10
by: Phillip Taylor | last post by:
Hi guys, I'm looking to develop a simple web service in VB.NET but I'm having some trivial issues. In Visual Studio I create a web services project and change the asmx.vb file to this: Imports...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
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.