XPath unbound namespace exception, but only in exported job

One Star

XPath unbound namespace exception, but only in exported job

Hi
I'm extracting the elements (updated, created, ignored, error) of a tSOAP response with tExtractCMLField. The structure of the response (sorry, I had to insert spaces in http and https, otherwise the URL seem to be deleted automatically when publishing the post):
<SOAP-ENV:Envelope xmlns:SOAP-ENV="h t t p://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="h t t p s://mycompany.com/soap.php/soap/profile">
  <SOAP-ENV:Body>
     <ns1:massUpdateResponse>
        <massUpdateResult>
           <updated>
              <items>
                 <item>
                    <key>1687781</key>
                    <value>2514652</value>
                 </item>
                 <item>
                    <key>1687779</key>
                    <value>2333599</value>
                 </item>
                 <item>
                    <key>1687780</key>
                    <value>2507277</value>
                 </item>
                 <item>
                    <key>1687793</key>
                    <value>2218613</value>
                 </item>
              </items>
           </updated>
           <created>
              <items/>
           </created>
           <ignored>
              <item>487841545</item>
              <item>467944241</item>
           </ignored>
           <error/>
        </massUpdateResult>
     </ns1:massUpdateResponse>
  </SOAP-ENV:Body>
</SOAP-ENV:Envelope>

The settings oft tExtractXMLField:

The job runs perfectly in TOS, but after exporting it as a standalone job, the command prompt reports the following error:
Exception occurred evaluting XPath: /SOAP-ENV:Envelope/SOAP-ENV:Body/ns1:massUpdateResponse/massUpdateResult. Exception: XPath expression uses unbound namespace prefix ns1
What's causing this error? And why doesn't it occur when running the job in TOS?
Thanks
Tom
Community Manager

Re: XPath unbound namespace exception, but only in exported job

Hi 
Can you please upload a screenshot of your job? tSOAP returns a string response in Body column, tExtractXMLField should extract values from Body field, however, I see it is 'Soap' field in your component settings, is it a custom component?
Regards
Shong
----------------------------------------------------------
Talend | Data Agility for Modern Business
One Star

Re: XPath unbound namespace exception, but only in exported job

The first screenshot shows the whole job. As you can see, it runs without any error in TOS (i get the error only after publishing the Java files).
I don't use any custom components, just the regular ones from TOS. But I've set the tSOAP component to generate the output in a document, that's why the setting of tExtractXMLField shows 'Soap'. Actually, I didn't figure out how to extract all the wanted fields, so I use tExtractXMLField to extract the whole section <ns1:massUpdateResponse>
Afterwards I use tXMLMapOut (second screenshot) to loop through the items of <updated>, <ignored>, <created> and <error> and send each row three different tMSSqlRow components.
I guess there would be more elegant ways to do that, but it seems to work (at least when running the job in TOS...)
Kind regards
Tom
  
btw: everytime I'm publishing a post, all the images are deleted. Is that a known issue or am I doing something wrong?
One Star

Re: XPath unbound namespace exception, but only in exported job

This problem is still unsolved.
Any suggestions?
One Star

Re: XPath unbound namespace exception, but only in exported job

Hello,
Can you try the below options either of the one and see whether you are still getting the issue or not.
--> On the SOAP-ENV:Envelope right click and add a default names space "env" and prefix the same with "env" .
OR
--> can you change below one and see
xmlnsSmiley FrustratedOAP-ENV="h t t p://schemas.xmlsoap.org/soap/envelope/" --> xmlnsSmiley FrustratedOAP-ENV="h t t p://www.w3.org/2003/05/soap-envelope"
Please let me know how it goes..