我正在尝试使用acrobat javascript&#soap皂对象来使用wcf服务。我没有问题就可以开始工作了。下面是工作正常的javascript代码。
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
});
这成功地创建了"测试活动"在Replicon。
如果您注意到reqParam,我必须为请求中的每个类型添加前缀命名空间。如果我不这样做,请求就不起作用。在fiddler中,我看到对象文字reqParam被转换为xml请求。
普通请求(json格式)如下所示。
{
"activity": {
"target": {
"uri": null,
"name": "test activity"
},
"name": "test activity",
"code": null,
"description": null
}
}
wsdl网址为https://na2.replicon.com/services/ActivityService1.svc?wsdl
答案 0 :(得分:0)
我不确定是否完全理解这个问题,因此,以下是我将对SharePoint服务器进行的典型调用。今天没有上班,但如果你今天找不到答案我还有更多的资源......
soapResponse = SOAP.request({
cNamespace: 'http://schemas.microsoft.com/sharepoint/soap/' + soapAction + 'Response',
cURL: 'http://server/folder/_vti_bin/Lists.asmx',
oRequest: {soapValue: soapEnv},
cAction: 'http://schemas.microsoft.com/sharepoint/soap/' + soapAction,
oAuthenticator: {UsePlatformAuth: 'true'},
bEncoded: false,
cVersion: SOAPVersion.version_1_2,
cResponseStyle: SOAPMessageStyle.Message
});