Re: Need to write web service



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.

.



Relevant Pages

  • Consuming a PHP Webservice
    ... that needs to transfer securely data to a MySQL database located on a Linux ... I have created a PHP webservice that will receive an xml file with all the ... The web service works OK using a testing PHP client. ... The windows application will create the xml file to be transferred to the ...
    (microsoft.public.dotnet.framework.webservices)
  • .Net 2.0 issue with HttpWebRequest/Proxy breaking WebService
    ... through a proxy server after using the HttpWebRequest object. ... Under normal circumstances I am able to use the webservice without any ... Windows Authentication ... //Set Credentials for Web Service ...
    (microsoft.public.dotnet.framework.aspnet)
  • Adding a parameter to the SOAP Header?
    ... that gets request from both a Windows UI and a WebUI. ... in my web service that says "WIN" or "WEB" depending on where it came ... I would like to somehow add a parameter to the webservice context (or ...
    (microsoft.public.dotnet.framework.aspnet.webservices)
  • Re: How to consume a xml webservice in a windows ce device application
    ... Localhost is going to try to connect to you the Windows CE device. ... Web service correctly and I think you'll find that it works. ... For that, i created one webservice, when i am calling this ...
    (microsoft.public.windowsce.embedded)
  • Re: upload 50M file to web service got 500 internal server error
    ... How would you recommend getting a 100 meg data file to a webservice ... > Try looking at the response in the trace. ... > back if you install a trace web service extension (avaliable from ... > Right now maxRequestLength property of Web App and Webservcie are all set to ...
    (microsoft.public.dotnet.framework.webservices)

Loading