473,405 Members | 2,354 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,405 software developers and data experts.

custom types: classes

Hi,

I'm new to web services and I'm having some trouble figuring out how to
define a custom object that works through the webservice.

For example, I have the following on the server side:

public class Token
{

private string firstID;

private string secondID;

public string getFirstD() { return firstID; }

public string getSecondID() { return secondID; }

public void setFirstID(string id) { firstID= id; }

public void setSecondID(string id) { secondID= id; }

}

[WebMethod]

public bool GetResellerList2(Token token, string languageisocode)

{

return true;

}
When I view the object on the client side, I can't see any of the properties
or methods defined in the Token class. What am I missing?

Thanks,

Chris
Nov 23 '05 #1
10 1366
Hi Chris,
if inside the asmx file of the ws do not use the custom class it did not
publish it. to check if it is published go to the web reference of the
project that you reference the ws and press "show all files"
expand the reference of the ws and expand the Reference.map in there it is a
Reference.cs open it, if your custom class is not in there
/// <remarks/>Web Service Class

[System.Diagnostics.DebuggerStepThroughAttribute()]

[System.ComponentModel.DesignerCategoryAttribute("c ode")]

[System.Web.Services.WebServiceBindingAttribute(Nam e="LiveUpdateSoap",
Namespace="http://orama-tech.gr/WebServices/")]

public class LiveUpdate :
System.Web.Services.Protocols.SoapHttpClientProtoc ol {

}
/// <remarks/>

///Custom class

/// <remarks/>

[System.Xml.Serialization.XmlTypeAttribute(Namespac e="http://localhost/WebServices/")]

public class DownloadInfo {

}
as the ws class
then you can do anything with it. You can add in the Reference.cs
programmably.
Hope that Helps.
"Chris" <ch***@no-spam.com> wrote in message
news:eN*************@TK2MSFTNGP14.phx.gbl...
Hi,

I'm new to web services and I'm having some trouble figuring out how to
define a custom object that works through the webservice.

For example, I have the following on the server side:

public class Token
{

private string firstID;

private string secondID;

public string getFirstD() { return firstID; }

public string getSecondID() { return secondID; }

public void setFirstID(string id) { firstID= id; }

public void setSecondID(string id) { secondID= id; }

}

[WebMethod]

public bool GetResellerList2(Token token, string languageisocode)

{

return true;

}
When I view the object on the client side, I can't see any of the
properties
or methods defined in the Token class. What am I missing?

Thanks,

Chris

Nov 23 '05 #2
Hi Chris,
if inside the asmx file of the ws do not use the custom class it did not
publish it. to check if it is published go to the web reference of the
project that you reference the ws and press "show all files"
expand the reference of the ws and expand the Reference.map in there it is a
Reference.cs open it, if your custom class is not in there
/// <remarks/>Web Service Class

[System.Diagnostics.DebuggerStepThroughAttribute()]

[System.ComponentModel.DesignerCategoryAttribute("c ode")]

[System.Web.Services.WebServiceBindingAttribute(Nam e="LiveUpdateSoap",
Namespace="http://orama-tech.gr/WebServices/")]

public class LiveUpdate :
System.Web.Services.Protocols.SoapHttpClientProtoc ol {

}
/// <remarks/>

///Custom class

/// <remarks/>

[System.Xml.Serialization.XmlTypeAttribute(Namespac e="http://localhost/WebServices/")]

public class DownloadInfo {

}
as the ws class
then you can do anything with it. You can add in the Reference.cs
programmably.
Hope that Helps.
"Chris" <ch***@no-spam.com> wrote in message
news:eN*************@TK2MSFTNGP14.phx.gbl...
Hi,

I'm new to web services and I'm having some trouble figuring out how to
define a custom object that works through the webservice.

For example, I have the following on the server side:

public class Token
{

private string firstID;

private string secondID;

public string getFirstD() { return firstID; }

public string getSecondID() { return secondID; }

public void setFirstID(string id) { firstID= id; }

public void setSecondID(string id) { secondID= id; }

}

[WebMethod]

public bool GetResellerList2(Token token, string languageisocode)

{

return true;

}
When I view the object on the client side, I can't see any of the
properties
or methods defined in the Token class. What am I missing?

Thanks,

Chris

Nov 23 '05 #3
So put in the Reference.cs the following:
/// <remarks/>

[System.Xml.Serialization.XmlTypeAttribute(Namespac e="http://orama-tech.gr/WebServices/")]

