.asmx files vs .aspx

P

phoenix.cbe

Hi All,
I heard a scenario from my friend who tells me that they
discourage the use of .asmx files to return XML data (AJAX), instead
they ask him to write it as .aspx page. The reason he was told, was
that .asmx services perform a tad slower than their .aspx counterparts.


Is there any truth to this statement. I did a lot of googling, but
found no fact substantiating this statement. Any light on this issue
would be appreciated.

Thanks
RK
 
S

Scott M.

..asmx files are exclusively for exposing web services (not AJAX and not just
strings of XML data).
..aspx files are exclusively for exposing a user interface (a web page).
One is not a counterpart of the other, they each have specific purposes that
are different from the other.

Web pages can return XML, but that is not the same thing as a web service.
Web services are classes that can be instantiated and uses remotely over
http.
 
P

phoenix.cbe

Let me rephrase the question, I think I was not being clear.

Say I want to return an XML stream(strings of XML data) which one
should I use.

I have seen a lot of scenarios where .asmx service returns a customized
xml string not just object's XML (Business needs)

Thanks
RK
 
S

Scott M.

It's not really a matter of which one to use for returning XML, that's not
the point. They both can return XML.

It's a matter of how you want to ask for that XML string in the first place.
..aspx pages can take an input argument that is passed to it via a
querystring or form submission and return some XML as its response, or it
can just return some XML as its response without you passing anything to it
at all. But, when you work this way, you are not using a formalized
Object-Oriented way or standardized XML way of asking for and receiving your
XML.

But, web services (.asmx) files are OBJECTS that expose functions via the
web. If you wish to be able to remotely instantiate one of these objects so
that you can call one of its functions, you need a web service (.asmx file).
This is a much more OO way of doing things as well as following XML
standards. Not to mention, that web services offer other benefits that
simple web pages don't like the ability to query a server to see what
services it offers and a more robust form of securing your services.

Both require processing on the server and both will return XML. Speed isn't
really going to be much of a factor if you are talkng about returning the
same XML (more or less) in each case.
 

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

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,009
Latest member
GidgetGamb

Latest Threads

Top