go to post John Murray · Feb 1, 2017 It's now been confirmed that the relevant parsers will not be ported to OpenVMS. So it'll never be possible to roundtrip all classes in UDL from that platform.Also worth noting that GetTextAsFile appears to pre-delete the class it's about to import before it encounters the parse error and aborts the import. So you're left without a copy of the class in your namespace. Oops!
go to post John Murray · Feb 1, 2017 Good point Jon. It does appear that the site I saw this happen on could be using a custom CZF.EXE, in which case perhaps GETFILE was omitted from its source CZF.C
go to post John Murray · Feb 1, 2017 I think you could simplify your first approach a little by reverting to calling OpenStream on your reader object rather than using OpenFile: // 1st approach - it succeeds, so the file errorOpenFile.xml is NOT generated // d msg.Value.Rewind() set fs=##class(%Stream.FileCharacter).%New() set fs.Filename="D:\DATABASES\OVPATH\temp\test.xml" set fs.TranslateTable = "UTF8" set tSC=fs.CopyFrom(msg.Value) set tSC=fs.%Save() s reader=##class(%XML.Reader).%New() d fs.Rewind() // might not be necessary, but won't hurt Set sc = reader.OpenStream(fs) Anyhow, the fact that you don't get an error confirms my hypothesis that the original stream (msg.Value) contains Unicode data but the reader treats it as though it is UTF8-encoded.In your code above I think you can also omit the line where you set fs.Filename and instead allow the stream to generate its own temporary file. Explicitly naming the file may be handy when debugging, but it will cause problems if more than one process runs this code concurrently.
go to post John Murray · Jan 31, 2017 Thanks for looking John. Since raising the question here I have opened a WRC ticket. The WRC agent's initial test on an Alpha platform didn't recreate the problem, so they're now going to try on an Integrity instance using the exact build I'm seeing it on.
go to post John Murray · Jan 31, 2017 Based on our comment thread I think the most likely cause is that the pInput %Library.GlobalCharacterStream (originating from the Value property of the object that was returned when you Invoke your webmethod) starts with an XML header claiming that its encoding="UTF-8" but I suspect that the characters within that global stream are actually Unicode rather than UTF8-encoded.To test this theory I suggest you create a new %Library.FileCharacterStream, set its TranslateTable property to "UTF8", then use its CopyFromAndSave method to fill it with the contents of pInput. Now pass your FileCharacterStream to your %XML.Reader's OpenStream method and see if you still get the SAX error.
go to post John Murray · Jan 31, 2017 There's no BOM, and the XML header claims that the content is UTF-8 encoded. But on your other post you reported that your content contains a left-single-quote character and that the SAX parser choked on a character, which I suspect was this character in Unicode form rather than UTF-8 encoded.So, what originally wrote the pInput stream's content? Did it actually UTF-8 encode the data it wrote to the stream?
go to post John Murray · Jan 31, 2017 What does the start of the pInput stream contain? One quick but ugly way of checking this would be to write it to a scratch global before the call to OpenStream which errors, e.g. Set ^tMurillo=pInput.Read(255) Do pInput.Rewind() Then afterwards run the following in Terminal: w ^tMurillo w $a(^tMurillo,1),!,$a(^tMurillo,2),!,$a(^tMurillo,3) This should show us whether the creator of the stream started it with a BOM character or sequence, and also whether there is an XML header specifying an encoding. That information is apparently important to the %XML.SAX.StreamAdapter used by %XML.SAX.Parser, which in turn is what the OpenStream method of %XML.Reader uses.
go to post John Murray · Jan 30, 2017 I'll repeat what I wrote on the previous DC thread you opened about this issue:I think you need to focus on the input stream. What type of stream is pInput ? You can get its classname using pInput.%ClassName(1)If it is a file stream, what wrote it? Does its file contain a BOM at the start?
go to post John Murray · Jan 30, 2017 Please clarify what you mean by "browse the file contents".Are you opening c:\TEMP\SoapTree.xml in a text editor?Maybe that editor is assuming that the file is UTF8-encoded.Can you view it in a tool that shows you the byte values it contains?Did you have a particular reason for choosing to write the file using an instance of %Stream.FileBinary instead of %Stream.FileCharacter?Also, be aware that the WebMethod classmethod of %SOAP.WebBase is tagged as "Internal" and commented thus: /// This method is used internally by Caché. You should not make direct/// use of it within your applications. There is no guarantee made about either/// the behavior or future operation of this property.
go to post John Murray · Jan 26, 2017 I think you need to focus on the input stream. What type of stream is pInput ? You can get its classname using pInput.%ClassName(1)If it is a file stream, what wrote it? Does its file contain a BOM at the start?You might need to open a support case with WRC. I don't work for InterSystems.
go to post John Murray · Jan 26, 2017 My guess is that your pInput stream contains XML encoded as UnicodeLittle characters.The left single quote character is unicode codepoint 8216 decimal which is 2018 hex. In UnicodeLittle this gets transposed and the 0x18 comes first, followed by the 0x20.
go to post John Murray · Jan 26, 2017 What is the nature of the failure?Perhaps when you save your LUT changes there's a small time window during which no LUT entries exist. This is pure speculation on my part, as I haven't investigated. But if it's true then I can imagine this could cause problems in the production. In which case, perhaps you need to suspend at least the relevant parts while you save the change.
go to post John Murray · Jan 17, 2017 %Admin_Task is a Resource, as are %Admin_Manage and %Admin_Operate.In contrast, %All is a Role.Access to SQL tables is controlled either at the Role level or at the individual User level.If your user has permissions on the %Admin_Task resource because they hold a role, then it may be appropriate to grant the necessary SQL permissions to that role. By doing this, anyone else holding the role will also be able to access the table.To grant the SQL permissions, edit the role (or user) definition. Go to the "SQL Tables" tab. Set the namespace dropdown to "%SYS" and check the box to include system items:In my example above the %Operator role has no permissions on SQL tables in %SYS.Use the Add Tables button to add a row that gives this role permission to perform a SELECT on the %SYS_Task.History table .
go to post John Murray · Jan 9, 2017 Aha! I have changed those two settings and I now see the extra columns of checkboxes.
go to post John Murray · Jan 9, 2017 I got a couple more of these over the weekend, despite having checked and altered my settings per your other post:
go to post John Murray · Jan 9, 2017 Thanks Eduard. I'd add, this has to be done from the %SYS namespace.
go to post John Murray · Jan 9, 2017 I think this limitation is unfortunate. Encountering the "Service unavailable" when you're trying to evaluate Caché for the first time might discourage you from continuing.
go to post John Murray · Jan 9, 2017 Quick'n'dirty way is to edit the cache.cpf file and then reactivate the config change. Simplest way to reactivate (though not always convenient) is to restart Caché.
go to post John Murray · Jan 6, 2017 My page looks different:As well as not having the extra checkboxes your screenshot shows, mine are all unchecked but I still get the notifications.
go to post John Murray · Jan 5, 2017 Thanks for doing that. The DC forum software didn't allow me to answer my own question.