Topic
  • 3 replies
  • Latest Post - ‏2012-12-31T16:26:03Z by Daviiid
Daviiid
Daviiid
284 Posts

Pinned topic SOAP --> Domino SMTP

‏2012-12-31T15:08:30Z |
Hello

Here is a test message sent to Datapower


<S:Envelope xmlns:S=
"http://www.w3.org/2003/05/soap-envelope"> <S:Body> <ns2:SendMail xmlns:ns2=
"http://smabtp.fr/service/transverse/MailService/1.0/"> <to>david.leroux@smabtp.fr</to> <html><![CDATA[<b> message with HTML and accents</b> <br/> <a href=
"http://www.google.fr">click héèère</a>]]></html> <from>david.leroux@smabtp.fr</from> <subject>subject with accents : ééé èèèè</subject> </ns2:SendMail> </S:Body> </S:Envelope>


Here is a StyleSheet for sending email


<xsl:stylesheet version=
"1.0" xmlns:xsl=
"http://www.w3.org/1999/XSL/Transform" xmlns:dp=
"http://www.datapower.com/extensions" xmlns:mime=
"urn:iso:identified-organization:dod:internet:mail:mixer" xmlns:func=
"http://exslt.org/functions" extension-element-prefixes=
"dp" exclude-result-prefixes=
"func mime"> <xsl:output omit-xml-declaration=
"yes"/> <!-- some constants --> <xsl:variable name=
"CRLF" select=
"'&#13;&#10;'"/> <xsl:variable name=
"DDASH" select=
"'--'"/> <xsl:variable name=
"QUOT" select=
"'&quot;'"/> <xsl:template match=
"/"> <xsl:variable name=
"serializedHTMLData"> <dp:serialize select=
"//html" omit-xml-decl=
"yes"/> </xsl:variable> <xsl:variable name=
"dummy"> <dp:url-open response=
"responsecode-ignore" target=
"{concat( 
'smtp://', dp:encode(
'pluton0.smabtp.fr',
'url'), 
'/?Recpt=', dp:encode(
//to,'url'), 
'&amp;Sender=', dp:encode(
//from,'url'), 
'&amp;Subject=', dp:encode(
//subject,'url'), 
'&amp;Domain=', dp:encode(
'smabtp.fr',
'url'), 
'&amp;MIME=true' )
}
"> <xsl:value-of disable-output-escaping=
"yes" select=
"concat('MIME-Version: 1.0',$CRLF)"/> <xsl:value-of disable-output-escaping=
"yes" select=
"concat('Content-type: multipart/mixed; boundary=',$QUOT)"/> <xsl:value-of disable-output-escaping=
"yes" select=
"concat($boundary,$QUOT,$CRLF)"/> <xsl:value-of disable-output-escaping=
"yes" select=
"concat($CRLF,$CRLF,$DDASH,$boundary,$CRLF)"/> <xsl:value-of disable-output-escaping=
"yes" select=
"concat('Content-type: text/html',$CRLF,$CRLF)"/> <xsl:value-of disable-output-escaping=
"yes" select=
"$serializedHTMLData"/> <xsl:value-of disable-output-escaping=
"yes" select=
"concat($CRLF,$DDASH,$boundary,$CRLF)"/> <xsl:value-of disable-output-escaping=
"yes" select=
"concat($DDASH,$boundary,$DDASH,$CRLF)"/> <xsl:value-of disable-output-escaping=
"yes" select=
"concat('epilogue',$CRLF)"/> </dp:url-open> </xsl:variable> <dp:set-variable name=
"'var://context/INPUT/attachment-manifest'" value=
"NULL"/> <dp:set-variable name=
"'var://service/mpgw/skip-backside'" value=
"'1'"/> </xsl:template>   </xsl:stylesheet>


But the result in my Lotus Messagerie is not what i expect!

(ScreenShot attach)

I try many of things. One time, the text HTML is not recognize. One time, the HTML is recognize but the text with accent is strange..

Hermann, an idea?
Updated on 2012-12-31T16:26:03Z at 2012-12-31T16:26:03Z by Daviiid
  • Daviiid
    Daviiid
    284 Posts

    Re: SOAP --&gt; Domino SMTP

    ‏2012-12-31T15:27:08Z  
    If i change
    <xsl:variable name="serializedHTMLData">
                            <dp:serialize select="//html" omit-xml-decl="yes"/>
                    </xsl:variable>
    


    by

    <xsl:variable name="test">
                    <xsl:value-of select="//html" disable-output-escaping="yes"/>
            </xsl:variable>
     
                    <xsl:variable name="serializedHTMLData">
                            <dp:serialize select="$test" omit-xml-decl="yes"/>
                    </xsl:variable>
    


    The result is pretty good. The html code is interprete but not caracters with accents; (screenShot)
    Updated on 2014-03-25T02:44:06Z at 2014-03-25T02:44:06Z by iron-man
  • Daviiid
    Daviiid
    284 Posts

    Re: SOAP --&gt; Domino SMTP

    ‏2012-12-31T15:27:13Z  
    If i change
    <xsl:variable name="serializedHTMLData">
                            <dp:serialize select="//html" omit-xml-decl="yes"/>
                    </xsl:variable>
    


    by

    <xsl:variable name="test">
                    <xsl:value-of select="//html" disable-output-escaping="yes"/>
            </xsl:variable>
     
                    <xsl:variable name="serializedHTMLData">
                            <dp:serialize select="$test" omit-xml-decl="yes"/>
                    </xsl:variable>
    


    The result is pretty good. The html code is interprete but not caracters with accents; (screenShot)
    Updated on 2014-03-25T02:44:03Z at 2014-03-25T02:44:03Z by iron-man
  • Daviiid
    Daviiid
    284 Posts

    Re: SOAP --&gt; Domino SMTP

    ‏2012-12-31T16:26:03Z  
    • Daviiid
    • ‏2012-12-31T15:27:13Z
    If i change
    <pre class="java dw" data-editor-lang="java" data-pbcklang="java" dir="ltr"><xsl:variable name="serializedHTMLData"> <dp:serialize select="//html" omit-xml-decl="yes"/> </xsl:variable> </pre>

    by

    <pre class="java dw" data-editor-lang="java" data-pbcklang="java" dir="ltr"><xsl:variable name="test"> <xsl:value-of select="//html" disable-output-escaping="yes"/> </xsl:variable> <xsl:variable name="serializedHTMLData"> <dp:serialize select="$test" omit-xml-decl="yes"/> </xsl:variable> </pre>

    The result is pretty good. The html code is interprete but not caracters with accents; (screenShot)
    I found a solution for the body of the message. Force Content-Type with charset=utf-8
    But no solution yet for subject