【发布时间】:2016-06-01 08:24:12
【问题描述】:
我正在尝试访问具有 PDFattachment 方法的 Web 服务,我实现了 HTTP 适配器并尝试访问附件,但我没有得到正确的附件文件,returnedContentType : 'plain' 和 contentType:'application/pdf' ,这里是soap UI和适配器响应的截图在这里输入图片描述
适配器代码:
function getInvoicePdfFile(prj_no, drft_No) {
var request = 'soaprequest with parameters';
var input = {
method: 'POST',
returnedContentType: 'plain',
path: clintinvoicePath,
headers: {
SOAPAction: 'SoapAction end point',
Authorization: authorisationPassword
},
body: {
content: request.toString(),
contentType: 'application/pdf',
}
};
var result = WL.Server.invokeHttp(input);
return result;
}
【问题讨论】:
-
请分享您的适配器代码。
-
嗨,Yoel,请在此处找到适配器代码
-
function getInvoicePdfFile(prj_no,drft_No) { var request = 'soaprequest with parameters'; var input = { method : 'POST', returnedContentType : 'plain', path : clintinvoicePath, headers: {SOAPAction: 'SoapAction end point', Authorization: authorisationPassword }, body : { content: request.toString(), contentType:'应用程序/pdf', } }; var 结果 = WL.Server.invokeHttp(输入);返回结果; }
-
@LingarajSajjan,你在这个问题上有什么进展吗?
-
我们通过另一种方式完成,例如,将 pdf 数据从后端转换为 base64 数据,然后在前端使用 pdf.js 插件将 base64 转换为 pdf 页面,@IdanAdar
标签: cordova pdf ibm-mobilefirst soap-client worklight-adapters