What is needed for a web service

  • Thread starter Thread starter TonyJ
  • Start date Start date
T

TonyJ

Hello!

I know this is the wrong forum for this question but I think many of you can
answer this easy question.

I have read about web services and I wonder one thing and that is what file
must be put on the web server?
Is it both the asmx file and the code-behind file that must be stored web
server. Must these two be put in the same place?

What is the purpose of the asmx file?

//Tony
 
TonyJ said:
I know this is the wrong forum for this question but I think many of you can
answer this easy question.

I have read about web services and I wonder one thing and that is what file
must be put on the web server?
Is it both the asmx file and the code-behind file that must be stored web
server. Must these two be put in the same place?

What is the purpose of the asmx file?

Obviously you need all the stuff needed to run the web service.

An .asmx with both declaration and inline code *or* an .asmx and
some source code *or* an .asmx and a dll.

Rules on where to place files are similar to other ASP.NET stuff.

And then there are WCF ....

Arne
 
And then there are WCF ....

In WCF, I'm taking an approach I quite like. I've got my Contracts /
Interfaces / Messages defined in a standard .Net DLL. This lets me write
Unit Tests, and do all the other basic stuff. I then build host projects to
host it where I need.

To expose the service through IIS, I create a Web Project, and add in an
".svc" file that looks like:

<%@ ServiceHost Language="C#" Debug="true"
Service="MyStuff.Services.MyService1"%>

That's the sum total of the "expose to IIS" that has to go in there. The
reference to MyService1 is found in the config file:
<services>
<service name="MyStuff.Services.MyService1">
...
</service>
</services>

I then deploy to IIS the .scv file, the config file, and the DLL's that
contain my WCF classes.

It's really quite slick, and (in my opinion) a big jump forward over what
Web Services have been in the past. It no longer feels like a big ugly mess
that's going to be unmatinainable in the long-term.
 

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

Back
Top