public class Token
{

private string firstID;

private string secondID;

public string getFirstD() ;

public string getSecondID() ;

public void setFirstID(string id) ;
public void setSecondID(string id) ;
}
"Chris" <ch***@no-spam.com> wrote in message
news:eN*************@TK2MSFTNGP14.phx.gbl...
Hi,

I'm new to web services and I'm having some trouble figuring out how to
define a custom object that works through the webservice.

For example, I have the following on the server side:

public class Token
{

private string firstID;

private string secondID;

public string getFirstD() { return firstID; }

public string getSecondID() { return secondID; }

public void setFirstID(string id) { firstID= id; }

public void setSecondID(string id) { secondID= id; }

}

[WebMethod]

public bool GetResellerList2(Token token, string languageisocode)

{

return true;

}
When I view the object on the client side, I can't see any of the
properties
or methods defined in the Token class. What am I missing?

Thanks,

Chris

Nov 23 '05 #4
So put in the Reference.cs the following:
/// <remarks/>

[System.Xml.Serialization.XmlTypeAttribute(Namespac e="http://orama-tech.gr/WebServices/")]

public class Token
{

private string firstID;

private string secondID;

public string getFirstD() ;

public string getSecondID() ;

public void setFirstID(string id) ;
public void setSecondID(string id) ;
}
"Chris" <ch***@no-spam.com> wrote in message
news:eN*************@TK2MSFTNGP14.phx.gbl...
Hi,

I'm new to web services and I'm having some trouble figuring out how to
define a custom object that works through the webservice.

For example, I have the following on the server side:

public class Token
{

private string firstID;

private string secondID;

public string getFirstD() { return firstID; }

public string getSecondID() { return secondID; }

public void setFirstID(string id) { firstID= id; }

public void setSecondID(string id) { secondID= id; }

}

[WebMethod]

public bool GetResellerList2(Token token, string languageisocode)

{

return true;

}
When I view the object on the client side, I can't see any of the
properties
or methods defined in the Token class. What am I missing?

Thanks,

Chris

Nov 23 '05 #5
Hi,

ehhh... Web Services expose the public properties and WebMethod
annotated functions.

