问题
My web service is hosted in IIS on my server, when i try to download the metadata of the service it gives me an error: The remote name could not be resolved: win2008x64 (server name). On server, i have 2 bindings, one http, the other one is https..
How can i resolve this issue?
EDIT:
The document was understood, but it could not be processed.
- The WSDL document contains links that could not be resolved.
- There was an error downloading 'http://win2008x64:1668/Service.svc?xsd=xsd0'.
- The remote name could not be resolved: 'win2008x64'
Metadata contains a reference that cannot be resolved: 'http://89.x.x.x:166x/Service.svc?wsdl'.
Metadata contains a reference that cannot be resolved: 'http://89.x.x.x:166x/Service.svc?wsdl'.
If the service is defined in the current solution, try building the solution and adding the service reference again.
Thank in advance.
回答1:
I used WcfExtras (how to use) project on codeplex to deal with this kind of issue. This is also useful if your server is behind a proxy of some kind. You need only to define a location attribute and override the url to your service:
<endpointBehaviors>
<behavior name="Sample.WsdlSampleEndpointBehavior">
<wsdlExtensions location="http://127.0.0.1/Sample/WsdlSample.svc" />
</behavior>
</endpointBehaviors>
回答2:
try generating the wsdl using the ip address of your server. If it is a public server use the external ip (whatsmyip.org), could be just a Dns issue.
来源:https://stackoverflow.com/questions/6855702/wcf-web-service-metadata-contains-computer-name