Topic
  • 8 replies
  • Latest Post - ‏2012-04-12T11:11:53Z by Daviiid
Daviiid
Daviiid
349 Posts

Pinned topic Error in response SMTP

‏2012-04-11T14:05:07Z |
HEllo

I don't understand why there is this error in response smtp server

<url-open>
<errorcode>196609</errorcode>
<errorstring>Incomplete markup or missing document element at offset 0 of smtp://pluton0.smabtp.fr:25/?Recpt=davioux@statap.fr&Sender=DATAPOWER@dt45d1.fr&Subject=EncoreUnTest</errorstring>
</url-open>

My xsl here
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:dp="http://www.datapower.com/extensions" extension-element-prefixes="dp">
<xsl:template match="/">

<dp:url-open target="smtp://pluton0.smabtp.fr:25/?Recpt=davioux@statap.fr&amp;Sender=DATAPOWER@dt45d1.fr&amp;Subject=EncoreUnTest" response="responsecode">
<xsl:value-of select="'hey hey'"/>
</dp:url-open>

<dp:set-variable name="'var://service/mpgw/skip-backside'" value="'1'"/>
</xsl:template>
</xsl:stylesheet>

Thanks for the response
Updated on 2012-04-12T11:11:53Z at 2012-04-12T11:11:53Z by Daviiid
  • kenhygh
    kenhygh
    2164 Posts

    Re: Error in response SMTP

    ‏2012-04-11T14:54:40Z  
    I think you'll need to url encode the '@' character to %40

    Ken
  • HermannSW
    HermannSW
    6384 Posts

    Re: Error in response SMTP

    ‏2012-04-11T17:11:11Z  
    • kenhygh
    • ‏2012-04-11T14:54:40Z
    I think you'll need to url encode the '@' character to %40

    Ken
    > I think you'll need to url encode the '@' character to %40
    >
    correct, and more generally the whole URL needs to be URL encoded.
    This can simply be done by
    dp:encode('smtp://pluton0.smabtp.fr:25/?Recpt=davioux@statap.fr&​amp;Sender=DATAPOWER@dt45d1.fr&​amp;Subject=EncoreUnTest','url')
    as in this posting:
    https://www.ibm.com/developerworks/mydeveloperworks/blogs/HermannSW/tags/smtp

     
    Hermann<myXsltBlog/>
  • Daviiid
    Daviiid
    349 Posts

    Re: Error in response SMTP

    ‏2012-04-11T17:51:40Z  
    • HermannSW
    • ‏2012-04-11T17:11:11Z
    > I think you'll need to url encode the '@' character to %40
    >
    correct, and more generally the whole URL needs to be URL encoded.
    This can simply be done by
    dp:encode('smtp://pluton0.smabtp.fr:25/?Recpt=davioux@statap.fr&​amp;Sender=DATAPOWER@dt45d1.fr&​amp;Subject=EncoreUnTest','url')
    as in this posting:
    https://www.ibm.com/developerworks/mydeveloperworks/blogs/HermannSW/tags/smtp

     
    Hermann<myXsltBlog/>
    Thanks for responses

    But i have no problem with url because the mail sent correctly and i received it.

    But i have error when reading response

    <url-open>
    <errorcode>196609</errorcode>
    <errorstring>Incomplete markup or missing document element at offset 0 of smtp://pluton0.smabtp.fr:25/?Recpt=davioux@statap.fr&Sender=DATAPOWER@dt45d1.fr&Subject=EncoreUnTest</errorstring>
    </url-open>

    I don't understand how it's possible to sent email correctly and have an error at the same time :-(
  • msiebler
    msiebler
    142 Posts

    Re: Error in response SMTP

    ‏2012-04-11T18:22:42Z  
    • Daviiid
    • ‏2012-04-11T17:51:40Z
    Thanks for responses

    But i have no problem with url because the mail sent correctly and i received it.

    But i have error when reading response

    <url-open>
    <errorcode>196609</errorcode>
    <errorstring>Incomplete markup or missing document element at offset 0 of smtp://pluton0.smabtp.fr:25/?Recpt=davioux@statap.fr&Sender=DATAPOWER@dt45d1.fr&Subject=EncoreUnTest</errorstring>
    </url-open>

    I don't understand how it's possible to sent email correctly and have an error at the same time :-(
    The problem is that by default the url-open extension function (and also soap-call) expect to receive an XML response from the server;
    as usual when using HTTP
    But of course there is no such response for SMTP
    The error is saying; I was trying to parse the response as XML form the SMTP server but right away at byte zero noticed that this is not XML (if there was any response at all)

    So you need to choose the parameter for 'response' to be 'ignore' or 'responsecode-ignore'
    That will tell the box ; there is no XML data coming back from the server; so just throw away the response data.

    e.g. <dp:url-open target="smtp://..." response="ignore">...</dp:url-open>
  • Daviiid
    Daviiid
    349 Posts

    Re: Error in response SMTP

    ‏2012-04-11T20:19:38Z  
    • msiebler
    • ‏2012-04-11T18:22:42Z
    The problem is that by default the url-open extension function (and also soap-call) expect to receive an XML response from the server;
    as usual when using HTTP
    But of course there is no such response for SMTP
    The error is saying; I was trying to parse the response as XML form the SMTP server but right away at byte zero noticed that this is not XML (if there was any response at all)

    So you need to choose the parameter for 'response' to be 'ignore' or 'responsecode-ignore'
    That will tell the box ; there is no XML data coming back from the server; so just throw away the response data.

    e.g. <dp:url-open target="smtp://..." response="ignore">...</dp:url-open>
    All right

    But what's happened if email adress is invalid (or another error on smtp server) with response ignore?
    Is it possible to catch exception?

    And i have not test yet response = "binaryNode". Is that makes sens?
  • msiebler
    msiebler
    142 Posts

    Re: Error in response SMTP

    ‏2012-04-11T23:29:43Z  
    • Daviiid
    • ‏2012-04-11T20:19:38Z
    All right

    But what's happened if email adress is invalid (or another error on smtp server) with response ignore?
    Is it possible to catch exception?

    And i have not test yet response = "binaryNode". Is that makes sens?
    Depending on the protocol; 'responsecode-ignore' may return the error code if there is an error.
    'binary' may also work.
  • HermannSW
    HermannSW
    6384 Posts

    Re: Error in response SMTP

    ‏2012-04-12T10:29:25Z  
    • msiebler
    • ‏2012-04-11T23:29:43Z
    Depending on the protocol; 'responsecode-ignore' may return the error code if there is an error.
    'binary' may also work.
    From generic url-open Infocenter page:
    http://publib.boulder.ibm.com/infocenter/wsdatap/4mt/index.jsp?topic=%2Fcom.ibm.dp.xm.doc%2Fextensionfunctions35.htm&resultof=%22url-open%22

    response = "xml | binaryNode | ignore | responsecode | responsecode-ignore"
    ...
    ...
    responsecode and responsecode-ignore
    . Enable testing of received protocol status codes
    ...

     
    Hermann<myXsltBlog/>
  • Daviiid
    Daviiid
    349 Posts

    Re: Error in response SMTP

    ‏2012-04-12T11:11:53Z  
    • HermannSW
    • ‏2012-04-12T10:29:25Z
    From generic url-open Infocenter page:
    http://publib.boulder.ibm.com/infocenter/wsdatap/4mt/index.jsp?topic=%2Fcom.ibm.dp.xm.doc%2Fextensionfunctions35.htm&resultof=%22url-open%22

    response = "xml | binaryNode | ignore | responsecode | responsecode-ignore"
    ...
    ...
    responsecode and responsecode-ignore
    . Enable testing of received protocol status codes
    ...

     
    Hermann<myXsltBlog/>
    Thanks for all responses :)