Wednesday, March 28, 2012
Web service
I`m very much new to VB.NET
Can anyone will explain me the concept of Web Service and its application.
Any example code is welcome.
Anita.there's a brief description and a brief example on my website www.vb-tech.com, or have a look at http://www.dotnetjohn.com/webservices.aspx which is a good all round website as well.
Nick
Thanks nswan,
Can anyone will tell@.me What is the difference between
Web service and Web Form?
Or we can use only Web Forms to creat a web service?
Anita
A web form is a pretty way to say a web page. That is all. A web form is something you can navigate to in your browser and view just like any other html page on the internet.
A web service is like a object you put on the internet for other applications to use (or just your apps, whatever you like). Basically, it only applies to application developers, normal end users shouldn't have a need for them. What they do is expose some methods that you can call from your applications (windows, or web) as if you were calling a method on a object in your project, even though the web service lies on another server.
(Hypothetical situation:)
Lets say FED EX wanted to expose a web service to allow programmers to access their information to display in their own applications. I could build a application for my company that sits in the system tray or something that would allow the users at my business to click it, enter a tracking number, and get the tracking results back. What would happen behind in the code would be I would take that tracking number, and pass it as an argument to a web service method that FED EX exposed. The return for that function would be the tracking data that I would then display on the form.
Hope that helps you.
Example
You have a web site (site A) which give news to its visitors, so that your site has three sections: sports,national and culture news.
But the sports news come from another company, suposse site B, and the same for the other kind of news, site C for national news and site D for culture news.
So each site has its own information in its database, but you need to extract this information to your site, how can you do it?
Well, each site (i.e. site B,C,D) has a web service echa one which its principal function is to provide the information you need; not just you could extract the information but other companies, trought a web service client.
In general a web service is a function which you call, but this function is in other web site.
Saturday, March 24, 2012
Web Service Problem
I have written a Web Service which is called from ASPX file(Web Form). It
works fine on the local machine. On the local machine I am using the
following command
wsdl.exe /l:cs http://localhost/ReturnEvents/Service1.asmx?wsdl
Now I want to use the same service on the Remote Server. What I think is
that the
above path should be changed as it is localhost. So I try to do something
like this
wsdl.exe /l:cs http://www.hop.man.ac.uk/ReturnEven...vice1.asmx?wsdl
where www.hop.man.ac.uk is the server where I am trying to host my web service
But it does not compile and throws the following error:
There was an error downloading:
http://www.hop.man.ac.uk/ReturnEven...vice1.asmx?wsdl
The request failed with HTTP status 404: Not Found
I dont know whether I going in a right direction. It works fine on the
client machine
But on the server when I change the path to my server name it throws this
error.I mean we cant use localhost in the wsdl when using Web service on the
REMOTE server. Dont know what to do. Any help would be greatly appreciated.
Cheers,
Sunil SabirCheck your spelling. The 404 error indicates that the requested resource
(URL) was not found.
--
HTH,
Kevin Spencer
..Net Developer
Microsoft MVP
Neither a follower
nor a lender be.
"Sunil Sabir" <SunilSabir@.discussions.microsoft.com> wrote in message
news:AC4B5CFD-DFFB-4990-A131-B71795B5ABB5@.microsoft.com...
> Dear All,
> I have written a Web Service which is called from ASPX file(Web Form). It
> works fine on the local machine. On the local machine I am using the
> following command
> wsdl.exe /l:cs http://localhost/ReturnEvents/Service1.asmx?wsdl
> Now I want to use the same service on the Remote Server. What I think is
> that the
> above path should be changed as it is localhost. So I try to do something
> like this
> wsdl.exe /l:cs http://www.hop.man.ac.uk/ReturnEven...vice1.asmx?wsdl
> where www.hop.man.ac.uk is the server where I am trying to host my web
service
> But it does not compile and throws the following error:
> There was an error downloading:
> http://www.hop.man.ac.uk/ReturnEven...vice1.asmx?wsdl
> The request failed with HTTP status 404: Not Found
> I dont know whether I going in a right direction. It works fine on the
> client machine
> But on the server when I change the path to my server name it throws
this
> error.I mean we cant use localhost in the wsdl when using Web service on
the
> REMOTE server. Dont know what to do. Any help would be greatly
appreciated.
> Cheers,
> Sunil Sabir
>
>
Web Service Problem
I have written a Web Service which is called from ASPX file(Web Form). It
works fine on the local machine. On the local machine I am using the
following command
wsdl.exe /l:cs http://localhost/ReturnEvents/Service1.asmx?wsdl
Now I want to use the same service on the Remote Server. What I think is
that the
above path should be changed as it is localhost. So I try to do something
like this
wsdl.exe /l:cs http://www.hop.man.ac.uk/ReturnEven...vice1.asmx?wsdl
where www.hop.man.ac.uk is the server where I am trying to host my web servi
ce
But it does not compile and throws the following error:
There was an error downloading:
http://www.hop.man.ac.uk/ReturnEven...vice1.asmx?wsdl
The request failed with HTTP status 404: Not Found
I dont know whether I going in a right direction. It works fine on the
client machine
But on the server when I change the path to my server name it throws this
error.I mean we cant use localhost in the wsdl when using Web service on the
REMOTE server. Dont know what to do. Any help would be greatly appreciated.
Cheers,
Sunil SabirCheck your spelling. The 404 error indicates that the requested resource
(URL) was not found.
HTH,
Kevin Spencer
.Net Developer
Microsoft MVP
Neither a follower
nor a lender be.
"Sunil Sabir" <SunilSabir@.discussions.microsoft.com> wrote in message
news:AC4B5CFD-DFFB-4990-A131-B71795B5ABB5@.microsoft.com...
> Dear All,
> I have written a Web Service which is called from ASPX file(Web Form). It
> works fine on the local machine. On the local machine I am using the
> following command
> wsdl.exe /l:cs http://localhost/ReturnEvents/Service1.asmx?wsdl
> Now I want to use the same service on the Remote Server. What I think is
> that the
> above path should be changed as it is localhost. So I try to do something
> like this
> wsdl.exe /l:cs http://www.hop.man.ac.uk/ReturnEven...vice1.asmx?wsdl
> where www.hop.man.ac.uk is the server where I am trying to host my web
service
> But it does not compile and throws the following error:
> There was an error downloading:
> http://www.hop.man.ac.uk/ReturnEven...vice1.asmx?wsdl
> The request failed with HTTP status 404: Not Found
> I dont know whether I going in a right direction. It works fine on the
> client machine
> But on the server when I change the path to my server name it throws
this
> error.I mean we cant use localhost in the wsdl when using Web service on
the
> REMOTE server. Dont know what to do. Any help would be greatly
appreciated.
> Cheers,
> Sunil Sabir
>
>
>
>
Monday, March 12, 2012
Web Services Not Working
Dear Gurus:
On my local computer I am running IIS 5.0 and I have written a web service, and I have put all relevant files in my local inetpub/wwwroot folder and my web service works fine. I get the proper asmx interface.
But when I move the relevant web service files to a server running IIS 6.0 and open IE and put in the correct URL all I get is the following line of text at the top of my page in IE:
<%@dotnet.itags.org. WebService Language="c#" Codebehind="SalesReport.asmx.cs" Class="SalesReportWebService.SalesReport" %>
My web service was written and compiled with VisualStudio.net.
Yes, I have added my .dll as an allowed web service extension.
Do I have to register my web service somewhere? Any idea what might be going wrong?
Thank you in advance,
Kailin.
OK I have now fixed this problem.
The problem was somebody had modified the machine.config file on the computer where the web service was not working. The <httphandlers> section that setasmx as a recognized file type in themachine.config file was removed rendering the web service inoperable. I have now replaced the broken machine.config file with a default machine.config file and this fixed the problem.
Thank you to anyone who took some time to look into this issue.