none
WCF Sent Message Size Quota in Streaming Transfer to Java Client RRS feed

  • Question

  • Hello there,

    I created a WCF Service and a Java Client to consume it. I chose the streamed mode for data transfer and up to a specific message size, everything works fine. But as soon as the response from the web service would exceed 65536, the service sends the initial data and then just stops sending more information (I've checked the TCP packets). Therefore Java generates an error saying that there was an unexpected EOF. If I had a WCF Client, I could configure its MessageReceiveSize to have a larger number, but in Java there is no option for that, as there are no quotas by default. Now my question: How can I tell the Service to send the Message in full, always? Or at least tell the service to send the message as long as it won't exceed 2GB  of data.

    Thanks in advance,

    Martin

    Sunday, April 28, 2013 1:37 PM

Answers

All replies

  • I believe you are looking for this forum instead: http://social.msdn.microsoft.com/Forums/en-US/wcf/threads

    -Ian

    Monday, April 29, 2013 4:02 PM
  • Hi,

    I am not familiar with Java programming, you may check a thread here.

    http://stackoverflow.com/questions/132590/can-a-web-service-return-a-stream

    To consume the service from Java client, you can also consider building your WCF service as a Restful service, thus, the client application which support plain HTTP GET/POST requests can consume it which is more lightweight than SOAP based service.

    #WCF Web HTTP Programming Model Overview

    http://msdn.microsoft.com/en-us/library/bb412172.aspx

    #WCF REST Service Template 40(CS)

    http://visualstudiogallery.msdn.microsoft.com/fbc7e5c1-a0d2-41bd-9d7b-e54c845394cd

    Best Regards.


    Haixia
    MSDN Community Support | Feedback to us
    Develop and promote your apps in Windows Store
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Tuesday, April 30, 2013 2:28 AM
    Moderator
  • Hi,

    in my opionion, it's not enirely a Java-based problem. The way I see it, is that the service refuses to send more data, once the default value for the message size of 65536 is being exceeded. This must be "hard-coded" somewhere. If I use a WCF client, then the same is true only until I change the app.config of the .NET client. The Problem is, that Java has no app.config-file, which might be able to tell the service that sending more (ore maybe even less) data is (un-)acceptable. I was unable to determine, whether the REST approach in WCF has such a fetaure implemented. Additionally, I would like to keep my Service as a SOAP Service, if there is not a very good reason against it.

    Best

    Martin

    Tuesday, April 30, 2013 9:44 AM
  • Try to put this question to Java forum that may help you
    Tuesday, April 30, 2013 11:49 PM
  • "This must be "hard-coded" somewhere."

    It is not hard coded, it is a default value of message size, as VikasBhardwaj said, you can ask in Java forum to get how to config java based application to send a larger data.

    Wednesday, May 1, 2013 2:11 AM
  • I did put this question in a Java forum, but, unfortunately, so far everybody tells me that there are no limitations for Java-based WS Clients and no one seems to know, how to tell this the Web Service. Additionally, even a default value is stored somewhere. How would my Service otherwise decide to cut the payload of a TCP packet if the message exceeds a certain value? This is what I mean. How can I alter this exact default value on the server side, regardless of the client (or client's config)?

    • Edited by Mr Zeth Thursday, May 2, 2013 6:21 AM typos
    Thursday, May 2, 2013 6:15 AM
  • Hi,

    >>How can I alter this exact default value on the server side, regardless of the client (or client's config)?

    The configuration need be changed for both server side and client side when you want to transfer a large data(maxReceivedMessageSize, maxarrayLength, maxStringLength, etc...).

    Or you may consider chunking message, see Chunking Channel.

    Best Regards.


    Haixia
    MSDN Community Support | Feedback to us
    Develop and promote your apps in Windows Store
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Thursday, May 2, 2013 9:04 AM
    Moderator