i am trying to consume wcf services using acrobat javascript's soap object. i've got it to work without issues. below is the javascript code that works fine.
var repliconCredentials = {
Username: "valid username",
Password: "valid password"
};
var reqParam = {
'http://replicon.com/:activity': {
'http://replicon.com/:target': {
'http://replicon.com/:uri': null,
'http://replicon.com/:name': 'test activity'
},
'http://replicon.com/:name': 'test activity',
'http://replicon.com/:code': null,
'http://replicon.com/:description': null
}
};
var response = SOAP.request({
cURL: "https://na2.replicon.com/services/ActivityService1.svc/soap",
oRequest: { "http://replicon.com/:PutActivity": reqParam },
cAction: "http://replicon.com/IActivityService1/PutActivity",
oAuthenticate: repliconCredentials
});
this successfully creates "test activity" in Replicon.
if you notice the reqParam i have had to prefix namespace for each type in the request. if i don't do that the request doesn't work. in fiddler i see that the object literal reqParam is converted to xml request.
- what is the best way to prefix namespace? i have tried cNamespace property of SOAP.request method and that doesn't work because it isn't applicable when using SOAP encoding (default).
- is there any other recommended way to create and pass requests. i am building an acrobat plugin using javascript objects. should i try to pass in native xml format? if so, how?
the plain request (json format) looks as below.
{
"activity": {
"target": {
"uri": null,
"name": "test activity"
},
"name": "test activity",
"code": null,
"description": null
}
}
the wsdl url is https://na2.replicon.com/services/ActivityService1.svc?wsdl