cancel
Showing results for 
Search instead for 
Did you mean: 

File soap file

Former Member
0 Kudos

I have a scenario file soap file.

For file i have an xml which i am importing in message mapping & for soap I have an xsd only with 1 field.But in file xml they were so many fields,can i map all the source fields to one target one xsd field.

Can any one help me how to proceed for this scneario i need to update the webservice..

Thanks

sriram

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

Henrique

Thanks,I have seen the links which u have send even my scenrio simailar to webservice scenario,i need to send source as string to update the webservice.I have source as an xml & target xsd with 1 field(I need to send the string to the target field) using stlyus sheet converted to an xsl can u please brief me....how to proceed.because my file is not picking up from the source.

Thanks

sriram

henrique_pinto
Active Contributor
0 Kudos

The codes that I've provided in that thread were the ones that I'm actually using.

XML to String:

<?xml version="1.0" encoding="UTF-8"?>

<xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:mns="http://my_namespace">

<xsl:template match="/">

<mns:my_tag>

<xsl:text disable-output-escaping="yes"><![CDATA[<![CDATA[]]></xsl:text>

<xsl:copy-of select="/"/>

<xsl:text disable-output-escaping="yes"><![CDATA[]]]]></xsl:text>

<xsl:text disable-output-escaping="yes"><![CDATA[>]]></xsl:text>

</mns:my_tag>

</xsl:template>

</xsl:stylesheet>

String to XML:

<?xml version="1.0" encoding="UTF-8"?>

<xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:mns="http://my_namespace">

<xsl:template match="/">

<xsl:for-each select="//mns:my_tag">

<xsl:value-of select="." disable-output-escaping="yes"/>

</xsl:for-each>

</xsl:template>

</xsl:stylesheet>

The first one transforms your xml to a string and put it in <mns:my_tag> tag. The second one removes the string from this tag to a xml file. Save these two codes in different .xsl files, compact them to a .zip file and import it in Imported Archives, under Mapping Objects in Integration Repository.

Then, just create a interface mapping from your full message to the message with just 1 string element and use the 1st XSL as the message mapping. Do another interface mapping, from the 1-element message to the full message, using the 2nd XSL.

Regards,

Henrique.

Former Member
0 Kudos

Thanks Moorhty

I need to send all the fields from source as a string to 1 target field,How to concatenate 20 source fields to 1 target field.

Thanks

sriram

henrique_pinto
Active Contributor
0 Kudos

but your string needs to contain the tags and the field values? or only the values?

Anyway, you can perform this using XSLT mapping.

Check out these links:

/people/michal.krawczyk2/blog/2005/11/01/xi-xml-node-into-a-string-with-graphical-mapping

moorthy
Active Contributor
0 Kudos

In simpler terms, you can make use of existing standard function of String Concat operation in the graphical mapping...Which will take 2 inputs and give you concatenated result. like this you need to concate for all the fields 2 at a time.

Even you can write java function for this. But it will take only 12 fields at a time as an input(as i remember) Your mapping editor will look some messy here!!!!

Regards,

Moorthy

moorthy
Active Contributor
0 Kudos

Hi,

<i> file xml they were so many fields,can i map all the source fields to one target one xsd field.</i>

>>>It depends on the Mapping Rules/Business Requirements.

If you want to map all the source fields into the target fields in the Mapping as per the Business Requirement, then you can concatenate all the fields and map with the target field.

If your requirement is to map only one field from the source, then you can ignore other fields from the source.

Hope this helps,

Regards,

Moorthy