<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: &amp;quot;not well-formed (invalid token)&amp;quot; error with SDK Perl API in Software Development Kit (SDK) and API Discussions</title>
    <link>https://community.netapp.com/t5/Software-Development-Kit-SDK-and-API-Discussions/quot-not-well-formed-invalid-token-quot-error-with-SDK-Perl-API/m-p/31927#M978</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;SDK is limited to support UTF-8 character encoding. Any data that is sent by the ONTAP that is not UTF-8 will &lt;/P&gt;&lt;P&gt;result in xml parsing errors. What is the volume language set for the volume which has non-ascii characters?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;There is no workaround from SDK, but you can try NaServer::set_debug_style("NA_PRINT_DONT_PARSE") core API which will just prints (not parse)&lt;/P&gt;&lt;P&gt;the raw xml data of the API response. You need to apply some logic to extract the required values from the raw xml. &lt;/P&gt;&lt;P&gt;This this is something hard to do.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 25 Mar 2010 15:15:38 GMT</pubDate>
    <dc:creator>rkiran</dc:creator>
    <dc:date>2010-03-25T15:15:38Z</dc:date>
    <item>
      <title>"not well-formed (invalid token)" error with SDK Perl API</title>
      <link>https://community.netapp.com/t5/Software-Development-Kit-SDK-and-API-Discussions/quot-not-well-formed-invalid-token-quot-error-with-SDK-Perl-API/m-p/31921#M977</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I'm facing this nasty bug when invoking nfs-exportfs-list-rules-2 with perl API (latest SDK 3.5.1).&lt;/P&gt;
