英文:
IICS: How to deal with API which returns first character as a number but not letter?
问题
嗨,Informatica开发者,
我正在处理基于XML的REST API。我想从API获取数据并保存到平面文件中。
然而,一个问题是,这个API返回的对象的第一个字符以数字开头而不是字母。以下是API的示例响应:
<sg_response>
<sgscore>
<scores>
<score>
<period>2022-07</period>
<score>650</score>
<min>405</min>
<25th>585</25th>
<50th>660</50th>
<75th>710</75th>
<max>830</max>
</score>
因此,当我创建映射时,我遇到了这个错误:
因此,我修改了输出字段,我在列名前面添加了一个 'p':
这样映射回API响应:
然而,这不能解决问题,当我运行映射时,我遇到了这个错误:
[致命错误] 找不到服务 'WebServices_h2r_udt_1i5fk_ONLY_H2R_XMAP_H2R - <Status><severity>4</severity><Event error_code="420000" severity="error_fatal"> <identifier>m.contains.i0.contains.i3</identifier> <description>Map: './25th' is not a valid XPath. (Invalid literal found: 25th [err:XPST0003]).- for more information see file://D:/SecureAgent/apps/Data_Integration_Server/data/CMReports/Tmp/2023-07-04/CmInternal_ServiceValidator_A7d55926e-5699-4473-aee4-7829973da881/Events.cme</description> <log_file>D:/SecureAgent/apps/Data_Integration_Server/data/CMReports/Tmp/2023
根据错误,我猜问题应该是由于25th、50th、75th的问题,因为错误中说 ""'./25th' is not a valid XPath. (Invalid literal found: 25th [err:XPST0003]"
你有没有想法如何解决这个问题?你是否遇到过API返回第一个字符为数字而不是字母的情况?你知道如何修改XPath吗?非常感谢你的帮助!
英文:
Hi informatica developers,
I am working on a XML-based REST API. I want to get the data from the API and save it to a flat file.
However, one problem is that this API is returning the object whose first character starts with number but not letters. Below is an example response from the API:
<sg_response>
<sgscore>
<scores>
<score>
<period>2022-07</period>
<score>650</score>
<min>405</min>
<25th>585</25th>
<50th>660</50th>
<75th>710</75th>
<max>830</max>
</score>
So when I create the mapping, I got this error:
Hence, I modified the output fields, I added a 'p' in front of the column name:
Which mapped back to the API response like this:
However this cannot solve the problem, when I run the mapping I got this error:
[FATAL] Service Info not found for the service 'WebServices_h2r_udt_1i5fk_ONLY_H2R_XMAP_H2R - <Status><severity>4</severity><Event error_code="420000" severity="error_fatal"> <identifier>m.contains.i0.contains.i3</identifier> <description>Map: './25th' is not a valid XPath. (Invalid literal found: 25th [err:XPST0003]).- for more information see file://D:/SecureAgent/apps/Data_Integration_Server/data/CMReports/Tmp/2023-07-04/CmInternal_ServiceValidator_A7d55926e-5699-4473-aee4-7829973da881/Events.cme</description> <log_file>D:/SecureAgent/apps/Data_Integration_Server/data/CMReports/Tmp/2023
Based on the error I guess the problem should be caused by the 25th, 50th, 75th issue, because in the error it says "'./25th' is not a valid XPath. (Invalid literal found: 25th [err:XPST0003]"
Do you have any ideas as how to solve the problem? Have you encountered with an API who returns the first character as a number but not a letter? Do you know how to modify the XPath? Thank you so much for your help!
答案1
得分: 1
I have contacted Informatica support, and they say that this function is just disallowed. They have created a change request to add this function in the future.
For now, if you really need to do this task, one has to use Java transformation and intelligent parser to achieve this.
英文:
to whom who has similar questions, I have contacted Informatica support, and they says that this function is just disallowed. They have created a change request to add this function in the future.
For now, if really need to do this task, one has to use Java transformation and intelligent parser to achieve this.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论