Problem with the OutStream in the VAT information under SII

AitorEGAitorEG Member Posts: 342
Hi everyone,

I am testing the last version of the patch with the objects created by microsoft for the VAT information under SII in a NAV2013R2. When trying to create a request, I see this error at this point:
b3234t2yf4zc.png
"Interrupt in error message:
The WRITE element isn't allowed for a text without a maximun length"

wgqh6turvsi3.png

I haven't touched anything in the code, and it works perfectly for example, in NAV2017, with the same code.
Any hint? Can it have anything to do with the installed Cumulative Update?

Thank you very much

Answers

  • Slawek_GuzekSlawek_Guzek Member Posts: 1,690
    edited 2017-12-21
    I remember I've hit the same error somewhere some time so my thoughts were that OutSteam.WRITE function Works only with Text variable with its length defined. Since if you decide to use defined the text with specified lenght there is 1024 characters I thought that the data needs to be passed through the BigText variable, something like this:
    RequestBigText.ADDTEXT(RequestText);
    RequestBigText.WRITE(OutStream);
    That would explain the commented line.

    But it looks like OutStream.WRITE() indeed works with unlimited texts, at leasin in NAV2017.
    Maybe the limit on OutStream.WRITE() was there in earlier versions but was removed at some point


    Slawek Guzek
    Dynamics NAV, MS SQL Server, Wherescape RED;
    PRINCE2 Practitioner - License GR657010572SG
    GDPR Certified Data Protection Officer - PECB License DPCDPO1025070-2018-03
  • RockWithNAVRockWithNAV Member Posts: 1,139
    Error Message in English Please.
  • AitorEGAitorEG Member Posts: 342
    Error Message in English Please.

    "Interrupt in error message:
    The WRITE element isn't allowed for a text without a maximun length"
    I remember I've hit the same error somewhere some time so my thoughts were that OutSteam.WRITE function Works only with Text variable with its length defined. Since if you decide to use defined the text with specified lenght there is 1024 characters I thought that the data needs to be passed through the BigText variable, something like this:
    RequestBigText.ADDTEXT(RequestText);
    RequestBigText.WRITE(OutStream);
    That would explain the commented line.

    But it looks like OutStream.WRITE() indeed works with unlimited texts, at leasin in NAV2017.
    Maybe the limit on OutStream.WRITE() was there in earlier versions but was removed at some point


    Thank you for your help, really appreciated and helpful as always

    I can guarantee that in NAV is working with the same code, so it's a fact that in later versions this issue has been solved.
    As you realized with my code, I tried to solve this issue with a big text variable, but the assignation I made was like this:
    OutStream.WRITE(RequestBigText);
    
    This was failing, so i changed to the way you wrote :neutral:
    RequestBigText.WRITE(OutStream);
    

    In the way you told me, it seems to work, at least the error isn't happening in that sentence, but I found another different error:
    cwhwgmjxbtmb.png
    qj5p0d6g6ak7.png


    "Interrupt in error message:
    Error in the call to System.Threading,Tasks.UnwrapPromise'1[System.net.WebResponse]. Result with the message: Timeout excedeed in the operation"

    Could this happen because of some issue with the assignation of the OutStream variable? Or does it reinforce my theory that i need to install a newer Cumulative Update of nav20413R2?

    To be sincere, i'm thinking more about the second idea...

    Thank you!


  • Slawek_GuzekSlawek_Guzek Member Posts: 1,690
    I don't think it has anything to do with Outstream, or with the cumulative update level you are on or you need.

    You have used system component, external to NAV. The error is produced inside this component, NAV is only intercepting and showing it to you.

    Check if you can set any timeouts/waiting times on the HttpWebRequest or Task vars, check any property which name suggests it can affect waiting time for an external site to prepare and send the response. Try setting some large values in there, so the component could wait, say one minute for the response. If it keeps failing with such a long timeouts start investigating connections - maybe a firewall blocking traffic somewhere along the lines?
    Slawek Guzek
    Dynamics NAV, MS SQL Server, Wherescape RED;
    PRINCE2 Practitioner - License GR657010572SG
    GDPR Certified Data Protection Officer - PECB License DPCDPO1025070-2018-03
  • AitorEGAitorEG Member Posts: 342
    I don't think it has anything to do with Outstream, or with the cumulative update level you are on or you need.

    You have used system component, external to NAV. The error is produced inside this component, NAV is only intercepting and showing it to you.

    Check if you can set any timeouts/waiting times on the HttpWebRequest or Task vars, check any property which name suggests it can affect waiting time for an external site to prepare and send the response. Try setting some large values in there, so the component could wait, say one minute for the response. If it keeps failing with such a long timeouts start investigating connections - maybe a firewall blocking traffic somewhere along the lines?

    Thank you! I'll work on it. I told you about the cumulative becasue i see that in other versiones, it's working perfectly with the same code...
    THnak you again!
  • Slawek_GuzekSlawek_Guzek Member Posts: 1,690
    If it works in other versions maybe indeed a qicker way to resolve the problem would be to install CU or upgrade technically. I'm personally strongly in favour of keeping the binaries up to date - but not too much up to date :). One or two CU level behind so I'm not getting caught by new MS bugs.
    Slawek Guzek
    Dynamics NAV, MS SQL Server, Wherescape RED;
    PRINCE2 Practitioner - License GR657010572SG
    GDPR Certified Data Protection Officer - PECB License DPCDPO1025070-2018-03
  • AitorEGAitorEG Member Posts: 342
    I think in the same way. If this problem is solved with the new CU, probably I will spend less time installing the CU than trying to finde the problem.

    Thank you!
  • AitorEGAitorEG Member Posts: 342
    hi again!
    I've installed the Cumulative Update 44 in the machine. This CU is the mandatory one to work with the VAT registration module.

    As I was expecting, the issue with the outstrea and the text variable has been solved. And also the issue of the timeout. Now, my issue is more general, it's about error when creating DOTNEt objects, as for example:

    hin1dmd1919j.png

    "Cannot create an instqance of the :NET Framework object: Assemblu System,Xml Version xxxxxx Type System.Xml.XmlNode"

    Can it have anything to do with the runOnClient property of the DOTNET variables?
Sign In or Register to comment.