on 05-23-2008 7:04 AM
Hi,experts:
I meet a urgent problem.
It's a PROXY<=>XI<=>SOAP scenario with Qos:BE.
The SOAP receiver returns a XML data base on follow structure:
<?xml version="1.0" encoding="UTF-8" ?>
<ns0:GetCigaXYDataForJAVAResponse xmlns:ns0="http://localhost/CigaTransService/GetCigaXYDataForJAVA/SU">
<GetCigaXYDataForJAVAResult type=""> <NewDataSet>test</NewDataSet> </GetCigaXYDataForJAVAResult>
</ns0:GetCigaXYDataForJAVAResponse>
Attention pls,<NewDataSet>test</NewDataSet> is the value of element "GetCigaXYDataForJAVAResult".It means a xml data is nested in a xml element.OMG.How can i parse a element value to another xml data!
I want to put the value "test" to a xml element named "NewDataSet"
Using a Java mapping would be the simplest solution. If the response is just a simple XML tag then you can directly use some string functions and achieve the desired results easily.
Regards,
Jaishankar
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Check the links for xml parsing:
/people/bhavesh.kantilal/blog/2006/11/20/webservice-calls-from-a-user-defined-function
/people/alessandro.guarneri/blog/2006/03/27/sap-xi-lookup-api-the-killer
Reward points if helpful
Regards,
Soumya
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,experts:
Finally,i use an abap mapping to solve it.Following is the abap code in XI:
METHOD IF_MAPPING~EXECUTE.
DATA: lr_conv_ci TYPE REF TO CL_RPE_CONVERT .
DATA LS_SOURCE TYPE STRING.
CREATE OBJECT LR_CONV_CI.
CALL METHOD lr_conv_ci->XSTRING_TO_STRING
EXPORTING
INPUT = SOURCE
IMPORTING
OUTPUT = LS_SOURCE.
REPLACE ALL OCCURRENCES OF '& lt;' IN LS_SOURCE WITH '《'.
REPLACE ALL OCCURRENCES OF '& quot;' IN LS_SOURCE WITH 'u2018'.
REPLACE ALL OCCURRENCES OF '& gt;' IN LS_SOURCE WITH '》'.
REPLACE ALL OCCURRENCES OF 'GetCigaXYDataForJAVAResult' IN LS_SOURCE WITH 'GetCigaXYDataResult'.
CALL METHOD lr_conv_ci->STRING_TO_XSTRING
EXPORTING
INPUT = LS_SOURCE
IMPORTING
OUTPUT = RESULT.
ENDMETHOD.
regards
yu ming
Hello,
I think you have to do mapping in IR to convert the given XML to another XML (this is for making the inner XML data not to be parsed )
Check if this weblog is of any help to you - /people/michal.krawczyk2/blog/2005/11/01/xi-xml-node-into-a-string-with-graphical-mapping
***************Reward points,if found useful
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
95 | |
11 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.