Re: Need to write web service
- From: ge0193387@xxxxxxx
- Date: Fri, 05 Oct 2007 12:58:45 -0700
On Oct 5, 1:27 pm, cj <c...@xxxxxxxxxxxxx> wrote:
I'm afraid I need to go more basic. When I start VB2005. I choose
create web site, Correct? I've done one web app so far back about 6
months ago and don't really remember that much. I've been doing windows
apps for years. I think for my web app I chose ASP.NET Web Site next
but perhaps it was Empty Web Site--not sure, but I see ASP.NET Web
Service which sounds more like what I want this time. Correct?
ge0193...@xxxxxxx wrote:
On Oct 5, 9:26 am, cj <c...@xxxxxxxxxxxxx> wrote:
I have used web services before WSDL files and such but never written
one. I need some basic starting info.
1. Can I write a web service in a windows app? or are all web services
asp web apps? In other words what type of program do I create?
Web Services are web applications but they can be used in any .NET
type (ASP, Windows, Mobile Device, etc.). When you have created your
webservice in your windows app when you go to add references you can
select Add Web Reference to add a webservice.
2. Anyone point me to a tutorial that is very basic like write one that
takes two numbers and returns the sum?
<WebMethod()>_
public function Sum (byval Num1 as integer, byval Num2 as integer) as
integer
return Num1 + Num2
end function
If you don't use the "<WebMethod()>" the method will not be visible to
programs calling the webservice.
3. Getting a bit deeper now, but I need to know if to use VB 2003 or
2005. One of our business partners who is going to have to use it
insists I have to write it in .net 1.1 and not 2.0. I really don't see
why he would care what it is written in. I would think using it over
the web would be generic.
While I'm not an expert on webservices by any means at all since its
compiled into XML before sending the request it shouldn't matter.
When using web services you'll find that your more complex object
types are tougher to send (ArrayList, List(of), Hashtable). Meaning
that you'll generally instead of sending a List(of String) you'll send
an array of string (String()). Also any objects you plan on sending
must be <Serializable()> in order to pass through the webservice which
would also mean that any language should interpret it.
The only real excuse I can find for this is ignorance or they might
want to maintain the webservice at some point and don't want to mess
with 2.0.
File> New Website
ASP.Net Web Service - this will create your web service
The easiest way to deal with a webservice within another application
is to clump it all together into the same solution. So if your
Windows app already exists you can go to File > Add Project > Add New
Website and then choose ASP.Net Web Service. Once the web service is
created you should have a service.vb file in there somewhere, this is
where you'll code all your web methods. It will take a little bit to
get the hang of using it.
.
- References:
- Need to write web service
- From: cj
- Re: Need to write web service
- From: ge0193387
- Re: Need to write web service
- From: cj
- Need to write web service
- Prev by Date: Re: Progress bar cannot be shown while a process is running
- Next by Date: Re: Progress bar cannot be shown while a process is running
- Previous by thread: Re: Need to write web service
- Next by thread: Re: Need to write web service
- Index(es):
Relevant Pages
|
Loading