using Web Service classes
In
http://msdn.microsoft.com/msdnmag/is...n/vbnexgen.asp
one reads:
"If you池e using Visual Studio, you値l be able to drag any exposed Web
service right into your application, creating a new class file. If you want
to call a Web service anywhere on the Internet, all you値l need to do is
create a new instance of the Web service class and call its exposed
methods."
Can someone who has worked with this describe how you get the icon
representing the web service into your project? How do you add the
reference? Also, is the recognition of the exposed class methods automatic?
That is, if I were to do (something like) this:
Dim oWebSvc as cWebSvc
Set oWebSvc = New cWebSvc
oWebSvc.
will the exposed methods and properties appear automagically in the editor
when I type the "." after "oWebSvc" on line 3?
Finally, is the reference to the web class valid when the app that uses the
class is deployed, or does the reference have to be changed? That is, does
the developer, who is intending to deploy an application for use at some
remote location, have to take into account the URL/path that the remote
location would use to reach the particular web service? Let me try to make
that clearer. The developer might see the web service class as residing in
a directory on his internal server; does he have to "exit" his local domain,
and go back into his server via the internet/HTTP, when creating the initial
reference to the web class?
Thanks
Tim Romano
Re: using Web Service classes
In the few samples that I have done, I have added the Web Service by using
the "Add Web Reference" Wizard to add the reference. When you add the reference,
a stub/proxy class is created that identifies the methods exposed by the
service. This class becomes part of your project. Whenever you create an
object of the type of the Web Service then you are actually creating an instance
of the proxy. The proxy class methods actually communicate with the service
itself. This does enable intellisense for the object once you declare it.
HTH
PS. In VB.Net you can DIM and SET in the same line.
Dim oWebSvc as New cWebSvc()
As a matter of fact if you type SET into the IDE, it removes it as a simple
assignment to the New Constructor is used to create objects.
Larry Schaeffer
"Tim Romano" <tim_romano@yahoo.com> wrote:
>
>In
>
>http://msdn.microsoft.com/msdnmag/is...n/vbnexgen.asp
>
>one reads:
>
>"If you池e using Visual Studio, you値l be able to drag any exposed Web
>service right into your application, creating a new class file. If you want
>to call a Web service anywhere on the Internet, all you値l need to do is
>create a new instance of the Web service class and call its exposed
>methods."
>
>Can someone who has worked with this describe how you get the icon
>representing the web service into your project? How do you add the
>reference? Also, is the recognition of the exposed class methods automatic?
>That is, if I were to do (something like) this:
>
> Dim oWebSvc as cWebSvc
> Set oWebSvc = New cWebSvc
> oWebSvc.
>
>will the exposed methods and properties appear automagically in the editor
>when I type the "." after "oWebSvc" on line 3?
>
>Finally, is the reference to the web class valid when the app that uses
the
>class is deployed, or does the reference have to be changed? That is, does
>the developer, who is intending to deploy an application for use at some
>remote location, have to take into account the URL/path that the remote
>location would use to reach the particular web service? Let me try to make
>that clearer. The developer might see the web service class as residing
in
>a directory on his internal server; does he have to "exit" his local domain,
>and go back into his server via the internet/HTTP, when creating the initial
>reference to the web class?
>
>Thanks
>Tim Romano
>
>
>
>
>
>
>
>
>
>
Re: using Web Service classes
Larry,
Thanks for the helpful reply. Part of the process is clearer to me now. But
I still in the dark with regard to the deployment. Would the following
deployment scenario present any difficulties?
You develop a webservice on your internal server.
You develop an app that references the web service.
You deploy the webservice on a customer's server.
You deploy your app on the customer's PCs.
How do you let the app know that the webservice is not located where it was
at design-time but is in a different place now? Is there something like an
INI file that the app reads to determine the location of the webservices it
references, which can be edited to reflect their new location(s)?
Thanks
Tim Romano
"Larry Schaeffer" <llschaeffer@prodigy.net> wrote in message
news:3adc62d3$1@news.devx.com...
>
> In the few samples that I have done, I have added the Web Service by using
> the "Add Web Reference" Wizard to add the reference. When you add the
reference,
> a stub/proxy class is created that identifies the methods exposed by the
> service. This class becomes part of your project. Whenever you create an
> object of the type of the Web Service then you are actually creating an
instance
> of the proxy. The proxy class methods actually communicate with the
service
> itself. This does enable intellisense for the object once you declare it.
> HTH
>
> PS. In VB.Net you can DIM and SET in the same line.
> Dim oWebSvc as New cWebSvc()
>
> As a matter of fact if you type SET into the IDE, it removes it as a
simple
> assignment to the New Constructor is used to create objects.
>
> Larry Schaeffer
>
> "Tim Romano" <tim_romano@yahoo.com> wrote:
> >
> >In
> >
> >http://msdn.microsoft.com/msdnmag/is...n/vbnexgen.asp
> >
> >one reads:
> >
> >"If you池e using Visual Studio, you値l be able to drag any exposed Web
> >service right into your application, creating a new class file. If you
want
> >to call a Web service anywhere on the Internet, all you値l need to do is
> >create a new instance of the Web service class and call its exposed
> >methods."
> >
> >Can someone who has worked with this describe how you get the icon
> >representing the web service into your project? How do you add the
> >reference? Also, is the recognition of the exposed class methods
automatic?
> >That is, if I were to do (something like) this:
> >
> > Dim oWebSvc as cWebSvc
> > Set oWebSvc = New cWebSvc
> > oWebSvc.
> >
> >will the exposed methods and properties appear automagically in the
editor
> >when I type the "." after "oWebSvc" on line 3?
> >
> >Finally, is the reference to the web class valid when the app that uses
> the
> >class is deployed, or does the reference have to be changed? That is,
does
> >the developer, who is intending to deploy an application for use at some
> >remote location, have to take into account the URL/path that the remote
> >location would use to reach the particular web service? Let me try to
make
> >that clearer. The developer might see the web service class as residing
> in
> >a directory on his internal server; does he have to "exit" his local
domain,
> >and go back into his server via the internet/HTTP, when creating the
initial
> >reference to the web class?
> >
> >Thanks
> >Tim Romano
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
>
Re: using Web Service classes
Tim,
There is not an INI file and the app will be compiled into IL so it will
not be editable without recompiling. Therefore, the only solution I can
see is that after deploying the web service, you establish the web service
reference to the customers server then recompile the application before deploying
to a customers machine. It definitely adds a step to the deployment process.
HTH
Larry
"Tim Romano" <tim_romano@yahoo.com> wrote:
>Larry,
>Thanks for the helpful reply. Part of the process is clearer to me now.
But
>I still in the dark with regard to the deployment. Would the following
>deployment scenario present any difficulties?
>
>You develop a webservice on your internal server.
>You develop an app that references the web service.
>You deploy the webservice on a customer's server.
>You deploy your app on the customer's PCs.
>
>How do you let the app know that the webservice is not located where it
was
>at design-time but is in a different place now? Is there something like
an
>INI file that the app reads to determine the location of the webservices
it
>references, which can be edited to reflect their new location(s)?
>
>Thanks
>Tim Romano
>
>
>
>
>"Larry Schaeffer" <llschaeffer@prodigy.net> wrote in message
>news:3adc62d3$1@news.devx.com...
>>
>> In the few samples that I have done, I have added the Web Service by using
>> the "Add Web Reference" Wizard to add the reference. When you add the
>reference,
>> a stub/proxy class is created that identifies the methods exposed by the
>> service. This class becomes part of your project. Whenever you create
an
>> object of the type of the Web Service then you are actually creating an
>instance
>> of the proxy. The proxy class methods actually communicate with the
>service
>> itself. This does enable intellisense for the object once you declare
it.
>> HTH
>>
>> PS. In VB.Net you can DIM and SET in the same line.
>> Dim oWebSvc as New cWebSvc()
>>
>> As a matter of fact if you type SET into the IDE, it removes it as a
>simple
>> assignment to the New Constructor is used to create objects.
>>
>> Larry Schaeffer
>>
>> "Tim Romano" <tim_romano@yahoo.com> wrote:
>> >
>> >In
>> >
>> >http://msdn.microsoft.com/msdnmag/is...n/vbnexgen.asp
>> >
>> >one reads:
>> >
>> >"If you池e using Visual Studio, you値l be able to drag any exposed Web
>> >service right into your application, creating a new class file. If you
>want
>> >to call a Web service anywhere on the Internet, all you値l need to do
is
>> >create a new instance of the Web service class and call its exposed
>> >methods."
>> >
>> >Can someone who has worked with this describe how you get the icon
>> >representing the web service into your project? How do you add the
>> >reference? Also, is the recognition of the exposed class methods
>automatic?
>> >That is, if I were to do (something like) this:
>> >
>> > Dim oWebSvc as cWebSvc
>> > Set oWebSvc = New cWebSvc
>> > oWebSvc.
>> >
>> >will the exposed methods and properties appear automagically in the
>editor
>> >when I type the "." after "oWebSvc" on line 3?
>> >
>> >Finally, is the reference to the web class valid when the app that uses
>> the
>> >class is deployed, or does the reference have to be changed? That is,
>does
>> >the developer, who is intending to deploy an application for use at some
>> >remote location, have to take into account the URL/path that the remote
>> >location would use to reach the particular web service? Let me try to
>make
>> >that clearer. The developer might see the web service class as residing
>> in
>> >a directory on his internal server; does he have to "exit" his local
>domain,
>> >and go back into his server via the internet/HTTP, when creating the
>initial
>> >reference to the web class?
>> >
>> >Thanks
>> >Tim Romano
>> >
>> >
>> >
>> >
>> >
>> >
>> >
>> >
>> >
>> >
>>
>
>
Re: using Web Service classes
This problem is no different than moving any program from development into
deployment. You need to isolate the method for discovering external
resources. The last thing I would recommend is recompiling the application
just to move it from one location to another. While there's not a built-in
INI file for specifying the location of web services, you can create your
own file that the application reads at startup to get connection
information, the location of web services, temporary file locations, etc.
However, for web services, there's a much more robust solution--UDDI
(Universal Description, Discovery and Integration). Check out this overview
and download the sample:
http://msdn.microsoft.com/library/te...progguide.htm.
"Larry Schaeffer" <llschaeffer@prodigy.net> wrote in message
news:3add7aa8$1@news.devx.com...
>
> Tim,
> There is not an INI file and the app will be compiled into IL so it
will
> not be editable without recompiling. Therefore, the only solution I can
> see is that after deploying the web service, you establish the web service
> reference to the customers server then recompile the application before
deploying
> to a customers machine. It definitely adds a step to the deployment
process.
>
> HTH
>
> Larry
>
>
> "Tim Romano" <tim_romano@yahoo.com> wrote:
> >Larry,
> >Thanks for the helpful reply. Part of the process is clearer to me now.
> But
> >I still in the dark with regard to the deployment. Would the following
> >deployment scenario present any difficulties?
> >
> >You develop a webservice on your internal server.
> >You develop an app that references the web service.
> >You deploy the webservice on a customer's server.
> >You deploy your app on the customer's PCs.
> >
> >How do you let the app know that the webservice is not located where it
> was
> >at design-time but is in a different place now? Is there something like
> an
> >INI file that the app reads to determine the location of the webservices
> it
> >references, which can be edited to reflect their new location(s)?
> >
> >Thanks
> >Tim Romano
> >
> >
> >
> >
> >"Larry Schaeffer" <llschaeffer@prodigy.net> wrote in message
> >news:3adc62d3$1@news.devx.com...
> >>
> >> In the few samples that I have done, I have added the Web Service by
using
> >> the "Add Web Reference" Wizard to add the reference. When you add the
> >reference,
> >> a stub/proxy class is created that identifies the methods exposed by
the
> >> service. This class becomes part of your project. Whenever you create
> an
> >> object of the type of the Web Service then you are actually creating an
> >instance
> >> of the proxy. The proxy class methods actually communicate with the
> >service
> >> itself. This does enable intellisense for the object once you declare
> it.
> >> HTH
> >>
> >> PS. In VB.Net you can DIM and SET in the same line.
> >> Dim oWebSvc as New cWebSvc()
> >>
> >> As a matter of fact if you type SET into the IDE, it removes it as a
> >simple
> >> assignment to the New Constructor is used to create objects.
> >>
> >> Larry Schaeffer
> >>
> >> "Tim Romano" <tim_romano@yahoo.com> wrote:
> >> >
> >> >In
> >> >
> >> >http://msdn.microsoft.com/msdnmag/is...n/vbnexgen.asp
> >> >
> >> >one reads:
> >> >
> >> >"If you're using Visual Studio, you'll be able to drag any exposed Web
> >> >service right into your application, creating a new class file. If you
> >want
> >> >to call a Web service anywhere on the Internet, all you'll need to do
> is
> >> >create a new instance of the Web service class and call its exposed
> >> >methods."
> >> >
> >> >Can someone who has worked with this describe how you get the icon
> >> >representing the web service into your project? How do you add the
> >> >reference? Also, is the recognition of the exposed class methods
> >automatic?
> >> >That is, if I were to do (something like) this:
> >> >
> >> > Dim oWebSvc as cWebSvc
> >> > Set oWebSvc = New cWebSvc
> >> > oWebSvc.
> >> >
> >> >will the exposed methods and properties appear automagically in the
> >editor
> >> >when I type the "." after "oWebSvc" on line 3?
> >> >
> >> >Finally, is the reference to the web class valid when the app that
uses
> >> the
> >> >class is deployed, or does the reference have to be changed? That is,
> >does
> >> >the developer, who is intending to deploy an application for use at
some
> >> >remote location, have to take into account the URL/path that the
remote
> >> >location would use to reach the particular web service? Let me try to
> >make
> >> >that clearer. The developer might see the web service class as
residing
> >> in
> >> >a directory on his internal server; does he have to "exit" his local
> >domain,
> >> >and go back into his server via the internet/HTTP, when creating the
> >initial
> >> >reference to the web class?
> >> >
> >> >Thanks
> >> >Tim Romano
> >> >
> >> >
> >> >
> >> >
> >> >
> >> >
> >> >
> >> >
> >> >
> >> >
> >>
> >
> >
>
Re: using Web Service classes
Hi Larry,
I have not been able to get this it work.
I picked a Web Service to try
http://services3.xmethods.net/dotnet...mperature.asmx
I am on Win98 SE with Beta 1 VB
I access the internet through a DSL line through a proxy server that is NOT
..Net enabled.
I started a Windows App and added a Web Reference.
Then in a button click...
Dim x As New net.xmethod.services3.Temperature
Dim y As Single
y = x.GetTemp("77532") 'GetTemp returns the temperature for a zip code
Intellisense was working and I receive no errors but y is zero.
What am I missing?
"Larry Schaeffer" <llschaeffer@prodigy.net> wrote in message
news:3adc62d3$1@news.devx.com...
>
> In the few samples that I have done, I have added the Web Service by using
> the "Add Web Reference" Wizard to add the reference. When you add the
reference,
> a stub/proxy class is created that identifies the methods exposed by the
> service. This class becomes part of your project. Whenever you create an
> object of the type of the Web Service then you are actually creating an
instance
> of the proxy. The proxy class methods actually communicate with the
service
> itself. This does enable intellisense for the object once you declare it.
> HTH
>
> PS. In VB.Net you can DIM and SET in the same line.
> Dim oWebSvc as New cWebSvc()
>
> As a matter of fact if you type SET into the IDE, it removes it as a
simple
> assignment to the New Constructor is used to create objects.
>
> Larry Schaeffer
>
Re: using Web Service classes
> I have not been able to get this it work...What
> am I missing?
Mary: Please post "how-to" questions to the vb.dotnet.technical newsgroup.
Thanks!
---
Phil Weber
DevX Newsgroup Admin