× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



You just have one input variable, if you want the payload to be put in
that buffer you need to define the content-type as text/plain. But it
defeats the purpose of IWS - which basically parses the input and put the
data in the proper fields.

Now if you define a structure with a name of ADDCASEInput with the fields:

name
addr1
addr2
addr3
city
state
zip
email
sku
proddesc
phone

and ensure *DCLCASE *PCML is specified in RPG module, and you indicate
that the input parameters should not be wrapped when you deploy, I believe
that will get what you want.


"WEB400" <web400-bounces@xxxxxxxxxxxxxxxxxx> wrote on 01/16/2019 04:18:04
PM:

From: Peter Dow <petercdow@xxxxxxxxx>
To: web400@xxxxxxxxxxxxxxxxxx
Date: 01/16/2019 04:18 PM
Subject: Re: [WEB400] IWS REST POST request message body to input
parameter
Sent by: "WEB400" <web400-bounces@xxxxxxxxxxxxxxxxxx>

The way I understand it, the web service created by IWS receives the
POST request from SOAPUI (running on a Win7 VM). The POST request has a

message body that contains the XML shown below. The web service then
calls the ADDCASE procedure in my service program, passing it the
message body. That should be the XML noted below.

However, when ADDCASE gets control, that parameter is blank. The const
means ADDCASE cannot expect any changes to that parameter to be returned

to the caller, and it doesn't. The pCaseNbr parameter is used to
return data to the caller.

I should also mention that the other procedure, GETCASE, has the same
const on its input parameter and it works as expected. In that case, the

data is not coming from the HTTP GET message body, but from the path
parameters of the URL used to invoke the request.

I tried to follow the java created by IWS but I failed to see where the
message body is actually placed in the parameter that is passed to
ADDCASE. Presumably in the Apache web server that actually receives the
request.

On 1/16/2019 1:29 PM, Jon Paris wrote:
I'm confused. That parm is defined as Const - so input only. If
IWS is honouring that it would be expected to be blank.


Jon Paris

www.partner400.com
www.SystemiDeveloper.com

On Jan 16, 2019, at 2:17 PM, Peter Dow <petercdow@xxxxxxxxx> wrote:

I'm on v7r3, trying to configure an IWS (Integrated Web Server)
service for an HTTP POST request.


The IWS configuration looks like this:

Procedure name: ADDCASE
HTTP request method: POST
URI path template for method: *NONE
HTTP response code output parameter: *NONE
HTTP header array output parameter: *NONE
Allowed input media types: *ALL
Returned output media types: *XML
Input parameter mappings: Wrap input parameters


The raw request looks like this:

POST INVALID URI REMOVED.
4-3A10010_web_services_RT0200S&d=DwIGaQ&c=jf_iaSHvJObTbx-
siA1ZOg&r=1i-jGlz0-JTK1aLHcsU-ew&m=2oaZLi44dhP0ojXID-

C802JSoJVCSDFRDJFcbW8SkuQ&s=if921hoIHqQ7ow21_tvcdoqxMT-uTGK6AMNdXyek1jU&e=
HTTP/1.1
Accept-Encoding: gzip,deflate
Content-Type: application/xml
Content-Length: 343
Host: 1.2.3.4:10010
Connection: Keep-Alive
User-Agent: Apache-HttpClient/4.1.1 (java 1.5)

<ADDCASEInput>
<name>Peter Dow</name>
<addr1>9379 Salina Way</addr1>
<addr2>25 char max</addr2>
<addr3>25 char max</addr3>
<city>Sacramento</city>
<state>CA</state>
<zip>95827</zip>
<email>petercdow@xxxxxxxxx</email>
<sku>abcdef</sku>
<proddesc>30 char max</proddesc>
<phone>9097939050</phone>
</ADDCASEInput>


My procedure (in a service program) has this:

p AddCase b export
d pi
d pCaseXML 1024a const input
d pCaseNbr 256a output


The problem is, pCaseXML is always blank. I ran a TCP app trace
on the HTTP server, and it appears to be reading the message body
from the POST, although it doesn't show the contents:

0002DBEE:256048 mod_was_ap22_http: cb_read_body: Entry
0002DBEE:256072 ap_setup_client_block()
0002DBEE:256080 ap_should_client_block()
0002DBEE:256088 ap_get_client_block(), length requested = 343.
0002DBEE:256088 ap_http_filter()
0002DBEE:256104 core_input_filter, mode = AP_MODE_READBYTES or
AP_MODE_SPECULATIVE.
0002DBEE:256120 Collection services: r_IUO->bytes_received = 562
0002DBEE:256120 mod_was_ap22_http: cb_read_body: Exit

Am I configuring the IWS service incorrectly? Or am I supposed
to get the message body in some other way?

--
*Peter Dow* /
Dow Software Services, Inc.
909 793-9050
petercdow@xxxxxxxxx <mailto:petercdow@xxxxxxxxx>
pdow@xxxxxxxxxxxxxx <mailto:pdow@xxxxxxxxxxxxxx> /

--
This is the Web Enabling the IBM i (AS/400 and iSeries) (WEB400)
mailing list
To post a message email: WEB400@xxxxxxxxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: INVALID URI REMOVED

u=https-3A__lists.midrange.com_mailman_listinfo_web400&d=DwIGaQ&c=jf_iaSHvJObTbx-
siA1ZOg&r=1i-jGlz0-JTK1aLHcsU-ew&m=2oaZLi44dhP0ojXID-

C802JSoJVCSDFRDJFcbW8SkuQ&s=NcvEAABluqmcLsjGo1b3ZElP3KlwpMZRuL-b3XZscvo&e=
or email: WEB400-request@xxxxxxxxxxxxxxxxxx
Before posting, please take a moment to review the archives
at INVALID URI REMOVED
u=https-3A__archive.midrange.com_web400&d=DwIGaQ&c=jf_iaSHvJObTbx-
siA1ZOg&r=1i-jGlz0-JTK1aLHcsU-ew&m=2oaZLi44dhP0ojXID-

C802JSoJVCSDFRDJFcbW8SkuQ&s=8dAi7X_3i2dQM77OrNbDhGEfVItN6bgvRH9Utq50B2M&e=.


--
This is the Web Enabling the IBM i (AS/400 and iSeries) (WEB400) mailing
list
To post a message email: WEB400@xxxxxxxxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: INVALID URI REMOVED

u=https-3A__lists.midrange.com_mailman_listinfo_web400&d=DwIGaQ&c=jf_iaSHvJObTbx-
siA1ZOg&r=1i-jGlz0-JTK1aLHcsU-ew&m=2oaZLi44dhP0ojXID-

C802JSoJVCSDFRDJFcbW8SkuQ&s=NcvEAABluqmcLsjGo1b3ZElP3KlwpMZRuL-b3XZscvo&e=
or email: WEB400-request@xxxxxxxxxxxxxxxxxx
Before posting, please take a moment to review the archives
at INVALID URI REMOVED
u=https-3A__archive.midrange.com_web400&d=DwIGaQ&c=jf_iaSHvJObTbx-
siA1ZOg&r=1i-jGlz0-JTK1aLHcsU-ew&m=2oaZLi44dhP0ojXID-

C802JSoJVCSDFRDJFcbW8SkuQ&s=8dAi7X_3i2dQM77OrNbDhGEfVItN6bgvRH9Utq50B2M&e=.





As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:
Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.