1

I was asked to generate a consumer class of a webservice c# code(which was given to me), my consumer c# code must call all its functions, i followed c-sharpcorner link and successfully done it.

But here in this url place i added the url http://prntscr.com/9t8ihi which i obtained on running the visual studio c# web-service code at browser pop-UP.

It works fine for me and i sent it.

My mentor asked me replied that "there is a pb with the give code because the web service will not be localhosts".

EDIT On further research i found that i need to publish web service on IIS, If i am right ? For that i done following steps:

(1) Put the webservice project in C:\inetpub\wwwroot\WS_TNT

(2) Now open IIS manager and Add application by click right and give path of webserice and "Default Pool".

(3) When i publish it i get this error http://prntscr.com/9t8v4p , My webservice code is written in visual studio .net 4.5 version where i have done this

C:\Users\ACER>%windir%\Microsoft.NET\Framework\v4.0.30319\aspnet_regiis.exe -i  

Whats wrong i do ?

  • I'm think he means that the web service will not be running on the local machine (localhosts) and on a different machine. Ex: http://localhost:65083/ServiceA will instead run on http://app.site.com/ServiceA but on your code it's set to http://localhost:65083/ServiceA – John Ephraim Tugado Jan 22 '16 at 05:39
  • You'll have to replace the localhost service URL you used while developing in your clientapplication with a "productive" service URL. Meaning: The service must be hosted somewhere aside from your development machine so that your mentor can access it. – Jan Köhler Jan 22 '16 at 05:40
  • @ dear helper, please see the edit of question, as i understood i need to publish it on IIS. – traps traps Jan 22 '16 at 05:44

1 Answers1

0

When you added a reference to the web service, url is added as LocalHost:/some port in your web.config file.
Look for a section "Settings" where you will find the url as localhost. because you referenced it from there.

Host the web service somewhere In IIS. Get the URL & Replace in your web.config file.

Abdul Rehman Sayed
  • 6,532
  • 7
  • 45
  • 74