Error trying to add a link to a service

I am trying to create a client in C # for a web service that is (I suppose) written in Java. This is my first time trying to write a client, so I am following the instructions on MSDN, but I am facing a problem with adding a link. When I open the Add Service Reference dialog and add the url, an error occurs:

There was an error downloading 'http://geoportal.cuzk.cz/WCTService/WCTService.svc'.
The request failed with HTTP status 404: Not Found.
Metadata contains a reference that cannot be resolved: 'http://geoportal.cuzk.cz/WCTService/WCTService.svc'.
There was no endpoint listening at http://geoportal.cuzk.cz/WCTService/WCTService.svc that could accept the message. This is often caused by an incorrect address or SOAP action. See InnerException, if present, for more details.
The remote server returned an error: (404) Not Found.
If the service is defined in the current solution, try building the solution and adding the service reference again.

      

What should be my next step? I don't know what to do with this! (This is a coordinate transformation service from the Czech Republic.)

For more information:
Real Estate Services (GetCapabilities) http://geoportal.cuzk.cz/WCTService/WCTService.svc/get ?

Localization services: http://geoportal.cuzk.cz/WCTService/WCTService.svc/get?request=GetCapabilities&service=WCTS

+3


source to share


5 answers


I ran into a similar situation where I created a WCF service (Employee.svc) and then changed the name to EmployeeService.svc. The WCF project compiled just fine, but when I tried to add a service reference from the UI Client I was getting the following error:

Metadata contains a reference that cannot be resolved: 'http://localhost:2278/EmployeeService.svc?wsdl'.
The document format is not recognized (the content type is 'text/html; charset=UTF-8').
Metadata contains a reference that cannot be resolved: 'http://localhost:2278/EmployeeService.svc'.
There was no endpoint listening at 'http://localhost:2278/EmployeeService.svc' that could accept the message. This is often caused by an incorrect address or SOAP action. See InnerException, if present, for more details.
The remote server returned an error: (404) Not Found.
If the service is defined in the current solution, try building the solution and adding the service reference again.

      

I resolved it by replacing the correct service class name all over the place. In my case it should have been EmployeeService and NOT employee. The remaining space was in the svc file markup code:

<%@ ServiceHost Language="C#" Debug="true" Service="WCFServiceHost.**Employee**" CodeBehind="EmployeeService.svc.cs" %>

      



Changed to

<%@ ServiceHost Language="C#" Debug="true" Service="WCFServiceHost.**EmployeeService**" CodeBehind="EmployeeService.svc.cs" %>

      

And it started working again !!! Don't forget to create your WCF project after changing the service name.

+3


source


I've tried browsing http://geoportal.cuzk.cz/WCTService/WCTService.svc?wsdl

. It looks like this service does not expose metadata.

I've done a bit of work on OpenGIS and I think you need to take a look at this article:

OpenGIS with .NET



You can't just add a link to the service and go. It looks like you need to create a specific WSDL.

There might be a client side library that you can use / customize to help with the integration. Have a look at the question on Stack Overflow Using MySQL GeoSpatial Data Types in .NET .

+2


source


Is the service definitely up and running before trying to add a link to the service? If it provides metadata, does it have service behavior or an equivalent? Have you configured your firewall correctly?

0


source


When you add a service link to a client application, the metadata is not available from the service to the client application. so the remote server returned an error: (404) Not Found. We can actually host the WCF service like this:

  • Self-hosting (console application)
  • Hosting IIS
  • Hosting WAS
  • Windows hosting services.

if you are using self-hosting you need to host the service in a console application and start the service (start the console application) and then add the service reference to the client application and then the metadata will be exchanged. If the service is not running, then adding a service reference to the client application will get a 404 error. The same process will be followed for all hosting types. start the service first, then add the service link.

0


source


Web services will not start.

If you do not have access to the server that is running this service, you are locked out.

Otherwise, you need to check if the server is running, etc. Since I do not know how Java Web Service works, I cannot help you.

-1


source







All Articles