[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Sending Attachment in WSDL2RPG
Thanks for the info - file got there, but they could not handle
using�MTOM - the 1.16.5beta3 seems to default it�and I can't see how
to not use it. They asked I not use MTOM..
Jim
On Fri, Oct 14, 2016 at 4:41 AM, Thomas Raddatz
<[1]thomas.raddatz@xxxxxx> wrote:
Jim,
Actually WSDL2RPG should automatically create a MIME message, as
soon as you called * _Attachments_addFile() to add a file as an
attachment to the soap request message.
For example:
// Attach file to request message.
DownloadAttachment12_setAttachment_Attachments_addFile(
� �path: 'text/plain': WSDL_MIME_BINARY);
// Set the parameter values of the request message
// of the web service.
//� � assign values here
requestMessage.fileName = path;
// Now let's call the web service.
setAttachmentResponse =
� �DownloadAttachment12_setAttachment(
� � � �requestMessage:
� � � �errText);
Please check the debug log, whether or not WSDL2RPG created a MIME
message. A MIME starts with:
MIME-Version: 1.0
Content-Type: multipart/related;
� � � � type="application/soap+xml";
� � � � boundary="MIMEBoundary_20161014102651910000_791705";
� � � � start="<[2]C1648006CDC119E1A5DC00
04AC1AF51A.2@xxxxxxxxxxx>"
Each attachment is separte by a "mime boundary", which looks like
this:
sendraw(): entered
--MIMEBoundary_20161014102651910000_791705
Content-Type: application/soap+xml; action="[3]http://tools400.de/
wsdl2rpg/webservice/sample/downloadattachment/service/setAttachment"
Content-Transfer-Encoding: binary
Content-ID: <[4]C1648006CDC119E1A5DC0004AC1AF51A.2@xxxxxxxxxxx>
<?xml version="1.0" encoding="utf-8"?><soapenv:Envelope
xmlns:soapenv="[5]http://www.w3.org/2003/05/soap-envelope"
xmlns:tns="[6]http://tools400.de/wsdl2rpg/webservice/sample/
downloadattachment/service"><soapenv:Body><tns:
setAttachmentRequest><fileName>Hello World.txt</fileName></tns:
setAttachmentRequest></soapenv:Body></soapenv:Envelope>
--MIMEBoundary_20161014102651910000_791705
Content-Type: text/plain;
� � � � name="Hello World.txt"
Content-Transfer-Encoding: binary
Content-ID: <[7]C1099006CDC119E1A5DC0004AC1AF51A.1@xxxxxxxxxxx>
Hello World!
--MIMEBoundary_20161014102651910000_791705--
Thomas
-----Ursprüngliche Nachricht-----
Von: [8]ftpapi-bounces@xxxxxxxxxxxxxxxxxxxxxx
[mailto:[9]ftpapi-bounces@xxxxxxxxxxxxxxxxxxxxxx] Im Auftrag von Jim
Franz
Gesendet: Donnerstag, 13. Oktober 2016 17:10
An: HTTPAPI and FTPAPI Projects
Betreff: Sending Attachment in WSDL2RPG
Calling web service to send a pdf file - they received file upload
request with parameters but no file. Using latest wsdl2rpg and libhttp
versions (within last month).
Have never uploaded so not sure where to look in WSDL2RPG - there is a
2011 faq that mentions altering the generated source, but assuming that
is an "old way".
Not familiar with MTOM (in soap Body) and am told not needed for small
files (this is 3 kb pdf).
debug is on but no apparent issue
�<soapenv:Body>
� <tns:addDocument>
� �<tns:username>SVC-XYZ</tns:username>
� �<tns:password>abc</tns:password>
� �<tns:document>
� � <tns:contentList>
� � �<tns:content>goGihfb0</tns:content>
� � �<tns:contentMTOM>goGihfb0</tns:contentMTOM>
� � �<tns:fileName>/EKDFILENET/KEY0133993_20160710.PDF</tns:
fileName>
� � �<tns:mimeType>APPLICATION/PDF</tns:mimeType>
� � </tns:contentList>
.. more
debug
recvresp(): entered
HTTP/1.1 200 OK
Date: Thu, 13 Oct 2016 13:47:50 GMT
X-Powered-By: Servlet/3.0
Transfer-Encoding: chunked
Content-Type: multipart/related; type="application/xop+xml";
boundary="uuid:e06303dd-fbc2-454e-b3fa-faa4b101b3bd"; start="<
[10]root.message@xxxxxxxxxxxxxx>"; start-info="text/xml"
Content-Language: en-US
SetError() #13: HTTP/1.1 200 OK
recvresp(): end with 200
recvdoc parms: chunked 0
header_load_cookies() entered
recvchunk(): entered
get_chunk_size(): entered
1ed
chunk size = 493
get_chunk_size returned 493
calling comm_blockread
--uuid:e06303dd-fbc2-454e-b3fa-faa4b101b3bd
Content-Type: application/xop+xml; charset=UTF-8; type="text/xml";
Content-Transfer-Encoding: binary
Content-ID: <[11]root.message@xxxxxxxxxxxxxx> <soap:Envelope
xmlns:soap="[12]http://schemas.xmlsoap.org/soap/envelope/"><
soap:Body><addDocumentResponse
xmlns="[13]http://services.p8.imaging.xyz.com/
"><return>{C3763938-1559-411E-930D-93A2B6CF3E52}</return></
addDocumentResponse></soap:Body></soap:Envelope>
--uuid:e06303dd-fbc2-454e-b3fa-faa4b101b3bd--
comm_blockread returned 493
** 2016-10-13-09.47.54.798000: Preparing to parse received message
** 2016-10-13-09.47.54.942000: Detected MIME message
get_chunk_size(): entered
0
chunk size = 0
get_chunk_size returned 0
http_close(): entered
HTTPAPI Ver 1.32 released 2016-02-10
NTLM Ver 1.4.0 released 2014-12-22
OS/400 Ver V7R1M0
WSDL2RPG (eXpat error): (3) no element found
� � received at line: 1
� � � � � �at column: 0
� � � from procedure: WSDL2R97_XMLSAXParser_endParse
� � � �and statement: 111800
** 2016-10-13-09.47.54.969000: Leaving P8ServiceImplPort_addDocument()
Jim Franz
--
IMPORTANT NOTICE:
This email is confidential, may be legally privileged, and is for
the intended recipient only. Access, disclosure, copying,
distribution, or reliance on any of it by anyone else is prohibited
and may be a criminal offence. Please delete if obtained in error
and email confirmation to the sender.
-----------------------------------------------------------------------
This is the FTPAPI mailing list.� To unsubscribe, please go to:
[14]http://www.scottklement.com/mailman/listinfo/ftpapi
-----------------------------------------------------------------------
References
1. mailto:thomas.raddatz@xxxxxx
2. mailto:C1648006CDC119E1A5DC0004AC1AF51A.2@xxxxxxxxxxx
3. http://tools400.de/wsdl2rpg/webservice/sample/downloadattachment/service/setAttachment
4. mailto:C1648006CDC119E1A5DC0004AC1AF51A.2@xxxxxxxxxxx
5. http://www.w3.org/2003/05/soap-envelope
6. http://tools400.de/wsdl2rpg/webservice/sample/downloadattachment/service
7. mailto:C1099006CDC119E1A5DC0004AC1AF51A.1@xxxxxxxxxxx
8. mailto:ftpapi-bounces@xxxxxxxxxxxxxxxxxxxxxx
9. mailto:ftpapi-bounces@xxxxxxxxxxxxxxxxxxxxxx
10. mailto:root.message@xxxxxxxxxxxxxx
11. mailto:root.message@xxxxxxxxxxxxxx
12. http://schemas.xmlsoap.org/soap/envelope/
13. http://services.p8.imaging.xyz.com/
14. http://www.scottklement.com/mailman/listinfo/ftpapi
-----------------------------------------------------------------------
This is the FTPAPI mailing list. To unsubscribe, please go to:
http://www.scottklement.com/mailman/listinfo/ftpapi
-----------------------------------------------------------------------