【发布时间】:2012-03-07 10:50:34
【问题描述】:
如何将图像从移动网络应用程序发送到现有网络服务。我考虑使用PhoneGap FileTransfer 对象,但我不知道如何将调用包装在 SOAP 数据包中。
我需要上传图像的服务器希望图像被包装在一个 SOAP 数据包中。从下面的服务描述中,可以看出服务器需要 base64Binary 格式的文件。以前有没有人做过这样的事情,或者我是第一个(或最后一个)过河的水牛(被鳄鱼吃掉):
POST /Service.asmx HTTP/1.1
Host: 127.0.0.1
Content-Type: application/soap+xml; charset=utf-8
Content-Length: length
<?xml version="1.0" encoding="utf-8"?>
<soap12:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap12="http://www.w3.org/2003/05/soap-envelope">
<soap12:Header>
<AuthHeader xmlns="http://localhost/">
<LogonID>string</LogonID>
<Password>string</Password>
</AuthHeader>
</soap12:Header>
<soap12:Body>
<uploadFile xmlns="http://localhost/">
<FileDetails>
<ReferenceNumber>string</ReferenceNumber>
<FileName>string</FileName>
<FileType>int</FileType>
<FileContents>base64Binary</FileContents>
</FileDetails>
</uploadFile>
</soap12:Body>
</soap12:Envelope>
【问题讨论】:
标签: javascript jquery soap jquery-mobile cordova