Since you use "Token" as a parameter, and the "Token" class only
contains private properties (don't get serialized) and public methods!
nothing of this class will be available in the WebService call.

if you change you data-class as follows

public class Token
{
private string firstID;
private string lastID;

public string FirstID
{
get
{
return firstID;
}

set
{
firstID = value;
}
}

public string LastID
{
get
{
return lastID;
}

set
{
lastID = value;
}
}

}
and use that in your WebService you'll see the availability of
"FirstID" and "LastID" within the generated proxy of this service on
the client side.
Hope this helps,

Marvin Smit

On Tue, 21 Jun 2005 10:25:48 -0700, "Chris" <ch***@no-spam.com> wrote:
Hi,

I'm new to web services and I'm having some trouble figuring out how to
define a custom object that works through the webservice.

For example, I have the following on the server side:

public class Token
{

private string firstID;

private string secondID;

public string getFirstD() { return firstID; }

public string getSecondID() { return secondID; }

public void setFirstID(string id) { firstID= id; }

public void setSecondID(string id) { secondID= id; }

}

[WebMethod]

public bool GetResellerList2(Token token, string languageisocode)

{

return true;

}
When I view the object on the client side, I can't see any of the properties
or methods defined in the Token class. What am I missing?

Thanks,

Chris


Nov 23 '05 #6
Hi,

ehhh... Web Services expose the public properties and WebMethod
annotated functions.

Since you use "Token" as a parameter, and the "Token" class only
contains private properties (don't get serialized) and public methods!
nothing of this class will be available in the WebService call.

if you change you data-class as follows

public class Token
{
private string firstID;
private string lastID;

public string FirstID
{
get
{
return firstID;
}

set
{
firstID = value;
}
}

public string LastID
{
get
{
return lastID;
}

set
{
lastID = value;
}
}

}
and use that in your WebService you'll see the availability of
"FirstID" and "LastID" within the generated proxy of this service on
the client side.
Hope this helps,

Marvin Smit

On Tue, 21 Jun 2005 10:25:48 -0700, "Chris" <ch***@no-spam.com> wrote:
Hi,

I'm new to web services and I'm having some trouble figuring out how to
define a custom object that works through the webservice.

For example, I have the following on the server side:

public class Token
{

private string firstID;

private string secondID;

public string getFirstD() { return firstID; }

public string getSecondID() { return secondID; }

public void setFirstID(string id) { firstID= id; }

public void setSecondID(string id) { secondID= id; }

}

[WebMethod]

public bool GetResellerList2(Token token, string languageisocode)

{

return true;

}
When I view the object on the client side, I can't see any of the properties
or methods defined in the Token class. What am I missing?

Thanks,

Chris


Nov 23 '05 #7
Hmm ... what if I wanted the actual method calls rather than property
getters? I'm currently mocking out a temporary .net webservice.
Unfortunately, when it makes it into production, it will be a Java based
webservice where we'll be doing method calls on custom objects provided by
the webservice. I just want to mimic the same functionality here and I
don't think properties are going to work ... is there another solution?

Thanks,

Chris
"Marvin Smit" <ma*********@gmail.com> wrote in message
news:do********************************@4ax.com...
Hi,

ehhh... Web Services expose the public properties and WebMethod
annotated functions.

Since you use "Token" as a parameter, and the "Token" class only
contains private properties (don't get serialized) and public methods!
nothing of this class will be available in the WebService call.

if you change you data-class as follows

public class Token
{
private string firstID;
private string lastID;

public string FirstID
{
get
{
return firstID;
}

set
{
firstID = value;
}
}

public string LastID
{
get
{
return lastID;
}

set
{
lastID = value;
}
}

}
and use that in your WebService you'll see the availability of
"FirstID" and "LastID" within the generated proxy of this service on
the client side.
Hope this helps,

Marvin Smit

On Tue, 21 Jun 2005 10:25:48 -0700, "Chris" <ch***@no-spam.com> wrote:
Hi,

I'm new to web services and I'm having some trouble figuring out how to
define a custom object that works through the webservice.

For example, I have the following on the server side:

public class Token
{

private string firstID;

private string secondID;

public string getFirstD() { return firstID; }

public string getSecondID() { return secondID; }

public void setFirstID(string id) { firstID= id; }

public void setSecondID(string id) { secondID= id; }

}

[WebMethod]

public bool GetResellerList2(Token token, string languageisocode)

{

return true;

}
When I view the object on the client side, I can't see any of the propertiesor methods defined in the Token class. What am I missing?

Thanks,

Chris

Nov 23 '05 #8
Hmm ... what if I wanted the actual method calls rather than property
getters? I'm currently mocking out a temporary .net webservice.
Unfortunately, when it makes it into production, it will be a Java based
webservice where we'll be doing method calls on custom objects provided by
the webservice. I just want to mimic the same functionality here and I
don't think properties are going to work ... is there another solution?

Thanks,

Chris
"Marvin Smit" <ma*********@gmail.com> wrote in message
news:do********************************@4ax.com...
Hi,

ehhh... Web Services expose the public properties and WebMethod
annotated functions.

Since you use "Token" as a parameter, and the "Token" class only
contains private properties (don't get serialized) and public methods!
nothing of this class will be available in the WebService call.

if you change you data-class as follows

public class Token
{
private string firstID;
private string lastID;

public string FirstID
{
get
{
return firstID;
}

set
{
firstID = value;
}
}

public string LastID
{
get
{
return lastID;
}

set
{
lastID = value;
}
}

}
and use that in your WebService you'll see the availability of
"FirstID" and "LastID" within the generated proxy of this service on
the client side.
Hope this helps,

Marvin Smit

On Tue, 21 Jun 2005 10:25:48 -0700, "Chris" <ch***@no-spam.com> wrote:
Hi,

I'm new to web services and I'm having some trouble figuring out how to
define a custom object that works through the webservice.

For example, I have the following on the server side:

public class Token
{

private string firstID;

private string secondID;

public string getFirstD() { return firstID; }

public string getSecondID() { return secondID; }

public void setFirstID(string id) { firstID= id; }

public void setSecondID(string id) { secondID= id; }

}

[WebMethod]

public bool GetResellerList2(Token token, string languageisocode)

{

return true;

}
When I view the object on the client side, I can't see any of the propertiesor methods defined in the Token class. What am I missing?

Thanks,

Chris

Nov 23 '05 #9
Hmm ... I see what you mean, but if I add this class to References.cs, it's
added on the client side. Everytime I update the web reference, the changes
that were made would disappear. Is there any way to ensure that the methods
get published on the server side?

Chris

"Nassos" <na***@orama-tech.gr> wrote in message
news:%2****************@tk2msftngp13.phx.gbl...
So put in the Reference.cs the following:
/// <remarks/>

[System.Xml.Serialization.XmlTypeAttribute(Namespac e="http://orama-tech.gr/W
ebServices/")]
public class Token
{

private string firstID;

private string secondID;

public string getFirstD() ;

public string getSecondID() ;

public void setFirstID(string id) ;
public void setSecondID(string id) ;
}
"Chris" <ch***@no-spam.com> wrote in message
news:eN*************@TK2MSFTNGP14.phx.gbl...
Hi,

I'm new to web services and I'm having some trouble figuring out how to
define a custom object that works through the webservice.

For example, I have the following on the server side:

public class Token
{

private string firstID;

private string secondID;

public string getFirstD() { return firstID; }

public string getSecondID() { return secondID; }

public void setFirstID(string id) { firstID= id; }

public void setSecondID(string id) { secondID= id; }

}

[WebMethod]

public bool GetResellerList2(Token token, string languageisocode)

{

return true;

}
When I view the object on the client side, I can't see any of the
properties
or methods defined in the Token class. What am I missing?

Thanks,

Chris


Nov 23 '05 #10
Hmm ... I see what you mean, but if I add this class to References.cs, it's
added on the client side. Everytime I update the web reference, the changes
that were made would disappear. Is there any way to ensure that the methods
get published on the server side?

Chris

"Nassos" <na***@orama-tech.gr> wrote in message
news:%2****************@tk2msftngp13.phx.gbl...
So put in the Reference.cs the following:
/// <remarks/>

[System.Xml.Serialization.XmlTypeAttribute(Namespac e="http://orama-tech.gr/W
ebServices/")]
public class Token
{

private string firstID;

private string secondID;

public string getFirstD() ;

public string getSecondID() ;

public void setFirstID(string id) ;
public void setSecondID(string id) ;
}
"Chris" <ch***@no-spam.com> wrote in message
news:eN*************@TK2MSFTNGP14.phx.gbl...
Hi,

I'm new to web services and I'm having some trouble figuring out how to
define a custom object that works through the webservice.

For example, I have the following on the server side:

public class Token
{

private string firstID;

private string secondID;

public string getFirstD() { return firstID; }

public string getSecondID() { return secondID; }

public void setFirstID(string id) { firstID= id; }

public void setSecondID(string id) { secondID= id; }

}

[WebMethod]

public bool GetResellerList2(Token token, string languageisocode)

{

return true;

}
When I view the object on the client side, I can't see any of the
properties
or methods defined in the Token class. What am I missing?

Thanks,

Chris


Nov 23 '05 #11

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

Similar topics

1
by: Josue Avila M. | last post by:
HI I Design a Class Wich contains severals DataTypes . (2 Strings and Other Data Types from a Class wich i Desing to) Its Something like This <serializable()> Public Class Emitor Public...
5
by: mtv | last post by:
Hi all, I have the following code: ================================ Webservice side: public class MyWS: WebService { private myLib.DataObject curDataObject;
2
by: Sumit | last post by:
Hi All... What is the best way of binding a custom object that is returned via a Web Service? From what Ive seen, the proxy class generated by wsdl.exe doesnt include properties for the members...
12
by: Noel | last post by:
Hello, I'm currently developing a web service that retrieves data from an employee table. I would like to send and retrieve a custom employee class to/from the webservice. I have currently coded...
2
by: gbanister | last post by:
I'd like to repost a message that I found in this group almost one year ago, because it's the exact problem I'm in and there was no solution offered to this post last year. (note: I was not the...
8
by: Techno_Dex | last post by:
Has anyone come up with a slick way to make Custom Serializable Objects to behave like DataSets when using WebServices? What I'm looking for is some way to force the WSDL generated code to create...
1
by: hardieca | last post by:
Hi! I decorate my unfinished classes and methods with a custom TODO attribute (as in things To Do). Using reflection, I am then able to parse through my classes and output all TODOs to a list I...
2
by: Smithers | last post by:
I have a Windows Forms application that implements a plug-in architecture whereby required assemblies are identified and loaded dynamically. Here are the relevant classes: A = application =...
4
by: =?Utf-8?B?a2lzaG9y?= | last post by:
Hi, has any one used webservices for returning custom objects other than datasets like custom classes and their internal classes ?. What problems you have faced if any ? is there any limitation...
11
by: =?Utf-8?B?bWljaGFlbCBzb3JlbnM=?= | last post by:
I have worked with application settings in VS2005 and C# for awhile, but usually with standard types. I have been trying to store a custom container/class/type in an application setting and I have...
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: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
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
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...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.