WCF web service metadata contains computer name

北城以北 提交于 2019-12-25 01:19:54

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!