2011-12-30 2 views
10

서비스 참조를 업데이트 할 때 다음과 같이 끝납니다 :업데이트 서비스 참조는 구성에 Soap12를 추가해야한다고 주장합니다.

계약서에 대한 둘 이상의 끝점 구성이 있기 때문에 계약서 'MyService.MainServiceSoap'의 끝점 구성 섹션을로드 할 수 없습니다. 원하는 엔드 포인트 구성 섹션을 이름으로 표시하십시오.

내 Web.config의는 다음과 같이 끝 :

엔드 포인트 :

<endpoint address="http://localhost/main/MainService.asmx" 
    binding="basicHttpBinding" bindingConfiguration="MainServiceSoap" 
    contract="MyService.MainServiceSoap" name="MainServiceSoap" /> 
    <endpoint address="http://localhost/main/MainService.asmx" 
    binding="customBinding" bindingConfiguration="MainServiceSoap12" 
    contract="MyService.MainServiceSoap" name="MainServiceSoap12" /> 

바인딩 :

<basicHttpBinding> 
    <binding name="MainServiceSoap" closeTimeout="00:01:00" openTimeout="00:01:00" 
     receiveTimeout="00:10:00" sendTimeout="00:01:00" allowCookies="false" 
     bypassProxyOnLocal="false" hostNameComparisonMode="StrongWildcard" 
     maxBufferSize="655360" maxBufferPoolSize="5242880" maxReceivedMessageSize="655360" 
     messageEncoding="Text" textEncoding="utf-8" transferMode="Buffered" 
     useDefaultWebProxy="true"> 
     <readerQuotas maxDepth="32" maxStringContentLength="81920" maxArrayLength="163840" 
     maxBytesPerRead="40960" maxNameTableCharCount="163840" /> 
     <security mode="None"> 
     <transport clientCredentialType="None" proxyCredentialType="None" 
      realm="" /> 
     <message clientCredentialType="UserName" algorithmSuite="Default" /> 
     </security> 
    </binding> 
    </basicHttpBinding> 
    <customBinding> 
    <binding name="MainServiceSoap12"> 
     <textMessageEncoding maxReadPoolSize="64" maxWritePoolSize="16" 
     messageVersion="Soap12" writeEncoding="utf-8"> 
     <readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384" 
      maxBytesPerRead="4096" maxNameTableCharCount="16384" /> 
     </textMessageEncoding> 
     <httpTransport manualAddressing="false" maxBufferPoolSize="524288" 
     maxReceivedMessageSize="65536" allowCookies="false" authenticationScheme="Anonymous" 
     bypassProxyOnLocal="false" decompressionEnabled="true" hostNameComparisonMode="StrongWildcard" 
     keepAliveEnabled="true" maxBufferSize="65536" proxyAuthenticationScheme="Anonymous" 
     realm="" transferMode="Buffered" unsafeConnectionNtlmAuthentication="false" 
     useDefaultWebProxy="true" /> 
    </binding> 
    </customBinding> 

내가 수동으로 customBinding 및 SOAP12 엔드 포인트를 삭제하고 모든 것이 잘 작동합니다. 그러나 서비스를 다시 업데이트하면 (오른쪽에서 서비스 참조 업데이트) 추가 된 사용자 정의 바인딩이 다시 추가되어 오류가 발생하고 구성 파일에서 수동으로 제거해야합니다.

이 문제를 해결하는 방법을 아는 사람이 있습니까? 나는 사용자 정의 soap12 바인딩을 원하지 않거나 필요로하지 않습니다. 난 그냥 내 프록시 클래스를 다시 svcutil.exe에 직접 전화

<?xml version="1.0"?> 
<configuration> 
    <system.web> 
    <globalization culture="es-PY" uiCulture="es-PY"/> 
    <customErrors mode="Off"/> 
    <webServices> 
<!-- Tried adding and/or removing protocols and conformanceWarnings --> 
     <protocols> 
     <add name="HttpGet"/> 
     <add name="HttpPost"/> 
     </protocols> 
<!-- --> 
     <conformanceWarnings> 
     <remove name="BasicProfile1_1"/> 
     </conformanceWarnings> 
    </webServices> 
    <compilation debug="true" targetFramework="4.0"/> 
    </system.web> 
    <system.serviceModel> 
    <standardEndpoints> 
     <webHttpEndpoint> 
     <standardEndpoint name="standard" maxReceivedMessageSize="6553600" maxBufferSize="6553600" transferMode="Streamed" helpEnabled="true" automaticFormatSelectionEnabled="true"> 
      <readerQuotas maxStringContentLength="65536000" maxArrayLength="163840" /> 
     </standardEndpoint> 
     </webHttpEndpoint> 
    </standardEndpoints> 
    <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="true"/> 

     </behavior> 
     </serviceBehaviors> 
    </behaviors> 
<!-- Tried setting multipleSiteBindingEnalbed true and false --> 
    <serviceHostingEnvironment multipleSiteBindingsEnabled="true" aspNetCompatibilityEnabled="true"/> 
<!-- --> 

    </system.serviceModel> 
    <system.webServer> 
    <modules runAllManagedModulesForAllRequests="true"/> 
    </system.webServer> 
    <connectionStrings> 
    <clear/> 
    <add name="GamblingEntities" connectionString="..." providerName="System.Data.EntityClient" /> 
    <add name="GamblingSiteEntities" connectionString="..." providerName="System.Data.EntityClient" /> 
    </connectionStrings> 
    <system.data> 
    <DbProviderFactories> 
     <clear/> 
     <add name="MySQL Data Provider" invariant="MySql.Data.MySqlClient" description=".Net Framework Data Provider for MySQL" type="MySql.Data.MySqlClient.MySqlClientFactory, MySql.Data, &#xA;Version=6.3.6.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d"/> 
    </DbProviderFactories> 
    </system.data> 
</configuration> 
+0

서비스 참조로 추가되는 액세스 서비스가 있습니까? –

+0

예, 저는 두 점의 개발자입니다. –

+0

IIS에서 호스팅하고 있습니까? 그렇다면 응용 프로그램에서 사이트 바인딩과 프로토콜을 어떻게 설정 했습니까? –

답변

2

.NET 2.0의 새로운 ASMX 런타임은 SOAP 1.2를 지원합니다. 현재 SOAP 1.1이 업계에서 가장 널리 사용되고 있습니다. .NET Framework에서는 SOAP 1.1과 SOAP 1.2가 모두 지원됩니다. 즉, .NET Framework 2.0에서 작성된 웹 서비스는 SOAP 1.1 및 SOAP 1.2 메시지를 모두 지원하도록 구성됩니다. 이는 간접적으로 웹 서비스 용으로 생성 된 WSDL이 SOAP 1.1과 SOAP 1.2의 두 가지 유형의 바인딩을 갖게됨을 의미합니다. 이 바인딩이 생성되는 이유

Taken from here

이입니다.

<remove name="HttpSoap12"/> 

나는이 방법을 사용하지 않도록 설정 한 것 같아요. 이제이 문제를 해결 방법으로 생각하는 이유를 이해할 수 있습니다. 웹 서비스를 새 프레임 워크로 옮겼을 때 뭔가가 발생할 수 있습니다. 따라서 1.1에있는 이전 웹 서비스 중 일부가 동일한 방식으로 응답하지 않을 수 있습니다. 2.0 프레임 워크를 타겟팅하여 어떤 일이 일어나는지보십시오.

+0

메신저 서비스의 작성자! –

+0

예, 문제를 해결했지만 문제가 해결되었습니다. 서비스를 업데이트하면 다시 추가되며 web.config에 추가되지 않도록하는 방법이 원래의 질문입니다. –

+0

클라이언트가 아닌 원래 서비스에서 제거하십시오. 클라이언트에 참조를 추가하면 더 이상 존재하지 않게됩니다. –

-3

:

이 서비스 설정 파일입니다. 훨씬 더 간단합니다.

3

단단한 대안이 없습니다. 나는 당신의 질문에 투표했습니다. 나는 svcutil을 사용하여 dll을 생성하도록 전환했지만 지금은이 문제가 Microsoft에보고되었습니다. update-or-configure-an-existing-service-reference-in-sl-application-you-get-duplicate-binding-and-endpoint-information

그들은 VS2010에서 수정되었지만 VS2010 SP1도 설치되어 있다고 말했습니다. SP1에서도 수정되지 않았습니다. 그래서 거기에 아무런 수정이 주어지지 않았고 버그는 'External'로 닫힙니다. 이상한.

버그 보고서 페이지에서 해결 방법을 찾을 수도 있지만 어수선해 보입니다.

다른 해결 방법은 이중 엔드 포인트를

MyService.MainServiceSoap mainServiceSoap = 새로운이면 MyService을 방지하기 위해 하드 코딩 된 이름을 바인딩 서비스 클라이언트 개체를 만드는 것입니다.MainServiceSoap ("MainServiceSoap");

또는 마지막으로 Microsoft에서 다른 버그 보고서를 열어 해결할 수 있습니다.

+0

실제로 그렇게 보입니다. VS2010SP1을 사용하여 조사 결과도 확인했습니다. – Plippie

+0

Visual Studio 2012와 여전히 동일합니다. –