[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: Sending Attachment in WSDL2RPG



So if I wanted to not use MTOM, I would set     

  g_hMsgCtx = MessageContext_new(cFalse);     ??

That did not work - still generated MTOM code in the XML...

Jim Franz 
-----Original Message-----
From: ftpapi-bounces@xxxxxxxxxxxxxxxxxxxxxx
[mailto:ftpapi-bounces@xxxxxxxxxxxxxxxxxxxxxx] On Behalf Of Mario
Martoriello
Sent: Friday, October 14, 2016 4:12 AM
To: HTTPAPI and FTPAPI Projects
Subject: Re: Sending Attachment in WSDL2RPG

Hi Jim
You should check in PWSDL2R85 there is a new parameter :
D  i_isMTOM                       N   const options(*nopass)
so if you find it you have to set it in your stub module, you should have a
proc  like this in the generated stub :
* =====================================================================
*   Returns the message context. The context is created if
*   it does not yet exist.
* =====================================================================
P getMessageContext...
P                 B
D                 PI                         like(wsdl_hMsgCtx_t)
* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
/free

    if (MessageContext_isNull(g_hMsgCtx));
       g_hMsgCtx = MessageContext_new(cTrue);              <-----  this is 
the parameter that I changed
    endif;

    return g_hMsgCtx;

/end-free
P                 E
*
I hope that this help you.
Best  regards
Mario


-----Messaggio originale-----
From: Jim Franz
Sent: Thursday, October 13, 2016 6:49 PM
To: HTTPAPI and FTPAPI Projects
Subject: Re: Sending Attachment in WSDL2RPG

can you show the function with the optional parameter? I'm not seeing what
to change.
Using 1.16.5beta3
Jim

On Thu, Oct 13, 2016 at 12:16 PM, Mario Martoriello <
martoriello@xxxxxxxxxxxxxxx> wrote:

> Hi
> I used Wsdl2rpg to successfully send a file with MTOM protocol and I 
> used the 1.16.5beta2 version of WSDL2RPG I don't remember but with 
> this version I don't do any manual changes to the generated code but 
> only call the function with an optional parameter .
> best regards
> Mario
>
> -----Messaggio originale----- From: Jim Franz
> Sent: Thursday, October 13, 2016 5:09 PM
> To: HTTPAPI and FTPAPI Projects
> Subject: 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="< 
> 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: <root.message@xxxxxxxxxxxxxx> <soap:Envelope 
> xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/
> "><soap:Body><addDocumentResponse
> xmlns="http://services.p8.imaging.xyz.com/
> "><return>{C3763938-1559-411E-930D-93A2B6CF3E52}</return></a
> ddDocumentResponse></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
>
>
>
>
>
>
> ----------------------------------------------------------------------
> - This is the FTPAPI mailing list.  To unsubscribe, please go to:
> 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
> ----------------------------------------------------------------------
> -
>






-----------------------------------------------------------------------
This is the FTPAPI mailing list.  To unsubscribe, please go to:
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
-----------------------------------------------------------------------

-----------------------------------------------------------------------
This is the FTPAPI mailing list.  To unsubscribe, please go to:
http://www.scottklement.com/mailman/listinfo/ftpapi
-----------------------------------------------------------------------