2011-03-20 4 views
1

WCF의 기본 구성에 문제가 있습니다. 나는 MobilePhone 응용 프로그램에서 일하고 있습니다. 먼저 basicHttpBinding을 사용하는 모든 테스트 데스크톱 응용 프로그램을 만들었습니다. 다음으로 동일한 코드를 사용했습니다 (차이점은 ServerReference에 있음 - 전화에서는 NetCFSvcUtil을 사용하여 생성 된 두 개의 서버 파일을 사용함). 전화 응용 프로그램에서 끝 점이 발견되지 않았습니다. 예외가 발생했습니다. 다음은 구성을 설명합니다. 도움이나 제안에 감사드립니다.WCF 구성 - basicHttpbinding

감사합니다. 전화 측

예외 :

메시지를 받아 들일 수 http://localhost:4444/Service/PhoneService 에서 듣기에는 엔드 포인트가 없었다. 이것은 종종 이고 잘못된 주소 인 또는 SOAP 동작으로 인해 발생합니다. 자세한 내용은 인 경우 InnerException을 참조하십시오.

전화 구성 : 브라우저에서 서버 구성의

<?xml version="1.0" encoding="utf-8"?> 
<configuration> 
    <system.serviceModel> 
    <bindings> 
    <basicHttpBinding> 
    <binding name="BasicHttpBinding" closeTimeout="00:01:00" 
     openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00" 
     allowCookies="false" bypassProxyOnLocal="false" hostNameComparisonMode="StrongWildcard" 
     maxBufferSize="65536" maxBufferPoolSize="524288" maxReceivedMessageSize="65536" 
     messageEncoding="Text" textEncoding="utf-8" transferMode="Buffered" 
     useDefaultWebProxy="true"> 
     <readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384" 
      maxBytesPerRead="4096" maxNameTableCharCount="16384" /> 
     <security mode="None"> 
     <transport clientCredentialType="None" proxyCredentialType="None" 
      realm="" /> 
     </security> 
    </binding> 
    </basicHttpBinding> 
</bindings> 

    <client> 
    <endpoint address="http://localhost:4444/Service/PhoneService/" 
     binding="basicHttpBinding" bindingConfiguration="BasicHttpBinding" 
     contract="IPhoneService" name="BasicHttpBinding" /> 
    </client> 



</system.serviceModel> 

** revelant 조각 **

<service name="Server.PhoneService" behaviorConfiguration="Server.PhoneServiceBehavior"> 
    <endpoint address="" binding="basicHttpBinding" bindingConfiguration="" contract="Server.IPhoneService" /> 
    <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" /> 
    <host> 
     <baseAddresses> 
     <add baseAddress="http://localhost:4444/Service/PhoneService" /> 
     </baseAddresses> 
    </host> 
    </service> 



//______________________________// 

<behavior name="Server.PhoneServiceBehavior"> 
    <serviceMetadata httpGetEnabled="true" /> 
    <serviceDebug includeExceptionDetailInFaults="true" /> 
</behavior> 

* 구성 *

전화 서비스 서비스

서비스를 생성했습니다.

이 서비스를 테스트하려면 클라이언트를 만들어 서비스에 전화해야합니다. 이 구성 파일과 클라이언트를 포함하는 코드 파일을 생성합니다 http://localhost:4444/Service/PhoneService?wsdl

svcutil.exe에 다음과 같은 구문을 사용하여 명령 행 에서 svcutil.exe에 도구를 사용하여이 작업을 수행 할 수 있습니다 수업. 두 파일을 클라이언트 응용 프로그램에 추가하고 생성 된 클라이언트 클래스를 사용하여 서비스를 호출하십시오. 예를 들어 :

C# 

class Test 
{ 
    static void Main() 
    { 
     PhoneServiceClient client = new PhoneServiceClient(); 

     // Use the 'client' variable to call operations on the service. 

     // Always close the client. 
     client.Close(); 
    } 
} 
+0

다른 장치 (예 : 다른 dev 컴퓨터)에서 클라이언트 구성을 테스트 했습니까? –

+0

안녕하세요, 저는 랩톱에서 모든 것을 테스트했습니다. 방화벽이 없습니다. – user648518

답변

2

문제는 사용할 수없는 인터넷 연결에 의해 발생했다.