Wrox Programmer Forums
Go Back   Wrox Programmer Forums > .NET > Other .NET > .NET Web Services
|
.NET Web Services Discussions about .NET XML Web Service technologies including ASMX files, WSDL and SOAP.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the .NET Web Services section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old July 17th, 2004, 09:45 AM
Registered User
 
Join Date: Jul 2004
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default I am NewBies. Please Help


Dear All,

I am currently learning to develop a web service and use it on web application. I have builded a very simple web service that will return a string with length of 5. User can enter any character and will be cut or pad to length of 5.

I also develop a web application. When i try to import the namespace
'<%@ import namespace="http://tempuri.org" %> error message occur.

would someone please kindly tell me how can i use the web service i created? i have the ddl with me.

I am very new to webservice and would like to know more, but the books i bought does not help much.

I also try to put the import statement on the .vb file instead of the .aspx but it turn out to be error also.

Somebody, please help.

thanks in advance.

Best Regards
Hendrik

 
Old July 18th, 2004, 02:29 PM
planoie's Avatar
Friend of Wrox
 
Join Date: Aug 2003
Posts: 5,407
Thanks: 0
Thanked 16 Times in 16 Posts
Default

You say you have the "ddl" with you. Do you mean the DLL? And if so, it sounds like you might be misunderstanding how you use (or "consume") a web service.

A web service is a service that is accessed over the web. You call it via HTTP. It replies via HTTP with XML. You don't access it by means of a DLL. Even though you may have created the web service yourself, and you have the compiled DLL, you must still access it via a web server, otherwise you aren't using it as a web service. If you access the web service class' methods (which are also WebMethods) by using the compiled DLL you are bypassing the web service part of the whole thing and calling it as if it were just another class in your program.

Usually in the .NET world, what you do is reference the web service in Visual Studio. (You use a "web reference" versus a regular assembly reference.) Visual Studio accesses the web service's WSDL (which describes the web service, what goes in and what comes out) and it then builds a local wrapper class. This allows you to use the web service from your program without the need for you to manually write the HTTP calls to the service. Visual Studio builds the methods into a local class that ends up looking just like the methods on the web service class. Then you can call these methods programmatically and this class handles all the HTTP calls and XML handling behind the scenes.

If you are not using visual studio, then you need some other tool to create this class file. The .NET Software Developer Kit has a wsdl tool, but this may only come with Visual Studio. I honestly don't know if and how you would do this with only the framework.

Once you have this wrapper class code created you can include it with other code you are compiling or compile it into its own assembly and reference that assembly. Then you can use the class methods as you would any other class. It just happens that this class is making calls to and "consuming" a web service. The great thing is that from the calling program it looks like just another class call.
 
Old July 18th, 2004, 11:18 PM
Registered User
 
Join Date: Jul 2004
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Dear planoie,

Thank for the reply. Yes, What I means is DLL. I also thought that if I use DLL, that does not make any big difference between Web Service and usual Class.

I develop the simple web service myself. Do we need to have .vb file in order for us to use the Web Service.

I have try to do web Reference, but error message is occur, saying that the class does not exist.

Would you mind to let me know how can i solve this?

Regards
Hendrik

 
Old July 19th, 2004, 08:46 AM
planoie's Avatar
Friend of Wrox
 
Join Date: Aug 2003
Posts: 5,407
Thanks: 0
Thanked 16 Times in 16 Posts
Default

Once you have compiled the code for a web service, you will not need the .vb file(s) to actually run it. All the code will be compiled to the DLL. You need only the ASMX file and the corresponding DLL in the web application's /bin folder.

How are you trying to reference the web service? Have you tried referencing a known web service outside of your environment just to confirm you are using the right process?
 
Old July 20th, 2004, 05:43 AM
Registered User
 
Join Date: Jul 2004
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi,

I have found the answer.

Thanks :D :)

Best Regards
Hendrik






Similar Threads
Thread Thread Starter Forum Replies Last Post
Resource Primer for Newbies dparsons Intro Programming 0 March 2nd, 2007 12:56 PM
C++ tutorial for the newbies out there!!! mastrgamr C++ Programming 1 December 18th, 2006 08:32 AM
FREE: rankin project for PHP/MySQL newbies gleonard Beginning PHP 1 April 10th, 2006 10:30 AM
an applet for newbies freezotic BOOK: Beginning Java 2 2 June 7th, 2004 09:22 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.