Problem with the OutStream in the VAT information under SII
AitorEG
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:

"Interrupt in error message:
The WRITE element isn't allowed for a text without a maximun length"

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
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:

"Interrupt in error message:
The WRITE element isn't allowed for a text without a maximun length"

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
0
Answers
-
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:
That would explain the commented line.RequestBigText.ADDTEXT(RequestText);
RequestBigText.WRITE(OutStream);
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-030 -
Error Message in English Please.Thanks
Blog - rockwithnav.wordpress.com/
Twitter - https://twitter.com/RockwithNav
Facebook - https://facebook.com/rockwithnav/0 -
RockWithNAV wrote: »Error Message in English Please.
"Interrupt in error message:
The WRITE element isn't allowed for a text without a maximun length"Slawek_Guzek wrote: »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:
That would explain the commented line.RequestBigText.ADDTEXT(RequestText);
RequestBigText.WRITE(OutStream);
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
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:

"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!
0 -
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-030 -
Slawek_Guzek wrote: »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!
0 -
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-030 -
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!0 -
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:
"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?0
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.7K Microsoft Dynamics NAV
- 18.8K NAV Three Tier
- 38.4K NAV/Navision Classic Client
- 3.6K Navision Attain
- 2.4K Navision Financials
- 116 Navision DOS
- 851 Navision e-Commerce
- 1K NAV Tips & Tricks
- 772 NAV Dutch speaking only
- 617 NAV Courses, Exams & Certification
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 327 Dynamics CRM
- 111 Dynamics GP
- 10 Dynamics SL
- 1.5K Other
- 990 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 35 Design Patterns (General & Best Practices)
- 1 Architectural Patterns
- 10 Design Patterns
- 5 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1.1K General Chat
- 1.6K Website
- 83 Testing
- 1.2K Download section
- 23 How Tos section
- 252 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions

