Khi tôi cập nhật Tài liệu tham khảo dịch vụ, tôi kết thúc với:Cập nhật dịch vụ cập nhật nhấn mạnh vào việc thêm Soap12 vào Config.
Không thể tải cấu hình điểm cuối cho hợp đồng 'MyService.MainServiceSoap' vì có nhiều hơn một cấu hình điểm cuối cho hợp đồng đã được tìm thấy. Vui lòng cho biết phần cấu hình điểm cuối ưa thích theo tên.
web.config của tôi kết thúc như thế này:
điểm cuối:
<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" />
bindings:
<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>
tôi tự xóa CustomBinding và Soap12 endpoint và tất cả mọi thứ hoạt động tốt. Nhưng nếu tôi cập nhật dịch vụ một lần nữa (kích chuột phải vào Update Service Reference) thì ràng buộc tùy chỉnh được thêm vào sẽ lại gây ra lỗi và cần phải loại bỏ thủ công khỏi tập tin cấu hình.
Có ai đó biết cách sửa lỗi này không? Tôi không muốn/cần một liên kết soap12 tùy chỉnh.
Đây là tập tin dịch vụ cấu hình:
<?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, 
Version=6.3.6.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d"/>
</DbProviderFactories>
</system.data>
</configuration>
Bạn có dịch vụ truy cập đang được thêm làm tham chiếu dịch vụ không? –
vâng tôi có, im nhà phát triển của cả hai điểm. –
Bạn đang lưu trữ trong IIS và nếu như vậy những gì bạn đã thiết lập trong bindings trang web của bạn và cho phép các giao thức trong ứng dụng? –