WCF Dies könnte durch die service-Endpunkt-Bindung nicht über das HTTP-Protokoll

Standard.aspx.cs

WCFService.Service1Client client = new WCFService.Service1Client();
string stream = client.JsonSerializeFromDatabase();
client.Close();
WCFService.Service1Client client2 = new WCFService.Service1Client();
foreach (WCFService.Person in client2.JsonDeserializeFromDatabase(stream)) 

Service1.svc.cs

public IList<Person> JsonDeserializeFromDatabase(string value)
{
    MemoryStream ms = new MemoryStream(Encoding.ASCII.GetBytes(value));
    DataContractJsonSerializer ser = new DataContractJsonSerializer(typeof(List<Person>));
    IList<Person> tableData = (IList<Person>)ser.ReadObject(ms);
    ms.Close();
    ms.Dispose();

    return tableData;
}

IService1.cs

[OperationContract]
IList<Person> JsonDeserializeFromDatabase(string value);

Server-Web.config

    <httpRuntime maxRequestLength="8192"/>
</system.web>
...
<system.serviceModel>
<services>
    <service name="TestWCF.Service1" behaviorConfiguration="TestWCF.Service1Behavior">
        <endpoint address="" binding="wsHttpBinding" contract="TestWCF.IService1">
            <identity>
                <dns value="localhost"/>
            </identity>
        </endpoint>
        <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange"/>
    </service>
</services>
<behaviors>
<serviceBehaviors>
    <behavior name="TestWCF.Service1Behavior">
    <serviceMetadata httpGetEnabled="true"/>
    <serviceDebug includeExceptionDetailInFaults="true"/>
    <dataContractSerializer maxItemsInObjectGraph="2147483646"/>
    </behavior>
</serviceBehaviors>

Client-Web.config

    <httpRuntime maxRequestLength="8192"/>
</system.web>
<system.serviceModel>
    <behaviors>
        <endpointBehaviors>
            <behavior name="debuggingBehaviour">
                <dataContractSerializer maxItemsInObjectGraph="2147483646" />
            </behavior>
        </endpointBehaviors>
    </behaviors>
    <bindings>
        <wsHttpBinding>
            <binding name="WSHttpBinding_IService1" closeTimeout="00:50:00" openTimeout="00:50:00" receiveTimeout="00:50:00" sendTimeout="00:50:00" bypassProxyOnLocal="false" transactionFlow="false" hostNameComparisonMode="StrongWildcard" maxBufferPoolSize="2147483647" maxReceivedMessageSize="2147483647" messageEncoding="Text" textEncoding="utf-8" useDefaultWebProxy="true" allowCookies="false">
            <readerQuotas maxDepth="64" maxStringContentLength="2147483647" maxArrayLength="2147483647" maxBytesPerRead="2147483647" maxNameTableCharCount="2147483647"/>
            <reliableSession ordered="true" inactivityTimeout="00:50:00" enabled="false"/>
            <security mode="Message">
            <message clientCredentialType="Windows" negotiateServiceCredential="true" algorithmSuite="Default"/>
            </security>
        </binding>
    </wsHttpBinding>
</bindings>
<client>
    <endpoint address="~~~~~/Service1.svc" binding="wsHttpBinding" bindingConfiguration="WSHttpBinding_IService1" contract="WCFService.IService1" name="WSHttpBinding_IService1" behaviorConfiguration="debuggingBehaviour">

Ausnahme Von Informationen

Typ: System.ServiceModel.CommunicationException, System.ServiceModel, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089

- Meldung: Fehler beim empfangen der HTTP-Antwort auf ~~~~~/Service1.svc. Dies könnte durch die service-Endpunkt-Bindung nicht über das HTTP-Protokoll. Dies könnte auch daran liegen, dass die HTTP-Anforderung Kontext, abgetrieben zu werden, durch den server (evtl. durch den Dienst Herunterfahren). Siehe server-logs für weitere details.

Habe ich diese Informationen über die Ausnahme von Server-trace-viewer, also bitte nicht raten, mich zu setzen <-system.Diagnostik-> tag.

Wie Sie sehen können, ich erhöhte die alle die Größe Sache.

Wie.. ich weiß nicht, warum ich eine Fehlermeldung, wenn ich Anrufe, JsonDeserializeFromDatabase(stream).

"Fehler beim empfangen der HTTP-Antwort auf ~~~~~/Service1.svc. Dies könnte durch die service-Endpunkt-Bindung nicht über das HTTP-Protokoll. Dies könnte auch daran liegen, dass die HTTP-Anforderung Kontext, abgetrieben zu werden, durch den server (evtl. durch den Dienst Herunterfahren). Siehe server-logs für weitere details."

Versuchen, byte [], stream-parameter (serialisieren/Deserialisieren)

InformationsquelleAutor Adrian | 2013-10-01

Schreibe einen Kommentar