我的妇联工作。 我有以下组合:
<bindings>
<basicHttpBinding>
<binding name="HttpStreaming" maxReceivedMessageSize="65536000" closeTimeout="00:05:00" bypassProxyOnLocal="true" openTimeout="00:05:00" receiveTimeout="00:30:00" sendTimeout="00:30:00" transferMode="Streamed" messageEncoding="Mtom">
<readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="65536000" maxBytesPerRead="4096" maxNameTableCharCount="16384" />
<security mode="None">
<transport clientCredentialType="None" proxyCredentialType="None" realm="" />
</security>
</binding>
</basicHttpBinding>
</bindings>
<behaviors>
<serviceBehaviors>
<behavior name="CifsManager.CifsManagerServiceBehavior">
<serviceMetadata httpGetEnabled="true" />
<serviceDebug includeExceptionDetailInFaults="true" />
</behavior>
</serviceBehaviors>
</behaviors>
<services>
<service behaviorConfiguration="CifsManager.CifsManagerServiceBehavior" name="CifsManager.CifsManagerService">
<endpoint address="" binding="basicHttpBinding" bindingConfiguration="HttpStreaming" contract="CifsManager.ICifsManagerService"></endpoint>
</service>
</services>
我制作了代理班,称为 ServiceClient。
var service = new ServiceClient();
service.ClientCredentials.UserName.UserName = "111";
service.ClientCredentials.UserName.Password = "111";
service.bufferSize = int.Parse(ConfigurationManager.AppSettings["BufferSize"]);
var file= service.GetFile();
Here I found the articles where it is described how to solve my problem throught the wsHttpBinding, but using it I get the server error. Could I create the authentication using the basicHttpBinding or I need the wsHttpBinding and how should I do it?