Click to See Complete Forum and Search --> : Web Service Parameters


kalyform
04-16-2007, 08:21 PM
I'm trying to develop a web service that accepts the following parameters:

Address Line1, Address Line 2, AddressLine3, City , State , and PostCode.

My client is usually , a Dot Net application or a classic ASP page or a VB 6 application. What I intend to do is to create a web service that accepts these parameters, processes them(I call a different service for this) and pass back the modified address, ie, ResultAddress1 ,ResultAddress2, ResultAddress3, ResultCity, ResultState and ResultPostCode.



My question is what is the best way to handle these request , response parameters?. My client should be able to accept these parameters and send back the Modified addresses.

Tweak4
04-17-2007, 10:55 AM
There are countless ways to do it- if you are in control of both the web service and the apps that consume it, the easiest way is probably just to create an address class that contains the properties you need, and return that from your service.
If other people may make use of your service, you could return an array of strings (a little generic, but usable), or <probable best answer> an XML string.

kalyform
04-17-2007, 11:38 AM
Thank you for the reply. Is there any sample code on how to use an XML string to accomplish this?

kalyform
04-17-2007, 11:55 AM
or an Address obect that contains the properties that is required

Tweak4
04-19-2007, 10:35 AM
It all depends on the language you choose to use. In C# at least, the response from a web service comes back as XML no matter what, but there are also serialization methods within the framework that can give you a little more control over how your XML looks.
As for the object, you simply create a class like you would any other and just declare that class as your web method's return type.
(If you didn't understand any of that, I would recommend starting off with a tutorial on web services - if you opt for C#, Microsoft has a good set of introductory guides on the Visual Studio Express site)