첫 번째 WCF 서비스를 만들려고합니다. 문제가 있습니다. 구조체, 클래스 및 몇 가지 메소드를 작성했습니다. 내 서비스 계약은 다음과 같습니다wcf 서비스가 작동하지 않습니다. 서비스를 추가하지 못했습니다.
는 서비스를 추가하지 못했습니다 : 나는 Visual Studio에서 테스트 클라이언트를 사용하여 실행하면
using System; using System.Collections.Generic; using System.Linq; using System.Runtime.Serialization; using System.ServiceModel; using System.Text; namespace WebshopReports { // NOTE: You can use the "Rename" command on the "Refactor" menu to change the interface name "IReports" in both code and config file together. [ServiceContract] public interface IReports { [OperationContract] List<Category> getReportCategories(string dir); [OperationContract] List<CReport> getReportList(Category category); } }
, 나는 다음과 같은 얻을. 서비스 메타 데이터에 액세스 할 수 없습니다. 서비스가 실행 중이고 메타 데이터가 노출되어 있는지 확인하십시오.
나는 web.config 파일과 관련이 있다고 확신한다. 그것은 아래에 있습니다. 내가 Web.config를 구성하는 방법을 잘 모르는 나처럼 누군가가 나를 도와 주시겠습니까 : 내가 구조체에 클래스에서 C 보고서를 변경하는 경우
<?xml version="1.0"?>
<configuration>
<system.web>
<compilation debug="true" targetFramework="4.0" />
</system.web>
<system.serviceModel>
<behaviors>
<serviceBehaviors>
<behavior>
<!-- To avoid disclosing metadata information, set the value below to false and remove the metadata endpoint above before deployment -->
<serviceMetadata httpGetEnabled="true"/>
<!-- To receive exception details in faults for debugging purposes, set the value below to true. Set to false before deployment to avoid disclosing exception information -->
<serviceDebug includeExceptionDetailInFaults="false"/>
</behavior>
</serviceBehaviors>
</behaviors>
<serviceHostingEnvironment multipleSiteBindingsEnabled="true" />
</system.serviceModel>
<system.webServer>
<modules runAllManagedModulesForAllRequests="true"/>
</system.webServer>
</configuration>
이상한 일입니다, 그것은 작동합니다.
아마도 내 솔루션을 잘못보고 있습니다. 매개 변수를 받아들이고 크리스탈 보고서를 실행하고 데이터를 반환하는 서비스를 만들고 싶습니다. 이 문제를 해결하는 가장 좋은 방법은 WSDL 서비스입니까? – Lock
여러 가지 방법이있을 수 있습니다. 웹 서비스가 올바른 솔루션인지 판단하기 위해 제약 조건을 평가해야합니다. 확실한 답을주기위한 요구 사항에 대해 충분히 알지 못합니다. 이는 원래 질문의 범위를 벗어납니다. –