Announcement

Collapse
No announcement yet.

wcf array senden

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • wcf array senden

    Hallo aller seits

    ich möchte ein Striung-Array an mein Client senden. Alle anderen Methoden die als Ruckgabewert mit Datentypen wie bool, string funktionieren anwendfrei.
    Jetzt bricht die Kommunication ab und bekomme ich den folgende Exception

    Das Kommunikationsobjekt "System.ServiceModel.Channels.ServiceChannel" kann nicht für die Kommunikation verwendet werden, da es abgebrochen wurde.
    Ich bin für eure tipps und HILFE sehr dankbar
    Server seite:

    Code:
     [ServiceContract(SessionMode = SessionMode.Required, CallbackContract = typeof(IMyEvents))]
        public interface IMyContract
        {
           [OperationContract]
            String[] GetStatus();
    }
    Client Seite

    Code:
       class ServiceClient : DuplexClientBase<IMyContract>, IMyContract
        {
    
    public String[] GetStatus()
            {
                String[] fileContent;
               
                try
                {
                    fileContent = base.Channel.GetStatusLog();
                    return fileContent;
                }
                catch (TimeoutException timeout)
                {
                    // Handle the communication exception
                    base.Abort();
                    Exc("CommunicationException");
    
                }
    
                return fileContent;
            }
    }
    Zuletzt editiert von foufou; 08.05.2011, 17:52.

  • #2
    Ich bin jetzt weiter gekommen... Problem liegt an der größe der Datenmenge...
    was kann ich dagegen machen?

    Comment


    • #3
      Weniger Daten senden, in mehreren Blöcken....
      Christian

      Comment


      • #4
        Danke für die Antwort
        Es ist eine Log Datei die ich in ein array einlese und dann an den Client sende
        Aber ich werde jetzt den array zu teile splitten und jedes mal ein teil senden.

        Comment


        • #5
          Die entsprechenden Konfigurationspunkte in deiner App.config erhöhen. Welche genau hängt davon ab was du genau tust. Kandidat wäre zum Beispiel maxReceivedMessageSize an deiner Binding Konfiguration.

          Comment


          • #6
            Ich habe noch den Block binding mit maxReceiveMessageSize eingefügt in den Client App.Config aber ich kann immer noch nicht ein größere Datenmange schicken?
            Code:
            <system.serviceModel>
                <bindings>
                  <wsDualHttpBinding>
                    <binding name="default" maxReceivedMessageSize="5000000">
                      <readerQuotas maxStringContentLength="5000000" maxArrayLength="5000000" />
                    </binding>
                  </wsDualHttpBinding>
                </bindings>
                
                <client >
                  <endpoint address="http://localhost:8090/TestController"
                  binding="wsDualHttpBinding" contract="Test.IMyContract"
                            name="Test.TestController">
                    <identity>
                      <dns value="localhost"/>
                    </identity>
                  </endpoint>  
                  <endpoint address="mex" binding="mexHttpBinding"
                   contract="IMetadataExchange"/>
                </client>
            </system.serviceModel>
            Zuletzt editiert von foufou; 09.05.2011, 11:24.

            Comment


            • #7
              In deinem Endpunkt fehlt die Angabe welche Bindingkonfiguration den benutzt werden soll. Also etwa
              Code:
              <endpoint address="http://localhost:8090/TestController"
                    binding="wsDualHttpBinding" contract="Test.IMyContract"
                              name="Test.TestController" bindingConfiguration="default">

              Comment


              • #8
                Danke Ralf es funktioniert... ich kann locker bis 1 MB senden

                Comment


                • #9
                  Originally posted by foufou View Post
                  Ich bin jetzt weiter gekommen... Problem liegt an der größe der Datenmenge...
                  was kann ich dagegen machen?
                  vielleicht mal in Richtung timeout suchen?

                  Comment

                  Working...
                  X