&lt;P&gt;Obviously, perl XLM parser does not like the API answer.&lt;/P&gt;
&lt;P&gt;I know why this occurs. One of the /etc/exports entry has non-ascii byte.&lt;/P&gt;
&lt;P&gt;This path has ntfs security and is shared thru CIFS and NFS.&lt;/P&gt;
&lt;P&gt;This non-ascii (special french char) seems to not cause any other trouble, neither on the filer itself (regarding exportfs rules), nor on the unix NFS clients.&lt;/P&gt;
&lt;P&gt;The filer is running DOT 7.2.6.1.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Any help appreciated.&lt;/P&gt;
&lt;P&gt;Fighting with users about the path name (back to pure ascii) will not be a piece of cake !&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks&lt;/P&gt;
&lt;P&gt;Eric&lt;/P&gt;</description>
      <pubDate>Thu, 05 Jun 2025 07:16:28 GMT</pubDate>
      <guid>https://community.netapp.com/t5/Software-Development-Kit-SDK-and-API-Discussions/quot-not-well-formed-invalid-token-quot-error-with-SDK-Perl-API/m-p/31921#M977</guid>
      <dc:creator>ethomas1664</dc:creator>
      <dc:date>2025-06-05T07:16:28Z</dc:date>
    </item>
    <item>
      <title>Re: "not well-formed (invalid token)" error with SDK Perl API</title>
      <link>https://community.netapp.com/t5/Software-Development-Kit-SDK-and-API-Discussions/quot-not-well-formed-invalid-token-quot-error-with-SDK-Perl-API/m-p/31927#M978</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;SDK is limited to support UTF-8 character encoding. Any data that is sent by the ONTAP that is not UTF-8 will &lt;/P&gt;&lt;P&gt;result in xml parsing errors. What is the volume language set for the volume which has non-ascii characters?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;There is no workaround from SDK, but you can try NaServer::set_debug_style("NA_PRINT_DONT_PARSE") core API which will just prints (not parse)&lt;/P&gt;&lt;P&gt;the raw xml data of the API response. You need to apply some logic to extract the required values from the raw xml. &lt;/P&gt;&lt;P&gt;This this is something hard to do.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 25 Mar 2010 15:15:38 GMT</pubDate>
      <guid>https://community.netapp.com/t5/Software-Development-Kit-SDK-and-API-Discussions/quot-not-well-formed-invalid-token-quot-error-with-SDK-Perl-API/m-p/31927#M978</guid>
      <dc:creator>rkiran</dc:creator>
      <dc:date>2010-03-25T15:15:38Z</dc:date>
    </item>
    <item>
      <title>Re: "not well-formed (invalid token)" error with SDK Perl API</title>
      <link>https://community.netapp.com/t5/Software-Development-Kit-SDK-and-API-Discussions/quot-not-well-formed-invalid-token-quot-error-with-SDK-Perl-API/m-p/31934#M979</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks a lot for the clarification.&lt;/P&gt;&lt;P&gt;Actually the language for this volume is "fr (french)".&lt;/P&gt;&lt;P&gt;So you must be right. I'll simply do some test to confirm.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now being able to identify the "bad boys", at least this provides me some alternatives:&lt;/P&gt;&lt;P&gt;- run with debug activated and parse by myself. I'll give it a try.&lt;/P&gt;&lt;P&gt;- failback to really old SNMP or RSH method, which I really hate, to say the least...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Eric&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 26 Mar 2010 09:18:37 GMT</pubDate>
      <guid>https://community.netapp.com/t5/Software-Development-Kit-SDK-and-API-Discussions/quot-not-well-formed-invalid-token-quot-error-with-SDK-Perl-API/m-p/31934#M979</guid>
      <dc:creator>ethomas1664</dc:creator>
      <dc:date>2010-03-26T09:18:37Z</dc:date>
    </item>
    <item>
      <title>Re: "not well-formed (invalid token)" error with SDK Perl API</title>
      <link>https://community.netapp.com/t5/Software-Development-Kit-SDK-and-API-Discussions/quot-not-well-formed-invalid-token-quot-error-with-SDK-Perl-API/m-p/31939#M980</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If someone cares, here is the workaround I've implemented.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Read /etc/exports on root volume thru file-read-file API.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Remove entries starting with #.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; I assume the file match the currently load rules. In the worst case some path might not exist anymore. Armless for me.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Analyse each path to check if it's UTF-8 encoded or not (obviously, UTF-8 volumes need UTF-8 encoded export path to work, and non-UTF-8 volumes need non-UTF-8 export path).&lt;/P&gt;&lt;P&gt;Keep the information in an array or hash.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If no such non-UTF-8 path has been found, don't do anything specia. You can call nfs-exportfs-rules-list-2.&lt;/P&gt;&lt;P&gt;Sure, if someone has manually exported a non-UTF-8 path, You've lost !&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If there is some non-UTF-8 path.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Activate the "NA_PRINT_DONT_PARSE" debug option.&lt;/P&gt;&lt;P&gt;Duplicate STDOUT to some other file descriptor (to avoid debug output).&lt;/P&gt;&lt;P&gt;Call nfs-exportfs-rules-list-2 but don't care about the exit code because of course it will not be OK !&lt;/P&gt;&lt;P&gt;Restore standard STDOUT (if you need it later).&lt;/P&gt;&lt;P&gt;Get the XML raw output from $session-&amp;gt;{xml}&lt;/P&gt;&lt;P&gt;DON'T blindly convert the whole XML data to UTF-8 with encode perl function. Because if you do that and have some path with true UTF-8 chars (for other volumes), as they use prefix bytes they will be converted again. So you'll fix a problem but create another one.&lt;/P&gt;&lt;P&gt;For each non-UTF-8 path detected previously, do a search/replace work in the XML data to replace those path with their UTF-8 version.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now the XML data is really UTF-8 compliant, we can do manually what invoke should have done at the very end:&lt;/P&gt;&lt;P&gt;$inv = $session-&amp;gt;parse_xml($XML, '&amp;lt;nfs-exportfs-list-rules-2&amp;gt;&amp;lt;/nfs-exportfs-list-rules-2&amp;gt;');&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This solution applies for calling nfs-exportfs-list-rules-2 with no option to get all the information in one shot.&lt;/P&gt;&lt;P&gt;It's also possible to call it for each exported path as an arg, and then determine easily if the workaround is needed or not for each path.&lt;/P&gt;&lt;P&gt;But I see no benefit for it if you need all the information.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It works for me. but I don't expect it to be bulletproof...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 26 Mar 2010 17:08:32 GMT</pubDate>
      <guid>https://community.netapp.com/t5/Software-Development-Kit-SDK-and-API-Discussions/quot-not-well-formed-invalid-token-quot-error-with-SDK-Perl-API/m-p/31939#M980</guid>
      <dc:creator>ethomas1664</dc:creator>
      <dc:date>2010-03-26T17:08:32Z</dc:date>
    </item>
    <item>
      <title>Re: "not well-formed (invalid token)" error with SDK Perl API</title>
      <link>https://community.netapp.com/t5/Software-Development-Kit-SDK-and-API-Discussions/quot-not-well-formed-invalid-token-quot-error-with-SDK-Perl-API/m-p/31944#M981</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Recently I also faced this kind of issue in which volume language set as french. After closing analyzing the NaServer.pm module I resolved the problem by adding following code in parse_xml method:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;#$p-&amp;gt;parse($xml);&amp;nbsp; #commented by Pallav Gupta, as earlier it was not supporting accent character parsing.&lt;/P&gt;&lt;P&gt; $p-&amp;gt;parse($xml, ProtocolEncoding =&amp;gt; 'ISO-8859-1');&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Pallav Gupta&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 17 Oct 2013 14:11:27 GMT</pubDate>
      <guid>https://community.netapp.com/t5/Software-Development-Kit-SDK-and-API-Discussions/quot-not-well-formed-invalid-token-quot-error-with-SDK-Perl-API/m-p/31944#M981</guid>
      <dc:creator>PALLAVGUPTA84</dc:creator>
      <dc:date>2013-10-17T14:11:27Z</dc:date>
    </item>
  </channel>
</rss>

