1

We have one service reference in one project of a solution. I am trying to move this service reference to new project in same solution. But adding the service reference in new project using URL present in the service reference of old project is throwing 404 error. I am not sure where is this service hence do not have it my IIS.

I tried to copy all the files and adding them to source control. like copy paste but then it has some auto generated code under reference.cs which generates all classes. They have old namespaces and might have to change it to new namespace manually. So, not sure if this can cause some other issue as I will be manually updating the auto generated code.

Is there a way to add this service reference in my new project?

Vicky
  • 624
  • 2
  • 12
  • 35
  • [This](https://stackoverflow.com/questions/19675194/is-possible-to-access-wcf-service-without-adding-service-reference) might help. If you have the endpoint address and the service interface you can create your client code from only that. You can also use Windsor's WCF facility - it creates the proxy for you. – Scott Hannen Jul 12 '17 at 02:21

1 Answers1

0

option 1 - find the url by debugging the first project

Assuming that the first project accesses the WCF service correctly, you can debug it to the point where it makes the service call and look at the the remote address in the watch

var url = currentProxy.Endpoint.Address.Uri;

option 2 - add reference to the project thats already working

add a wrapper class that makes the WCF call in your original project and then add project reference of your original project to the new project. now you can you use the newly created wrapper to access the WCF service from the new project via the wrapper

Dhawalk
  • 1,257
  • 13
  • 28