on 04-05-2006 8:18 AM
Hi,
I have the following scenario:
A string stream is received from a SOAP adapter. From this I extract a part that is in essence a XML document.
I then parse this into a DOM Document object.
I want to pass this XML structure on to other graphical mapping functions so that I can map parts of this document to other structures. I cannot add it to the 'result' object in an 'Advanced user defined function'
Do I have to add it to some component of the 'container' object passed to the function ?. If not - any ideas of how I would do this ?.
Thanks
Andre
Hi Andra,
You can have multiple message mapping for a single Interface mapping.
All you have to do is:
message Mapping1: struc1 Dom mapping Struc2
Message Mapping2: struc2 Graphical mapping struc3
One Interface mapping
struc1 DOM mapping struc3
Graphical mapping
Hope this helps.
Regards
Vijaya
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Vijaya,
I'm not completely following what you are trying to explain.
My problem is the following :
try {
DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance( );
DocumentBuilder builder = factory.newDocumentBuilder( );
ByteArrayInputStream inputStr = new ByteArrayInputStream( request[0].getBytes( ) );
Document document = builder.parse( inputStr );
<b>result.addValue( document );</b>
} catch (Exception e) {
MappingTrace trace = container.getTrace( );
trace.addInfo( e.getMessage( ) );
}
The result.aadvalue method call results in a compilation error as it seems that result can only tke String values.
Where would I put the 'document' to be able to use it in latter parts of the mapping.
Thanks
Andre
Hi Vijaya,
I'm not completely following what you are trying to explain.
My problem is the following :
try {
DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance( );
DocumentBuilder builder = factory.newDocumentBuilder( );
ByteArrayInputStream inputStr = new ByteArrayInputStream( request[0].getBytes( ) );
Document document = builder.parse( inputStr );
<b>result.addValue( document );</b>
} catch (Exception e) {
MappingTrace trace = container.getTrace( );
trace.addInfo( e.getMessage( ) );
}
The result.addvalue method call results in a compilation error as it seems that result can only tke String values.
Where would I put the 'document' to be able to use it in latter parts of the mapping.
Thanks
Andre
Hi Andre,
It looks to me like you have an XML document with another XML document embedded (and encoded) inside some element. Something like:
<outerDoc>
<element>
<innerDoc> ...more embedded XML... </innerDoc>
</element>
</outerDoc>
It is not possible to both "unwrap" the inner document and continue to work on it in a graphical mapping. The simplest approach is to have 2 mapping steps in your interface mapping:
1. A pure Java mapping in which you get the complete outer document as input, parse your way through and extract the inner document, which is the output of this first mapping step.
2. A graphical mapping which has your inner document as input and your final result as output.
Hope that clarifies it somewhat
Best regards,
Thorsten
User | Count |
---|---|
98 | |
11 | |
11 | |
10 | |
10 | |
8 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.