The service enables you to send an email message (new or existing) to a single
recipient (new or existing)
Parameters:
The service returns the SendingResult
Java Code:
SendingResult sendResult = soapService.send(source, target);
if (sendResult.isIsSuccess()) {
String sendId = sendResult.getIds().getString().get(0);
return "Transaction Id: " + sendId;
} else {
ErrorDetails errorDetails = sendResult.getErrorDetails();
return Utils.BuildErrorMessage(errorDetails);
}
C# Code:
//// use the new service url
InwiseService.InwiseService
service = new InwiseService.InwiseService();
service.Url = logonResult.ServiceUrl;
//// prepare headers
service.SessionIdHeaderValue = new
SessionIdHeader()
{
SessionId = logonResult.SessionId
};
//// call the service
SendingResult sendResult
= service.Send(source, target);
//// check the results
if (sendResult.IsSuccess)
{
String
sendId = sendResult.Ids[0];
return "Transaction Id: " + sendId;
}
else
{
ErrorDetails
errorDetails = sendResult.ErrorDetails;
return Utils.BuildErrorMessage(errorDetails);
}
VB Code:
'' use the new service url
Dim service As
New InwiseService.InwiseService()
service.Url
= logonResult.ServiceUrl
'' prepare headers
service.SessionIdHeaderValue
= New SessionIdHeader()
With { _
.SessionId = logonResult.SessionId _
}
'' call the service
Dim sendResult As
SendingResult = service.Send(source, target)
'' check the results
If sendResult.IsSuccess Then
Dim sendId As
[String] = sendResult.Ids(0)
Return "Transaction
Id: " & sendId
Else
Dim errorDetails As
ErrorDetails = sendResult.ErrorDetails
Return Utils.BuildErrorMessage(errorDetails)
End If
Raw Xml:
<?xml version="1.0"
encoding="utf-8"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<soap:Header>
<SessionIdHeader
xmlns="http://www.inwise.com/webservices/v2">
<SessionId>ef7b1728ce004a4dbd7404d16918dd53</SessionId>
<EndSession>true</EndSession>
</SessionIdHeader>
</soap:Header>
<soap:Body>
<Send
xmlns="http://www.inwise.com/webservices/v2">
<source
xsi:type="ExistingSendingSource">
<ChannelType>Email</ChannelType>
<Id>1</Id>
</source>
<target
xsi:type="TestSendingTarget">
<Targets><string>email1@company.com</string><string>
email2@company.com</string></Targets>
</target>
</Send>
</soap:Body>
</soap:Envelope>
Response
<SendResponse xmlns="http://www.inwise.com/webservices/v2">
<SendResult>
<IsSuccess>true</IsSuccess>
<ErrorDetails>
<Code>Success</Code>
</ErrorDetails>
<Ids>
<string>ab0b9540-87b4-42e6-8ebc-80139e0379d9</string>
<string>c1d10e74-4e16-42dc-bc4a-879e80b59afc</string>
</Ids>
<Targets>
<string>email1@company.com</string>
<string>email2@company.com</string>
</Targets>
<SendStatus>
<string>Sent</string>
<string>Sent</string>
</SendStatus>
</SendResult>
</SendResponse>