2011-08-05 1 views
3

Windows 응용 프로그램 내가"기본 끝점 요소를 찾을 수 없습니다 그 참조 계약"

로 오류가 무엇입니까의 제거 중에 웹 서비스를 호출하면 엔드 포인트 요소를 찾을 수 없습니다하지만 그 ServiceModel은 서비스 클라이언트 구성 에서 참조 계약 ServiceReference2.IService1 ' 섹션. 응용 프로그램에 에 대한 구성 파일을 찾지 못했거나 클라이언트 구성 요소에 이라는이 이름과 일치하는 끝점 요소를 찾을 수 없었기 때문일 수 있습니다.

저는 webservice 클라이언트를 호출하는 Installer 클래스를 사용하고 있습니다.

네임 스페이스 webMiner { [RunInstaller (참)] 공공 부분 클래스 demoInstaller : 설치 {= 새도록 SqlConnection 도록 SqlConnection CONN ("데이터 원본 = 서버 이름에 따라 installer.cs

소스 코드의 코드 ; 초기 카탈로그 = comp; 사용자 ID = abc; 비밀번호 = **; ");

public demoInstaller():base() 
    { 

     InitializeComponent(); 

     AfterUninstall += new InstallEventHandler(AfterUninstallEventHandler); 

    } 


    public override void Uninstall(System.Collections.IDictionary savedState) 
    { 
     base.Uninstall(savedState); 
     Int32 flag = -1; 
     string keyName = ""; 

      RegistryKey regeditkey = Registry.CurrentUser.OpenSubKey("sevenuser", RegistryKeyPermissionCheck.ReadWriteSubTree); 
     keyName = regeditkey.GetValue("currentuser").ToString(); 

      webMiner.ServiceReference2.Service1Client sc = new webMiner.ServiceReference2.Service1Client(); 

      flag = sc.unInstallOperation(keyName); 


    } 

} 

}

경우 unInstallOperation() 계정의 그 갱신을 포함 웹 서비스 작업을 호출합니다.

이 문제를 해결하는 방법은 무엇입니까? 이 문제로 실제 피드 업

설치 프로그램 클래스에서 응용 프로그램 제거 중 호출 할 때 다른 페이지 또는 다른 클래스 파일에서 serviceclient를 호출 할 때 문제가 없습니다. 이것은 내가

소스 코드를 사용하고 해당 클라이언트 구성 코드의 app.config된다

<client> 

    <endpoint address="http://companyfind.info/RegWcfService/Service1.svc" 
binding="basicHttpBinding" bindingConfiguration="BasicHttpBinding_IService1" 
     contract="IService1" name="BasicHttpBinding_IService1" /> 

    </client> 

웹 서비스의 web.config 파일이 추가 할 필요가 있는가를?

답변

0

서비스 참조를 업데이트하고 클라이언트 구성이 시작 프로젝트 구성 파일에 있는지 확인하십시오. 내 경우했다대로, Service1Client에게

var sc = new webMiner.ServiceReference2.Service1Client("BasicHttpBinding_IService1"); 

을 instatiating 또는 때

+0

웹 서비스의 web.config 파일에 위에 주어진 클라이언트 코드를 추가 할 필요가 있습니까 ?? – Vaibhav

+0

가 서비스 참조를 업데이트하려고 시도했지만 클라이언트 구성이 시작 프로젝트 설정 파일에만 있었지만 사용하지 못했습니다. – Vaibhav

4

당신은 아마 당신의 엔드 포인트의 이름을 사용해야합니다, 당신은 솔루션과 두의 app.config에 다른 프로젝트에 다른 클래스가 수업. 따라서 기본 app.config 파일에서 enpoint 및 바인딩을 복사/붙여 넣기해야합니다.

+1

그래, 저에게는 효과적 이었지만 그럴 수는 없습니다. 더 나은 실천이 있어야합니다. >. < – Chiramisu