473,779 Members | 2,038 Online
Bytes | Software Development & Data Engineering Community
+ 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 MedicaidEligibi lityService

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 ReturnDescripti on 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 MedicaidEligibi lityService.Res ult
myResult = New MedicaidEligibi lityService.Res ult
myResult.Member ID = Out_MemberID.Tr im
myResult.SSN = Out_SSN.Trim
myResult.DOB = Out_DOB.Trim
myResult.Member FirstName = Out_MemberFirst Name.Trim
myResult.Member LastName = Out_MemberLastN ame.Trim
myResult.Member Address1 = Out_MemberAddre ss1.Trim
myResult.Member Address2 = Out_MemberAddre ss2.Trim
myResult.Member Address3 = Out_MemberAddre ss3.Trim
myResult.Member City = Out_MemberCity. Trim
myResult.Member State = Out_MemberState .Trim
myResult.Member ZipCode = Out_MemberZipCo de.Trim
myResult.Member Phone = Out_MemberPhone .Trim
myResult.Physic ianName = Out_PhysicianNa me.Trim
myResult.Physic ianPhone = Out_PhysicianPh one.Trim
myResult.Return Code = Out_ReturnCode. Trim
myResult.Return Description =
BuildReturnDesc ription(Out_Ret urnCode)
myResult.Eligib ilityDate = Out_Eligibility Date.Trim
Return myResult
Aug 23 '06 #1
2 1935
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 MedicaidEligibi lityService

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 ReturnDescripti on 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 MedicaidEligibi lityService.Res ult
myResult = New MedicaidEligibi lityService.Res ult
myResult.Member ID = Out_MemberID.Tr im
myResult.SSN = Out_SSN.Trim
myResult.DOB = Out_DOB.Trim
myResult.Member FirstName = Out_MemberFirst Name.Trim
myResult.Member LastName = Out_MemberLastN ame.Trim
myResult.Member Address1 = Out_MemberAddre ss1.Trim
myResult.Member Address2 = Out_MemberAddre ss2.Trim
myResult.Member Address3 = Out_MemberAddre ss3.Trim
myResult.Member City = Out_MemberCity. Trim
myResult.Member State = Out_MemberState .Trim
myResult.Member ZipCode = Out_MemberZipCo de.Trim
myResult.Member Phone = Out_MemberPhone .Trim
myResult.Physic ianName = Out_PhysicianNa me.Trim
myResult.Physic ianPhone = Out_PhysicianPh one.Trim
myResult.Return Code = Out_ReturnCode. Trim
myResult.Return Description =
BuildReturnDesc ription(Out_Ret urnCode)
myResult.Eligib ilityDate = Out_Eligibility Date.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
2337
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 having to do a httpwebreqeust call.
6
9011
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 and was succesfully processed. - The second one - ExportData - should take as an input parameter an integer an return a XML document. I would like to know if it is possible to do something like that. Do I
2
1906
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 blank result with an error attached or is there some other way to do this? thanks, Anthony
5
4971
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 DataTable object. The problem occurs when I try to compile the client side C# application (it complains about the DataTable type not being recognized as the return of the web service method). Thanks
7
1224
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 label in a GUI, some data may come from a database. The application will be able to connect to any standard database in time, but for the time being it's access. I will need to 'bolt' this application into many other applications as time
15
13516
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 http://msdn2.microsoft.com/en-us/library/ms996381.aspx Formerly, with classic Microsoft DNA architecture, the ADO Recordset was a primary transport medium, recommended for transmitting data between application tiers. In fact, there are whole books written on the subject.
5
8639
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
1974
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 Delimited/Carriage Return String? Through a file? Other?
2
5641
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 with me. I have a web service that needs to be accessed via GET, POST and SOAP. The method expects an interger, a CustomerId for example, does some processing and returns an error codeor 0 if no errors occurred.
0
10306
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10138
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10074
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8961
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6724
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5373
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5503
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4037
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 we have to send another system
3
2869
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 can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.