19. Mai 2016 10:54
POST /FileTransferService HTTP/1.1
Content-Type: multipart/related; boundary=MIMEBoundaryurn_uuid_FFAFEBBA9E369E19151224106591181; type="application/xop+xml";
start="<0.urn:uuid:FFAFEBBA9E369E19151224106591182>"; start-info="tet/xml"
X-EBAY-SOA-OPERATION-NAME: uploadFile
X-EBAY-SOA-SECURITY-TOKEN: YourTokenHere
X-EBAY-SOA-SERVICE-NAME: FileTransferService
X-EBAY-SOA-REQUEST-DATA-FORMAT: XML
X-EBAY-SOA-RESPONSE-DATA-FORMAT: XML
User-Agent: Jakarta Commons-HttpClient/3.1
Host: localhost:8082
Content-Length: 44155
--MIMEBoundaryurn_uuid_FFAFEBBA9E369E19151224106591181
Content-Type: application/xop+xml; charset=UTF-8; type="text/xml"
Content-Transfer-Encoding: binary
Content-ID: <0.urn:uuid:FFAFEBBA9E369E19151224106591182>
<?xml version='1.0' encoding='UTF-8'?><uploadFileRequest
xmlns="http://www.ebay.com/marketplace/services"><taskReferenceId>50000000419</taskReferenceId><fileReferenceId&g
t;50000000619</fileReferenceId><fileFormat>gzip</fileFormat><fileAttachment><Data><xop:Include
href="cid:1.urn:uuid:FFAFEBBA9E369E19151224106591198" /></Data></fileAttachment></uploadFileRequest>
--MIMEBoundaryurn_uuid_FFAFEBBA9E369E19151224106591181
Content-Type: application/octet-stream
Content-Transfer-Encoding: binary
Content-ID: <1.urn:uuid:FFAFEBBA9E369E19151224106591198>
13. Juni 2016 15:42
//UUIDS
GUID := CREATEGUID;
GUID := DELCHR(GUID,'=','}');
GUID := DELCHR(GUID,'=','{');
GUID2 := CREATEGUID;
GUID2 := DELCHR(GUID2,'=','}');
GUID2 := DELCHR(GUID2,'=','{');
GUID3 := CREATEGUID;
GUID3 := DELCHR(GUID3,'=','}');
GUID3 := DELCHR(GUID3,'=','{');
// Mime Strings
Mime1 := '<1.urn:uuid:'+GUID3+'>';
Mime2 := '<0.urn:uuid:'+GUID2+'>';
Boundary := '--MIMEBoundary';
FileName := 'File.xml';
CREATE(locautXmlDoc);
locautXmlDoc.async := FALSE;
IF EXISTS(FileName) THEN ERASE(FileName);
File.CREATE(FileName);
File.TEXTMODE(TRUE);
File.WRITEMODE(TRUE);
File.WRITE(Boundary+'urn:uuid_'+GUID);
File.WRITE('Content-Type: application/xop+xml; charset=UTF-8; type="text/xml"');
File.WRITE('Content-Transfer-Encoding: binary');
File.WRITE('Content-ID:'+Mime2);
File.WRITE('<?xml version="1.0" encoding="UTF-8"?>');
File.WRITE('<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"'
+' xmlns:xmlmime="http://www.w3.org/2004/11/xmlmime">');
File.WRITE(' <soapenv:Header/>');
File.WRITE(' <soapenv:Body>');
File.WRITE(' <uploadFileRequest xmlns="http://www.ebay.com/marketplace/services">');
File.WRITE(' <fileReferenceId>'+JOB+'</fileReferenceId>');
File.WRITE(' <taskReferenceId>'+ID+'</taskReferenceId>');
File.WRITE(' <fileFormat>zip</fileFormat>');
File.WRITE(' <fileAttachment>');
File.WRITE(' <Data><xop:Include xmlns:xop="http://www.w3.org/2004/08/xop/include" '
+'href="cid:1.urn:uuid:'+GUID3+'" /></Data>');
File.WRITE(' </fileAttachment>');
File.WRITE(' </uploadFileRequest>');
File.WRITE(' </soapenv:Body>');
File.WRITE('</soapenv:Envelope>');
File.WRITE(Boundary+'urn:uuid_'+GUID);
File.WRITE('Content-Type: application/octet-stream');
File.WRITE('Content-Transfer-Encoding: binary');
File.WRITE('Content-ID:'+Mime1);
File.CLOSE;
Type := 'multipart/related;';
Type += ' boundary='+Boundary+'urn_uuid_'+GUID;
Type += ' type="application/xop+xml";';
Type += ' start="<1.urn:uuid:'+GUID3+'>";';
Type += ' start-info="text/xml"';
CREATE(locautXmlHttp);
locautXmlHttp.open('POST','https://storage.sandbox.ebay.com/FileTransferService', 'HTTP/1.1');
locautXmlHttp.setRequestHeader('X-EBAY-SOA-OPERATION-NAME', 'uploadFile');
locautXmlHttp.setRequestHeader('X-EBAY-SOA-SECURITY-TOKEN', T);
locautXmlHttp.setRequestHeader('X-EBAY-SOA-SERVICE-NAME', 'FileTransferService');
locautXmlHttp.setRequestHeader('CONTENT-TYPE', Type);
locautXmlHttp.setRequestHeader('X-EBAY-SOA-REQUEST-DATA-FORMAT','XML');
locautXmlHttp.setRequestHeader('X-EBAY-SOA-RESPONSE-DATA-FORMAT','XML');
locautXmlHttp.setRequestHeader('X-EBAY-SOA-SERVICE-VERSION','1.0.0');
locautXmlHttp.setRequestHeader('MESSAGE PROTOCOL','SOAP12');
locautXmlHttp.setRequestHeader('MIME-Version', '1.0');
locautXmlDoc.load(FileName);
locautXmlHttp.send(locautXmlDoc);
locautXmlDoc.load(locautXmlHttp.responseXML);
locautXmlDoc.save(response.xml);