|
Home > Archive > BizTalk Server Orchestration > March 2006 > Send mail
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
|
|
|
| Hi everyone....
I have the following problem:
"I must send a mail to different addresses".
I have this stored procedure:
CREATE PROCEDURE _select_mail
AS
SELECT _flusso_mail.idflusso, _fatturatore.email
from _flusso_mail left join _fatturatore on _flusso_mail.codresp =
_fatturatore.codfatt for xml auto, xmldata
GO
that return me an xml document and give me the email address (email) and the
email subject (idflusso), but both can't be promoted!! It'is also possible
that the <_fatturatore> is empty.
This is the xml returned:
<?xml version="1.0" encoding="utf-16"?>
<RequestMail xmlns="http://createmail1">
<Schema name="Schema1" xmlns="urn:schemas-microsoft-com:xml-data"
xmlns:dt="urn:schemas-microsoft-com:datatypes">
<ElementType name="_flusso_mail" content="eltOnly" model="closed"
order="many">
<element type="_fatturatore" maxOccurs="*" />
<AttributeType name="idflusso" dt:type="string" />
<attribute type="idflusso" />
</ElementType>
<ElementType name="_fatturatore" content="empty" model="closed">
<AttributeType name="email" dt:type="string" />
<attribute type="email" />
</ElementType>
</Schema>
<_flusso_mail xmlns="x-schema:#Schema1" idflusso="20060308_001__3300">
<_fatturatore />
</_flusso_mail>
<_flusso_mail xmlns="x-schema:#Schema1" idflusso="20060308_001__3500">
<_fatturatore />
</_flusso_mail>
<_flusso_mail xmlns="x-schema:#Schema1" idflusso="20060308_852__0200">
<_fatturatore email="egennari@cpl.it" />
</_flusso_mail>
</RequestMail>
How I can resolve this problem???
And which are the steps that I must follow????
Thanks
Anja
| |
| Greg Forsythe 2006-03-09, 5:52 pm |
| You can use a loop with xpath expressions.
create a counter variable =1
Loop Start
Expression shape
Subject = xpath(addressMessage, string("/*[local-name()='RequestMail' and
namespace-uri()='http://createmail1']/*[local-name()='_flusso_mail' and
namespace-uri()='x-schema:#Schema1' and position()=" + counter +
"]/@*[local-name()='idflusso' and namespace-uri()='x-schema:#Schema1']"));
Address = the same again selecting <_fatturatore />
Decide address length > 0
Send
Loop
Greg
"Anja" <anjagrillo@infinito.it> wrote in message
news:A94F9414-A7B8-497F-992C-F26D88DBB894@microsoft.com...
> Hi everyone....
> I have the following problem:
> "I must send a mail to different addresses".
>
> I have this stored procedure:
>
> CREATE PROCEDURE _select_mail
> AS
> SELECT _flusso_mail.idflusso, _fatturatore.email
> from _flusso_mail left join _fatturatore on _flusso_mail.codresp =
> _fatturatore.codfatt for xml auto, xmldata
> GO
>
> that return me an xml document and give me the email address (email) and
> the
> email subject (idflusso), but both can't be promoted!! It'is also possible
> that the <_fatturatore> is empty.
>
> This is the xml returned:
>
> <?xml version="1.0" encoding="utf-16"?>
> <RequestMail xmlns="http://createmail1">
> <Schema name="Schema1" xmlns="urn:schemas-microsoft-com:xml-data"
> xmlns:dt="urn:schemas-microsoft-com:datatypes">
> <ElementType name="_flusso_mail" content="eltOnly" model="closed"
> order="many">
> <element type="_fatturatore" maxOccurs="*" />
> <AttributeType name="idflusso" dt:type="string" />
> <attribute type="idflusso" />
> </ElementType>
> <ElementType name="_fatturatore" content="empty" model="closed">
> <AttributeType name="email" dt:type="string" />
> <attribute type="email" />
> </ElementType>
> </Schema>
> <_flusso_mail xmlns="x-schema:#Schema1" idflusso="20060308_001__3300">
> <_fatturatore />
> </_flusso_mail>
> <_flusso_mail xmlns="x-schema:#Schema1" idflusso="20060308_001__3500">
> <_fatturatore />
> </_flusso_mail>
> <_flusso_mail xmlns="x-schema:#Schema1" idflusso="20060308_852__0200">
> <_fatturatore email="egennari@cpl.it" />
> </_flusso_mail>
> </RequestMail>
>
> How I can resolve this problem???
> And which are the steps that I must follow????
>
> Thanks
> Anja
|
|
|
|
|