Options

SOAP Services/Max Message Size ignored?

lyngelynge Member Posts: 85
edited 2013-11-11 in NAV Three Tier
Hi Experts

I'm offering a page as web service from NAV 2013 (7.0.35201.0). It contains a BASE64 field for a Picture which i store as a binary Picture in a BLOB-field...

Unfortunately I'm getting this when trying to call the web service:
"QuotaExceededException: The maximum message size quota for incoming messages (65536) has been exceeded. To increase the quota, use the MaxReceivedMessageSize property on the appropriate binding element."

The SOAP Services/Max Message Size in the NAV management console is per default 1024 (which I guess is 1MB).
I've tried to increase it to 10240 (I guess 10MB) but still gets the same error (including the "65536" number).

Where is this limit defined and where can it be increased?

Regards
Gert Lynge

Answers

  • Options
    geordiegeordie Member Posts: 655
    Hi, seems can be done via web config:
    <bindings>
          <webHttpBinding>
            <!-- configure the maxReceivedMessageSize  value to suit the max size of
             the request ( in bytes ) you want the service to recieve-->
            <binding name="higherMessageSize" maxReceivedMessageSize ="900000"/>
          </webHttpBinding>
        </bindings>
    

    Or via code:
    public static void IncreaseMaxReceivedMessageSize()
    {        
        SPWebService contentService = SPWebService.ContentService;
        contentService.ClientRequestServiceSettings.MaxReceivedMessageSize = 10485760;  // 10MB
        contentService.Update();
    }
    

    Whom is your paged "consumed" by?
  • Options
    lyngelynge Member Posts: 85
    Is the NAV server using a web.config for the ODATA/SOAP web service interfaces?
    If yes, where is it located? (I don't believe you need to install IIS to provide NAV ODATA/SOAP web service interfaces in NAV - am I wrong?)

    The consumer is a 3rd party webshop (I have no access to code etc, but i think it is coded in C#).

    The "funny" part is that the order is correctly received by NAV - but the webshop still shows the error.
    Can it be that the Web Service REPLY from NAV is larger than 64KB and the webshop is not setup (in its web.config) to handle that?

    The web backtrace is showing:
    ---
    [QuotaExceededException: The maximum message size quota for incoming messages (65536) has been exceeded. To increase the quota, use the MaxReceivedMessageSize property on the appropriate binding element.]

    [CommunicationException: The maximum message size quota for incoming messages (65536) has been exceeded. To increase the quota, use the MaxReceivedMessageSize property on the appropriate binding element.]
    System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg) +14543138
    System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type) +622
    newbase.Navi.Sales_Order_Port.Create(Create1 request) +0
    ....

    The "HandleReturMessage" makes we wonder if it is the reply there is too big?

    Regards
    Gert Lynge
  • Options
    geordiegeordie Member Posts: 655
    lynge wrote:
    The "funny" part is that the order is correctly received by NAV - but the webshop still shows the error.
    Can it be that the Web Service REPLY from NAV is larger than 64KB and the webshop is not setup (in its web.config) to handle that?

    Sorry, my previous message was probably too concise: the limit has to be increased by both is sending the message (NAV) and receiving it (webshop).
    So you are right changing SOAP services max message size, but also who consuming the webservice must be able to process bigger replies through web.config/code modification.

    How big is the image?

    Hope it helps since I never faced this problem before.
  • Options
    lyngelynge Member Posts: 85
    Hi Geordie

    The images are diffent size, but probably all 5-15KB. The webservice can contain multiple images (blue prints to production).
    So the order web service contains multiple order lines from a webshop where customers can modify products.

    The problem was solved :-). It was the consumer (the webshop) which had to increase the size limit for returned webservice answer from NAV.

    Thank you very much for your help! :-)

    Regards,
    Gert Lynge
Sign In or Register to comment.