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

Home Posts Topics Members FAQ

Web Service Returning Data Best Practice

I am trying to figure out the best way to return data through a web service.
If the value is a single value I can just set it equal to the web service
name. If I am returning a set of data I have seen a couple ways to do this.
The dataset coming back to me is a SybaseASE Data Reader. Any help you can
provide would be much appreciated.

thanks,
Anthony

Right now I have done the following:

Namespace MedicaidEligibilityService

Public Class Result
Public MemberID As String
Public SSN As String
Public DOB As String
Public MemberFirstName As String
Public MemberLastName As String
Public MemberAddress1 As String
Public MemberAddress2 As String
Public MemberAddress3 As String
Public MemberCity As String
Public MemberState As String
Public MemberZipCode As String
Public MemberPhone As String
Public PhysicianName As String
Public PhysicianPhone As String
Public ReturnCode As String
Public ReturnDescription As String
Public EligibilityDate As String
End Class

I get the dataset back and set each field to a local variable and do the
following

Dim myResult As MedicaidEligibilityService.Result
myResult = New MedicaidEligibilityService.Result
myResult.MemberID = Out_MemberID.Trim
myResult.SSN = Out_SSN.Trim
myResult.DOB = Out_DOB.Trim
myResult.MemberFirstName = Out_MemberFirstName.Trim
myResult.MemberLastName = Out_MemberLastName.Trim
myResult.MemberAddress1 = Out_MemberAddress1.Trim
myResult.MemberAddress2 = Out_MemberAddress2.Trim
myResult.MemberAddress3 = Out_MemberAddress3.Trim
myResult.MemberCity = Out_MemberCity.Trim
myResult.MemberState = Out_MemberState.Trim
myResult.MemberZipCode = Out_MemberZipCode.Trim
myResult.MemberPhone = Out_MemberPhone.Trim
myResult.PhysicianName = Out_PhysicianName.Trim
myResult.PhysicianPhone = Out_PhysicianPhone.Trim
myResult.ReturnCode = Out_ReturnCode.Trim
myResult.ReturnDescription =
BuildReturnDescription(Out_ReturnCode)
myResult.EligibilityDate = Out_EligibilityDate.Trim
Return myResult
Aug 23 '06 #1
2 1918
Hi Anthony,
>I am trying to figure out the best way to return data through a web
service.
If the value is a single value I can just set it equal to the web service
name. If I am returning a set of data I have seen a couple ways to do
this.
Setting it equat to the web-service name? How do you that? ;-)

Well, I don't think that would be possible... at least as of now in
..net. But I may be wrong since I slept last night :)
The dataset coming back to me is a SybaseASE Data Reader. Any help you
can
provide would be much appreciated.
DataSet cannot be serialized (to XML in SOAP based Web Services). You
will need to put it into a DataView and then it may be directly sent over
the channel.

--
Happy Hacking,
Gaurav Vaish | http://www.mastergaurav.org
http://www.edujini.in | http://webservices.edujini.in
-------------------
Aug 23 '06 #2
What I do is pack all the data in a dataset and then return it be
reference. I use the function return just to signal if the data read
was successful or not.

You should make sure that the DS is cleared before calling so that you
don't bother sending a big dataset to the web service which isn't used
anyway.

The web reference on the client side takes care of marshalling and
demarshalling the data sent by reference back into the original
client's dataset. It's actually kind of amazing that Call By Reference
works completely transparently with web services.

Friend Function dbGetDS(ByVal KeyID As Integer, ByRef DS As DataSet) As
RETCODE

-paul
Anthony Biondo Jr wrote:
I am trying to figure out the best way to return data through a web service.
If the value is a single value I can just set it equal to the web service
name. If I am returning a set of data I have seen a couple ways to do this.
The dataset coming back to me is a SybaseASE Data Reader. Any help you can
provide would be much appreciated.

thanks,
Anthony

Right now I have done the following:

Namespace MedicaidEligibilityService

Public Class Result
Public MemberID As String
Public SSN As String
Public DOB As String
Public MemberFirstName As String
Public MemberLastName As String
Public MemberAddress1 As String
Public MemberAddress2 As String
Public MemberAddress3 As String
Public MemberCity As String
Public MemberState As String
Public MemberZipCode As String
Public MemberPhone As String
Public PhysicianName As String
Public PhysicianPhone As String
Public ReturnCode As String
Public ReturnDescription As String
Public EligibilityDate As String
End Class

I get the dataset back and set each field to a local variable and do the
following

Dim myResult As MedicaidEligibilityService.Result
myResult = New MedicaidEligibilityService.Result
myResult.MemberID = Out_MemberID.Trim
myResult.SSN = Out_SSN.Trim
myResult.DOB = Out_DOB.Trim
myResult.MemberFirstName = Out_MemberFirstName.Trim
myResult.MemberLastName = Out_MemberLastName.Trim
myResult.MemberAddress1 = Out_MemberAddress1.Trim
myResult.MemberAddress2 = Out_MemberAddress2.Trim
myResult.MemberAddress3 = Out_MemberAddress3.Trim
myResult.MemberCity = Out_MemberCity.Trim
myResult.MemberState = Out_MemberState.Trim
myResult.MemberZipCode = Out_MemberZipCode.Trim
myResult.MemberPhone = Out_MemberPhone.Trim
myResult.PhysicianName = Out_PhysicianName.Trim
myResult.PhysicianPhone = Out_PhysicianPhone.Trim
myResult.ReturnCode = Out_ReturnCode.Trim
myResult.ReturnDescription =
BuildReturnDescription(Out_ReturnCode)
myResult.EligibilityDate = Out_EligibilityDate.Trim
Return myResult
Aug 24 '06 #3

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

Similar topics

6
by: kbs | last post by:
Hi, I'm looking for some good examples that illustrate how to code a web service that exposes a custom collection so that the properties of the collection are accessible on the client without...
6
by: placek | last post by:
Hi all. I would like to create two web services: - The first one - ImportData - should take as an input parameter a XML document and return an integer saying if passed XML document was valid...
2
by: Anthony Biondo Jr | last post by:
I was wondering how to handle an error in a web service. If our web service encounters a connection error or any other error what is the best practice for returning an error? Do you return a...
5
by: Jim Murphy | last post by:
In creating a C# web service, I am having trouble returning a DataTable object as the result of a web method. I have no problem returning native types like string or int, but cannot return a .NET...
7
by: TClancey | last post by:
Hi all. I hope someone can give me a few pointers on 'best practice' for an app I'm about to start. I'm writing a small and simple label design application, users will define text fields on the...
15
by: Joseph Geretz | last post by:
I'm a bit puzzled by the current recommendation not to send Datasets or Datatables between application tiers. http://support.microsoft.com/kb/306134 ...
5
by: Frank Hauptlorenz | last post by:
Hello, I recognized some days ago, that returning a DataTable blocks my WCF-Service. Is this a known bug? If I add this table to a new DataSet() and return this, it works. Thank you, Frank
5
by: Eric Fortin | last post by:
I have a disconnected handheld device that I want to send the results of the day to a database through a web service (on an intranet) What's the best method to do this? XML? Tab...
2
by: Ben Joyce | last post by:
Hi all. I'm confused as to what the best or expected approch is to Web Service design under .Net, mainly with regards to Methods and Parameters. This is a bit awkward to explain so please bear...
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...
1
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,...
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
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.