Khi tôi thử kiểm tra AutoLotWCFService bằng cách sử dụng "wcftestclient", tôi nhận được lỗi sau. Tôi đang làm gì sai? Bất kỳ cái nhìn sâu sắc sẽ giúp đỡ. Đây là một dịch vụ Web đơn giản có wshttpbinding với giao diện hợp đồng và việc thực hiện trong dịch vụ. Đây là thông báo lỗi dài: Tệp Web.Config có 2 điểm cuối - một cho chính Dịch vụ Web và một cho metaDataExchange. Tất cả các công cụ mặc định của nó khá nhiều. Tôi có thể bao gồm mã nếu cần - có vẻ như tôi không thể đính kèm tệp tại đây.Lỗi WCF bằng WCFTestClient để kiểm tra một Dịch vụ Web WCF đơn giản
Error: Cannot obtain Metadata from http://localhost/AutoLotWCFService/Service.svc
If this is a Windows (R) Communication Foundation service to which you have access, please check that you have enabled metadata publishing at the specified address.
For help enabling metadata publishing, please refer to the MSDN documentation at http://go.microsoft.com/fwlink/?LinkId=65455.
WS-Metadata Exchange Error
URI: http://localhost/AutoLotWCFService/Service.svc
Metadata contains a reference that cannot be resolved: 'http://localhost/AutoLotWCFService/Service.svc'.
The remote server returned an unexpected response: (405) Method not allowed.
The remote server returned an error: (405) Method Not Allowed.
HTTP GET Error URI: http://localhost/AutoLotWCFService/Service.svc
The document at the url http://localhost/AutoLotWCFService/Service.svc was not recognized as a known document type.The error message from each known type may help you fix the problem:
- Report from 'DISCO Document' is 'Name cannot begin with the '%' character, hexadecimal value 0x25. Line 1, position 2.'.
- Report from 'WSDL Document' is 'There is an error in XML document (1, 2).' -Name cannot begin with the '%' character, hexadecimal value 0x25. Line 1, position 2.
- Report from 'XML Schema' is 'Name cannot begin with the '%' character, hexadecimal value 0x25. Line 1, position 2.'.
Bạn có thể bao gồm các phần cấu hình liên quan đến dịch vụ không? Thật khó để nói mà không có những gì đang xảy ra. – Bryant
Hợp đồng dịch vụ (và bất kỳ hợp đồng dữ liệu nào được sử dụng) cũng sẽ hữu ích. –
Thêm cấu hình này vào cấu hình web máy chủ của bạn theo được chỉ định, sau đó sẽ cung cấp lỗi thực: –