Renaming a WCF service hosted on IIS - wcf

I have renamed a WCF service and everything works just fine on my test/development environment. However, the service is not accessible on my production environment, which is IIS. When trying to access the service the client receives roughly the following error:
The request failed with the error: The type Old_Service_Name.Some_Type could not be found.
In other words, IIS should be informed about the renaming of the service. How do I tell IIS, preferably using IIS Manager, that the service has a new name?

In the service.svc file, change the Service attribute of the ServiceHost tag so that it suits your new service name. Namely, replace Old_Service_Name.Some_Type with New_Service_Name.Some_Type.

Related

Cannot connect to WCF Web Service Reference in DotNet Core 3.1

There is an issue for connecting to my WCF service from dotnet core 3.1 . For adding service reference I'm using Add Connected Service and then enters WCF URI http://10.10.10.10:8330/mywcfservice. If I enter the remote address as I said before it works fine and server asks for authenticate my request. but after I entered my credentials, in status box it said:
An error occurred while attempting to find services at '10.10.10.10/mywcfservice'. The remote server returned an error:(400) Bad Requst.
If I add / after WCF URI, in status box it said:
An error occurred while attempting to find services at '10.10.10.10/mywcfservice/'. The remote server returned an error:(401) Unauthorized.
I tested my WCF Service with WCF Storm and it works just fine. On the other hand I can connect to WCF Service from .Net Standard Project like a charm. So where is the problem?
Based on the information you provided, I cannot know what happened to your server. You can refer to this link to record the error that occurred on the server-side:
Trying to add a service reference results in Bad Request (400) in one project, otherwise runs fine
Another solution is to use dotnet-svcutil command:
Use a browser to access the WSDL file of the service, and then save it locally.
Then use the dotnet-svcutil command to generate the proxy class.
Finally, add the proxy class to the project.
To use the proxy class also need to add these two packages:
Call WCF service in core:
BasicHttpBinding binding = new BasicHttpBinding();
EndpointAddress endpointAddress = new EndpointAddress("http://localhost:8000/GettingStarted/CalculatorService");
CalculatorClient calculatorClient = new CalculatorClient(binding,endpointAddress);
Another thing to note is that there are some WCF functions that are not supported in core. For details, please refer to the link below:
WCF service works in MVC client but not in .Net Core 3 client
Feel free to let me know if the problem persists.

Questions about adding a WCF service to a Windows service assembly

I have found some basic information about hosting a WCF service in a Windows service, but not much. All of my experience thus far with WCF has been in Web projects. I have a few simple questions.
I have a project which creates a windows service application. I have done a right click -> add WCF Service. This creates Service1.cs and IService1.cs.
I'm wondering why no SVC file is created in this scenario? When I add services to Web projects i get an SVC file which I can navigate to and use to consume the service.
Adding the service adds some configurations to the app.config under the services element. I'm seeing a default base address of
http://localhost:8732/Design_Time_Addresses/WindowsServiceName.services/WCFServiceName/
What does this mean? It's sort of an odd looking address. Am I supposed to change it to whatever I want?
Navigating to this address in a browser results in an unable to connect message. Does the windows service itself have to be running to talk to the WCF service?
How do I go about consuming this service from another application without an svc file?
I'm taking a guess on this first one, but I'm thinking the .svc file when hosting in IIS is to tell IIS, "Hey I have a WCF service here, please handle accordingly".
The base address is as it should be and yes you can change it if I'm not mistaken.
You can't hit the WCF service unless the Windows service is running, which is one of the dangers of hosting in a Windows service, because if the service dies somehow your WCF service is offline until you get the Windows service running again.
You consume the service the same way you do any other WCF service, just using that base address to get at it.

How to configure the wcf service to view the test page without pointing to svc file in address box?

I have created a working wcf service. I have come a cross a page regarding wcf services
which describes the process for eliminating default wcf service page.
It is here https://github.com/geersch/WcfServiceMessage
Except for the things the author of this page is describing, I have one question.
How has he managed to configure the IIS or Web.config to host page with the address: http://localhost:8732/HelloWorld/ ?
At home, the only address I see my service at is: http://localhost:8732/MyServiceName.svc
(with svc extension)
How has he done it that the endpoint address: "HellowWorld" is used?
Thanks!
The WCF service endpoint is not actually a file. The total url itself is what the server recognizes as something to service, so the HelloWorld piece is just as good as HelloWorld.svc.
This is a difference between IIS hosted service and Windows or Visual Studio service host (cassini). In iis, you do have to specify a file that ends with svc and make that extension known. In iis you can also set a svc file as the default file to open if a specific directory is opened. that way you can achieve the same behavior.

Problem with call WCF Service From local host to Server IIS

Hi All
I Have a service project that hosted it in local IIS and within this project i have a refrence to another service in an IIS on another server in this Domain but when i want calling this service I get an exception:
{System.ServiceModel.Security.SecurityNegotiationException: The caller was not authenticated by the service.
How I Can Solve It?
thanks
Check with hosing by console.
Check Domain access for user or port restriction.
when you host then try checking whether it is generating wsdl by just typing http://.. in IE

Hosting WCF service in IIS

I am trying to host the service in IIS but I get Page Not found error.
Here is what I did to host in IIS
Created a WCF Service application (BillingService)
I have two classes called IBillSrv.cs (as Base) and BillSrvc.cs
Added a new WCFService website (BillSrvcSite) to the solution and added a reference to the above mentioned (BillingService).
In IIS created a new Virtual site and mapped it to BillSrvSite
Opened the Web.Config and changed the endpoint contract to IBillSrv
When I run it works fine in the WCF test client.
but when i paste the below url in IE I get page not found.
http://localhost/BillingService/BillSrvc/
I am using C# 2008
Can someone please advise what is missing or where I am going wrong?
This has nothing to do with persistence. An interface member like ParseTestQues can only be implicitly implemented by a public method. Simply make ParseTestQues be public.
Isn't your service endpoint named something like "BillSrvc.svc"? Try typing http://localhost/BillingService/BillSrvc/BillSrvc.svc into the browser and see what happens.