The SOAP web services provided for offer management are different from those usually used in Adobe Campaign. They can be accessed via the interaction URL described in the previous section and let you present or update offers for a given contact.
For an offer proposition via SOAP, add the nms:proposition#Propose command followed by the following parameters:
<empty>
should be added.The targetId and maxCount settings are compulsory. The others are optional.
In response to the query, the SOAP service will return the following parameters:
Add the nms:interaction#UpdateStatus command to the URL, followed by these parameters:
<empty>
should be added.Here is an example of code for a SOAP call:
<%
var space = request.parameters.sp
var cnx = new HttpSoapConnection(
"https://" + request.serverName + ":" + request.serverPort + "/interaction/" + env + "/" + space,
"utf-8",
HttpSoapConnection.SOAP_12)
var session = new SoapService(cnx, "nms:interaction")
var action = request.parameters.a
if( action == undefined )
action = 'propose'
try
{
switch( action )
{
case "update":
var proposition = request.parameters.p
var status = request.parameters.st
session.addMethod("UpdateStatus", "nms:interaction#UpdateStatus",
["proposition", "string",
"status", "string",
"context", "NLElement"],
[])
session.UpdateStatus(proposition, status, <undef/>)
var redirect = request.parameters.r
if( redirect != undefined )
response.sendRedirect(redirect)
break;
case "propose":
var count = request.parameters.n
var target = request.parameters.t
var categorie = request.parameters.c
var theme = request.parameters.th
var layout = request.parameters.l
if( count == undefined )
count = 1
session.addMethod("Propose", "nms:proposition#Propose",
["targetId", "string",
"maxCount", "string",
"categories", "string",
"themes", "string",
"context", "NLElement"],
["interactionId", "string",
"propositions", "NLElement"])
response.setContentType("text/html")
var result = session.Propose(target, count, category, theme, <empty/>)
var props = result[1]
%><table><tr><%
for each( var propHtml in props.proposition.*.mdSource )
{
%><td><%=propHtml%></td><%
}
%></tr></table><%
break;
}
}
catch( e )
{
}
%>