简体   繁体   English

向WinForm项目添加服务引用时出错

[英]Error Adding Service Reference to WinForm project

I want to consume a live service in my project but when I tried to add its reference, following error came: 我想在我的项目中使用实时服务,但是当我尝试添加其引用时,出现以下错误:

The document at the url https://exdev.www.property24.com/Services/P24ListingService19.asmx was not recognized as a known document type.
The error message from each known type may help you fix the problem:
- Report from 'XML Schema' is 'The root element of a W3C XML Schema should be  and its namespace should be 'http://www.w3.org/2001/XMLSchema'.'.
- Report from 'DISCO Document' is 'Discovery document at the URL https://exdev.www.property24.com/Services/P24ListingService19.asmx could not be found.'.
  - The document format is not recognized (the content type is 'application/xhtml+xml; charset=utf-8').
- Report from 'WSDL Document' is 'There is an error in XML document (3, 2).'.
  -  was not expected.
Metadata contains a reference that cannot be resolved: 'https://exdev.www.property24.com/Services/P24ListingService19.asmx'.
Metadata contains a reference that cannot be resolved: 'https://exdev.www.property24.com/Services/P24ListingService19.asmx'.
If the service is defined in the current solution, try building the solution and adding the service reference again.

The Service URL can be browsed that is: https://exdev.www.property24.com/Services/P24ListingService19.asmx 可以浏览服务URL: https//exdev.www.property24.com/Services/P24ListingService19.asmx

I tried to add that web service reference under "Service References" but that was giving the above error 我试图在“服务引用”下添加该Web服务引用,但是这给出了上述错误 .

The problem was that the Web Service was old so i managed to get its working reference by going to the "Advance" of Service Reference and adding it as "Web Reference". 问题是Web服务已经过时了,所以我设法通过转到服务参考的“高级”并将其添加为“Web参考”来获得其工作参考。 As Web Reference can cope with old services. 由于Web Reference可以应对旧服务。 It worked for me, hope it also will work for you! 它对我有用,希望它也适合你!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM