Creating proxy for using Webservice locally

A

Anitha

i have developed a web service for converting temperatures in to Celsius and
Fahrenheit. The web service is working fine.
I want to use this web service in a web page and windows form locally .
can anyone help me for this. please give the whole steps for doing this.

I know i have to create a .dll file using WSDL and all other stuff.
thanks and regards
 
M

Martin Honnen

Anitha said:
i have developed a web service for converting temperatures in to Celsius and
Fahrenheit. The web service is working fine.
I want to use this web service in a web page and windows form locally .
can anyone help me for this. please give the whole steps for doing this.

I know i have to create a .dll file using WSDL and all other stuff.

You can generate the source code of a proxy class using e.g.
wsdl.exe URLToWSDLDescriptionOfWebService
Then you can compile that source code into a dll.
If you use Visual Studio then it simplifies your work by allowing you to
add a reference to the web service and doing the rest automatically.
 
A

Anitha

Martin Honnen said:
You can generate the source code of a proxy class using e.g.
wsdl.exe URLToWSDLDescriptionOfWebService
Then you can compile that source code into a dll.
If you use Visual Studio then it simplifies your work by allowing you to
add a reference to the web service and doing the rest automatically.


Hi Martin,
I have created the proxy class using this
wsdl.exe http://localhost/TempConversion/TempConversion.asmx?WSDL

then this creates a .cs file called as TempConversion.cs
this .cs file is created in c:/ directory..

after this i am required to create a .bat file to convert source file into
an assembly or dll.
this part i am not getting. I unable to create a .dll file . can u please
tell the steps to create a dll file and how to use this dll file in my
ASP.Net page...
 
S

Simon Hart

Anitha,

You can use the command-line tool csc.exe ie:

csc /out:TempConversion.dll /target:library TempConversion.cs

Or as pointed out in a previous post, it is easier to right click "Web
References" and navigate to your Web Service as VS.NET 2003 and 2005 will
create
the proxy class and compile it etc for you. However sometimes WSDL.exe is
required when changing namespaces or if you want to crreate types can are
easily added to
multiple projects etc.

As mentioned, if you want the type, then add the generated .cs file to a
class library within VS.NET as it is soooo much easier than the method
above. This all depends
on your requirements though.

Regards
Simon.
 
A

Anitha

Hi Simon,
Thanks for ur Reply,
I have created the .dll file as u mentioned below. then i have placed that
..dll file in the bin directory of the asp.net page. say i have created an
asp.net application called TempConversionClient. The page is
TempConversionClienct.aspx.

I have placed the TempConversion.dll file the bin directory of the
TempConversionClient.

The namespce is not show in the intellisence of the client project while
trying to use the NameSpace " TempConversion"
One more thing i have webservice name and the class name same for the
webservice that i have created ..
thanks.
 
S

Simon Hart

You need to add the DLL you created to the "References" under your ASP.NET
project. The class/namespace will then show in intelisense.

Regards
Simon.
 
A

Anitha

Thanks Simon.
I am able to o it.

Simon Hart said:
You need to add the DLL you created to the "References" under your ASP.NET
project. The class/namespace will then show in intelisense.

Regards
Simon.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,995
Messages
2,570,236
Members
46,821
Latest member
AleidaSchi

Latest Threads

Top