on 08-01-2007 4:17 PM
Hi Guys,
I have a requirement in which I have to send a message to an external server using HTTP but the external server it is expecting two xml one for Authenticate and the other with the message. So the message would look like this:
<?xml version='1.0'?>
<Authentication>
<user>User</user>
<pwd>Pwd</pwd>
</Authentication>
<?xml version='1.0'?>
<Message>
<customer>Customer</customer>
<Address>Address</Address>
</Message>
So I have to send this 2 xml to the external server.
the scenario is Sync RFC -> XI -> HTTP
Any Idea how to solve this?
Thanks
Omar Hernandez
Hi Omar !!
Do you need to send both messages in the same post?
check this thread:
/people/jin.shin/blog/2006/02/07/multi-mapping-without-bpm--yes-it146s-possible
Maybe you can use multimapping without bpm to create 2 messages,..one for the authentication and one for the content.
Regards,
Matias.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
hi,
think ur message might be inthis format as we need a root element for the XML
<?xml version="1.0">
<root>
<Authentication>
<user>User</user>
<pwd>Pwd</pwd>
</Authentication>
<Message>
<customer>Arrow</customer>
<Address>Wall st</Address>
</Message>
</root>
now to convert this to the format u want that is the following
<?xml version="1.0">
<Authentication>
<user>User</user>
<pwd>Pwd</pwd>
</Authentication>
<?xml version="1.0">
<Message>
<customer>Arrow</customer>
<Address>Wall st</Address>
</Message>
can u try the below XSLT
<?xml version="1.0"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="xml"></xsl:output>
<xsl:template match="/">
<xsl:apply-templates select="root/Authentication"></xsl:apply-templates>
<xsl:apply-templates select="root/Message"></xsl:apply-templates>
</xsl:template>
<!--
copy the Authentication node as it is in the source XML
-->
<xsl:template match="Authentication">
<xsl:copy-of select="."></xsl:copy-of>
</xsl:template>
<!--
processing for the Message node
-->
<xsl:template match="Message">
<xsl:text><?xml version="1.0"></xsl:text></xsl:text>
<xsl:call-template name="tag">
<xsl:with-param name="elemnt" select="name()"></xsl:with-param>
<xsl:with-param name="mode" select="'open'"></xsl:with-param>
</xsl:call-template>
<xsl:apply-templates select="*|node()"></xsl:apply-templates>
<xsl:call-template name="tag">
<xsl:with-param name="elemnt" select="name()"></xsl:with-param>
<xsl:with-param name="mode" select="'close'"></xsl:with-param>
</xsl:call-template>
</xsl:template>
<xsl:template match="*|node()">
<xsl:call-template name="tag">
<xsl:with-param name="elemnt" select="name()"></xsl:with-param>
<xsl:with-param name="mode" select="'open'"></xsl:with-param>
<xsl:with-param name="value" select="text()"></xsl:with-param>
</xsl:call-template>
<xsl:call-template name="tag">
<xsl:with-param name="elemnt" select="name()"></xsl:with-param>
<xsl:with-param name="mode" select="'close'"></xsl:with-param>
</xsl:call-template>
</xsl:template>
<xsl:template name="tag">
<xsl:param name="elemnt"></xsl:param>
<xsl:param name="mode"></xsl:param>
<xsl:param name="value"></xsl:param>
<xsl:choose>
<xsl:when test="$mode = 'open'">
<xsl:text><</xsl:text>
</xsl:when>
<xsl:otherwise>
<xsl:text></</xsl:text>
</xsl:otherwise>
</xsl:choose>
<xsl:value-of select="$elemnt"></xsl:value-of>
<xsl:text>></xsl:text>
<xsl:if test="(not($value = ''))">
<xsl:value-of select="$value"></xsl:value-of>
</xsl:if>
</xsl:template>
</xsl:stylesheet>
hope this helps, pls let me know
Hi Matias and Arvind,
Sorry for answering until now, but I was not able to work on it.
Well I solve it with a java mapping, so I am adding the Authentication message to the information msg on a java program. I cannot watch the message properly in the SXMB_MONI but if I can download the message and check if something is wrong.
Thanks you very much for the help
Points assigned
hi
follow this links
http://www.ecos.sourceware.org/ml/xsl-list/2000-12/msg00466.html
http://webservices.xml.com/lpt/a/1033
regards,
Santosh
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
85 | |
10 | |
10 | |
10 | |
7 | |
6 | |
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.