이 WCF
서비스를 별도 프로젝트 이름으로 작성한 후이 프로젝트를 참조로 추가했습니다. 웹 사이트 프로젝트 이름은 웹 사이트 프로젝트의 web.config 파일에서 AaNuWsWCF 문제 : 기본 끝점을 찾을 수 없습니다.
입니다
<system.web>
<compilation debug="true" />
</system.web>
<system.serviceModel>
<behaviors>
<serviceBehaviors>
<behavior name="mexBehavior">
<serviceMetadata httpGetEnabled="True"/>
</behavior>
</serviceBehaviors>
</behaviors>
<services>
<service behaviorConfiguration="mexBehavior" name="AaWs.RxtraIntroService">
<endpoint address ="AaWs" binding="basicHttpBinding" contract="AaWs.IRxIntro">
</endpoint>
<host>
<baseAddresses>
<add baseAddress = "http://localhost:8080" />
</baseAddresses>
</host>
</service>
</services>
</system.serviceModel>
</configuration>
다음 내 웹 서버에이 웹 사이트 프로젝트를 업로드합니다.
는
나를 위해 만들어IntroService에 이름 공간 내 웹 사이트에서 새 app.config 파일을
http://mywebsite/IntroService.svc?wsdl
새로운 시스템을 나의 새로운 프로젝트에 서비스 참조를 제공
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<system.serviceModel>
<bindings>
<basicHttpBinding>
<binding name="BasicHttpBinding_IRxIntro" />
</basicHttpBinding>
</bindings>
<client>
<endpoint address="http://mywebsite/IntroService.svc/RecoverInfoTechAaWs"
binding="basicHttpBinding" bindingConfiguration="BasicHttpBinding_IRxIntro"
contract="IntroService.IRxIntro" name="BasicHttpBinding_IRxIntro" />
</client>
</system.serviceModel>
</configuration>
하지만 지금은이 서비스에 액세스하려고하면 오류가 발생합니다.
당신은의 app.config가 실행 파일과 루트 폴더에 있는지 확인해야이System.InvalidOperationException : 기본 엔드 포인트에게 ServiceModel은 서비스 클라이언트 구성 섹션에서 계약 'IntroService.IRxIntro'을 참조 요소를 찾을 수 없습니다. 응용 프로그램에 대해 구성 파일을 찾지 못했거나이 계약과 일치하는 끝점 요소를 클라이언트 요소에서 찾을 수 없기 때문일 수 있습니다.