I am trying to call a web service (smartermail) which return some information (single or multiple). I am able to call the service but I dont know how to read the response/returned values?

Can someone give me hints please.

You will need to look at the API to see what you are being returned. A generic question like this unfortunately cannot be answered without knowledge of the API.

Please look at the documentation and see how the response is formed and what responses you get.

This is the service.

http://sm.eworld.net.pk/Services/svcServerAdmin.asmx?op=GetSpoolMessageCount

and I am calling it as below.

using System.Web.Services;
using System.Web.Services.Protocols;

svcServerAdmin.svcServerAdmin service = new svcServerAdmin.svcServerAdmin();

TextBox1.Text = service.GetSpoolMessageCount("admin", "1234").ToString();


But it returning below.
"WebServices.svcServerAdmin.MessageCountResult"

Showing it me is no good as you're the one that needs to learn the in's and out's of it. You need to find the API documentation =)

I know but I need some direction.

This is the response.

#######################
<?xml version="1.0" encoding="utf-8" ?>
- <MessageCountResult xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://tempuri.org/">
<Result>true</Result>
<ResultCode>0</ResultCode>
<Message />
<messageCount>0</messageCount>
</MessageCountResult>
#################################


The documents only says


##################################
GetSpoolMessageCount: Returns the number of messages in the spool.
o Return Type: MessageCountResult
o Parameters:
 AuthUserName: User name used to perform this function. Requires system administrator privileges
 AuthPassword: Password for the username
##################################

I need to read "messageCount" value.

Have you tried to cast (WebServices.svcServerAdmin.MessageCountResult) in front of your response or did you look at the properties of the returned value.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.