473,466 Members | 1,314 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Returning Object From Webservice

Hi All
public class MyResponse
{
public bool m_bStatus;
public string m_szErrorCode;
public string m_szMessage;
}

i m returning this object from Webservice WebMethod, if i test this service
from its Service description its returning me

<MyResponse xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://tempuri.org/">

<m_bStatus>false</m_bStatus>
<m_szErrorCode>210</m_szErrorCode>
<m_szMessage>Error Occurred.</m_szMessage>
</MyResponse>

but when i m testing it using my client i m getting the name of my class, i
want to get the returning XML when i call the webmethod from my Client.
please help.

aSIM
Oct 16 '06 #1
2 1618
The code I use to call a Web Method is;

WebService.MyWebService webService = new WebService.MyWebService();

webService.MyResponse myResponse = webService.MyResponse();

You can call you indiviadual values using;

bool bitStatus = myResponse.m_bStatus;
string strError = myResponse.m_szErrorCode;
string strMessage = myResponse.m_szMessage;

In this example;

WebService = The folder under App_WebReferences
MyWebService = The name of you web service class.
MyResponse = The name of your web method.

Hope this makes sense and is waht you were after.

Cheers

Jared

Asim Qazi wrote:
Hi All
public class MyResponse
{
public bool m_bStatus;
public string m_szErrorCode;
public string m_szMessage;
}

i m returning this object from Webservice WebMethod, if i test this service
from its Service description its returning me

<MyResponse xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://tempuri.org/">

<m_bStatus>false</m_bStatus>
<m_szErrorCode>210</m_szErrorCode>
<m_szMessage>Error Occurred.</m_szMessage>
</MyResponse>

but when i m testing it using my client i m getting the name of my class, i
want to get the returning XML when i call the webmethod from my Client.
please help.

aSIM
Oct 16 '06 #2
Thanks a lot Jared, it really worked :) will ping the list again if i got
any other issue :)
God Bless you.

aSIM.
"Jared" <ja***********@gmail.comwrote in message
news:11*********************@f16g2000cwb.googlegro ups.com...
The code I use to call a Web Method is;

WebService.MyWebService webService = new WebService.MyWebService();

webService.MyResponse myResponse = webService.MyResponse();

You can call you indiviadual values using;

bool bitStatus = myResponse.m_bStatus;
string strError = myResponse.m_szErrorCode;
string strMessage = myResponse.m_szMessage;

In this example;

WebService = The folder under App_WebReferences
MyWebService = The name of you web service class.
MyResponse = The name of your web method.

Hope this makes sense and is waht you were after.

Cheers

Jared

Asim Qazi wrote:
Hi All
public class MyResponse
{
public bool m_bStatus;
public string m_szErrorCode;
public string m_szMessage;
}

i m returning this object from Webservice WebMethod, if i test this
service
from its Service description its returning me

<MyResponse xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://tempuri.org/">

<m_bStatus>false</m_bStatus>
<m_szErrorCode>210</m_szErrorCode>
<m_szMessage>Error Occurred.</m_szMessage>
</MyResponse>

but when i m testing it using my client i m getting the name of my
class, i
want to get the returning XML when i call the webmethod from my Client.
please help.

aSIM

Oct 16 '06 #3

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

Similar topics

1
by: Karuppasamy | last post by:
H I have a WebService calling a Method in a Remote Object. The Remote method Returns an Object. This Webservice also returns the same object. All things are working fine when this Web Service is...
0
by: Toby Mathews | last post by:
Hi there I am trying to return an instance of a class from a web service that contains a collection of instances of another class. I have three classes: Person MyEmails MyEmail Person is...
1
by: Knecke | last post by:
Hi all. I have a problem with returning a custom Result object with webservice. The classes i use is described below (some fields and properties is removed) public class Result { int...
5
by: LS | last post by:
Can a WebMethod return an Interface type? Can we pass an interface parameter ? Example : public interface IEntity { long Id { get; set; } string Name { get; set; } }
6
by: rlcavebmg | last post by:
I am new to Web Services and .NET development, and I have a question. I am writing a service that will create a bitmap image and return it to the client. First, I wrote a method that looked like...
5
by: Stacey Levine | last post by:
I have a webservice that I wanted to return an ArrayList..Well the service compiles and runs when I have the output defined as ArrayList, but the WSDL defines the output as an Object so I was...
1
by: J. Askey | last post by:
I am implementing a web service and thought it may be a good idea to return a more complex class (which I have called 'ServiceResponse') in order to wrap the original return value along with two...
7
by: sameer | last post by:
Hi all, Application environment : VB.Net desktop application,.NET 1.1 Framework, VS 2003. communicates between the database and the application is done over webservices using ADO.NEt Datasets....
1
by: Ronchese | last post by:
Helllo. I need to return a XML from my WebService, but I'm not getting the result as a XML. I mean, instead of receiveing a tag (<xyy></xyz>), I'm receiving it encoded (with &lt; or &gt;). There is...
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
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
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,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

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.