Web Service Problem

S

Sunil Sabir

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/ReturnEvents/Service1.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/ReturnEvents/Service1.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
 
D

Dan Rogers

Hi Sunil,

You shouldn't be using WSDL.exe to move a service to a different server.
Instead, after you get the server ready to run the applicaiton (e.g.
install IIS, install the .NET Framework server components), you should
publish your service implementation to the server.

The service itself is unaware of it's address. It's just code, running on
a server.

To publish, open your project in Visual Studio, and after it is loaded, use
the Publish option on the File menu to publish the right files to the
server.

Once the service is moved, the code that calls the client side proxy should
use a configuration setting to change the server/service address. If you
change the proxy property to "dynamic", you can then change the URL setting.

I hope this helps

Dan Rogers
Microsoft Corporation
--------------------
 
E

erymuzuan

if you look at the proxy again there's a property called URL, it's the
web service endpoint, now every time you move the service address all
you should do just change this property either directly in the proxy
file all the calling code

Mywebservice svc = new myWebService();
svc.Url = ConfigurationSetting.AppSettings["MyWebSerice.Url"];

The reason why you're getting error 404 , my guess would be the
"ReturnEvents" virtual directory is not configured at all or incorrectly
pointing to wrong folder

actually you can place the service1.asmx in wwwroot directory and the
dll in wwwroor\bin and all you have to is change the proxy Url to
http://www.hop.man.ac.uk/Service1.asmx

Regards
Erymuzuan Mustapa
 

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,995
Messages
2,570,228
Members
46,818
Latest member
SapanaCarpetStudio

Latest Threads

Top