Hi Scott, I've attached a simplified version of the code that does no processing, and just passes the CTDATA table, writes it to the IFS, then tries to parse it. Still getting the same error. Looking at the "D" on line 1, col 2 of the IFS, the hex code is x'C4'. That is what I see when I DSPPFM on the source code and put it in hex mode. The CCSID on the IFS file is 37. Here are the contents of the debug file: HTTPAPI Ver 1.24 released 2012-01-23 OS/400 Ver V7R1M0 New iconv() objects set, PostRem=819. PostLoc=0. ProtRem=819. ProtLoc=0 SetError() #66: XML parse failed at line 1, col 2: not well-formed (invalid token) Thanks, Kevin -----Original Message----- From: ftpapi-bounces@xxxxxxxxxxxxxxxxxxxxxx [mailto:ftpapi-bounces@xxxxxxxxxxxxxxxxxxxxxx] On Behalf Of Scott Klement Sent: Saturday, February 15, 2014 10:18 PM To: HTTPAPI and FTPAPI Projects Subject: Re: java.lang.RuntimeException: Invocation of program failed.AS400Message (ID: CPF9897 text: XML parse failed at line 1, col 2: not well-formed (invalid token)):com.ibm.as400.access.AS400Message@34ce34ce Kevin, It's hard to guess when you don't have things to look at and see what the problem is. Can you look at the CCSID on the IFS file that's being fed to http_parse_xml_stmf() and see what the CCSID is? Can you look at the data in that file in hex and see whether those hex values make sense for the CCSID that was used? Can you provide me with the needed details to try to reproduce this on my box so I can try it and troubleshoot it? -SK On 2/15/2014 7:02 PM, Kevin Wengert wrote: > HI Scott, > > > Thanks for the quick reply. The error message I copies was from using > the "Test Service" function under "Manage Deployed Services" in IBM Web > Administration for i. I used one of your presentations to step through > the IWS Wizard to create my web service provider. I know that I have > problems with my WSDL and SOAP envelope, but in trying to isolate and > fix one error at a time, I figured I would take the possibility of > corruption through the web service as my problem so I wrote the first > program to try to send a sample xml file through my program just > dealing with everything on the iSeries, where I'm most comfortable. > The first program just allows me to pass the xml as a parameter. > > > All that said, I changed HTTP_XML_CALC to HTTP_STMF_CALC and I'm > getting the same error, "XML parse failed at line 1, col 2: not > well-formed (invalid token)". Any other ideas? > > > Thanks, > > > Kevin > > > > -----Original Message----- > From: [1]ftpapi-bounces@xxxxxxxxxxxxxxxxxxxxxx > [[2]mailto:ftpapi-bounces@xxxxxxxxxxxxxxxxxxxxxx] On Behalf Of Scott > Klement > Sent: Saturday, February 15, 2014 5:23 PM > To: HTTPAPI and FTPAPI Projects > Subject: Re: java.lang.RuntimeException: Invocation of program > failed.AS400Message (ID: CPF9897 text: XML parse failed at line 1, col > 2: not well-formed (invalid > token)):com.ibm.as400.access.AS400Message@34ce34ce > > > > You are passing HTTP_XML_CALC to the XML parser. This tells it to > Expat's ability to figure out the text encoding from the contents of > the > > XML data, but Expat does not support EBCDIC. An easy work around is > > to use HTTP_STMF_CALC instead of HTTP_XML_CALC. This tells it to use > > the CCSID of your stream file, which IIRC, will default to your job's > CCSID, so should be correct. > > > It seems very weird to me that you refer to this as a web service > provider, and give a Java error message when nothing here appears > to be > > a web service provider or written in Java. I can only assume that the > > RPG program you provided that loads the XML from a CTDATA array is not > the "normal" way of calling this. > > > If this is called from Java, are you required to have the data in > EBCDIC > > there, too? This would likely work better if the data could be > > provided in Unicode, since the callers may not want to be restricted to > only passing data that fits in an EBCDIC character set -- that's not > your immediate problem, but could potentially be a problem down the > road. > > > -SK > > > > On 2/15/2014 11:25 AM, Kevin Wengert wrote: > > > Hi, > > > > > > > > > I'm a newbie with creating a web service provider, but have been > doing > > > RPG coding for 20 years. This one has me pulling my hair out so > any > > > help would be greatly appreciated. > > > > > > > > > I've written a test program to send a sample XML file to my web > service > > > provider RPG. The web service accepts the xml as the first > parameter > > > in a variable length field, writes it to the IFS, then calls > > > http_parse_xml_stmf to parse the file. The error message tells > me that > > > XML parse failed at line 1, col2: not well-formed (invalid > token). I'm > > > lost. Here are the relevant samples of the code: > > > > > > > > > H Copyright('Logistix Software Solutions, 2014') > > > > > > H Option(*SrcStmt: *NoDebugIO) DatEdit(*MDY) DatFmt(*MDY) > > > > > > H DftActGrp(*NO) ActGrp(*CALLER) Bnddir('HTTPAPI') > > > > > > > > > D LPDBPSRR PR ExtPgm('LPDBPSRR') > > > > > > D DriverProExport... > > > > > > D 9999995a Varying > > > > > > D Valid 5a Options(*NoPass) > > > > > > D Msg 256a Options(*NoPass) > > > > > > > > > D DS > > > > > > D DriverProExport... > > > > > > D 9999995a Varying > > > > > > D XML 1 DIM(3984) > > > > > > D > Overlay(DriverProExport:5) > > > > > > > > > D txml s 1 DIM(3984) CTDATA > PERRCD(80) > > > > > > D y s 10i 0 > > > > > > > > > /Free > > > > > > %Len(DriverProExport) = %elem(xml); > > > > > > For y = 1 to %Elem(XML); > > > > > > XML(y) = TXML(y); > > > > > > EndFor; > > > > > > LPDBPSRR(DriverProExport); > > > > > > Return; > > > > > > /End-Free > > > > > > ** > > > > > > <DriverProExport > > > > > xmlns="[1][1][3]http://tempuri.org/"><RouteUpdates><Route><DCID>2</DCID > > > > > > > > > <RouteID>2018</RouteID><ScheduledDate>2014-01-24T00:00:00</ScheduledDa > t > > > e><Stops> > > > > > > > > <Stop><StopID>74071</StopID><AlternateStopNumber>1</AlternateStopNumbe > r > > > ><Manifes > > > > > > > > tNumber></ManifestNumber><DriverSignIndicator>false</DriverSignIndicat > o > > > r><Driver > > > > > > > > ID>4060</DriverID><DelivScanQty></DelivScanQty><DelivManualPickQty></D > e > > > livManual > > > > > > > > PickQty><ArrivalTime>2014-02-12T12:39:46</ArrivalTime><DepartureTime>2 > 0 > > > 14-02-12T > > > > > > > > 12:47:18</DepartureTime><StopWorkDuration>450</StopWorkDuration><GPSLa > t > > > itude>29. > > > > > > > > 7247</GPSLatitude><GPSLongitude>-95.5534</GPSLongitude><GPSDateTime>20 > 1 > > > 4-02-12T1 > > > > > > > > 2:39:47</GPSDateTime><ScheduledReturns><ScheduledReturn><PickupID>1456 > 9 > > > 08</Picku > > > > > > > > pID><ProductID>1114</ProductID><Quantity>1</Quantity><CreditReferenceI > D > > > >1258513< > > > > > > > > /CreditReferenceID><OriginalUOM></OriginalUOM><UOM>CS</UOM><Dispositio > n > > > ></Dispos > > > > > > > > ition><ReturnReasonCode></ReturnReasonCode><CreditAmount>0</CreditAmou > n > > > t><Weight > > > > > > > > >0</Weight><ReturnedProductID></ReturnedProductID><ReturnQuantity>1</R > e > > > turnQuant > > > > > > > > ity><TaxPerItem>0</TaxPerItem><TaxTotal>0</TaxTotal><AddChgPerItem>0</ > A > > > ddChgPerI > > > > > > > > tem><AddChgTotal>0</AddChgTotal><Price>17.109</Price></ScheduledReturn > > > > > </Schedul > > > > > > > > edReturns><RejectItems><RejectItem><ProductID>64454</ProductID><Reject > R > > > easonCode > > > > > > > > >D30</RejectReasonCode><RejectQuantity>1</RejectQuantity><ReturnedProd > u > > > ctID>6445 > > > > > > > > 4</ReturnedProductID><Weight>0</Weight><ItemClass>O</ItemClass><Invoic > e > > > Number>12 > > > > > > > > 62878</InvoiceNumber><UOM>CS</UOM><ItemID>1262878-50</ItemID><Original > Q > > > uantity>1 > > > > > > > > </OriginalQuantity><InvoiceSequence>50</InvoiceSequence><LotNumber></L > o > > > tNumber>< > > > > > > > > TaxPerItem>1.23876</TaxPerItem><TaxTotal>1.24</TaxTotal><AddChgPerItem > > > > > 0</AddChg > > > > > > > > PerItem><AddChgTotal>0</AddChgTotal><CreditAmount>19.59</CreditAmount> > < > > > ItemDescr > > > > > > iption>GLOVE VINYL POWDER FREE > > > X-LARGE</ItemDescription><AlternateProductID></Al > > > > > > > > ternateProductID><Price>18.352</Price></RejectItem><RejectItem><Produc > t > > > ID>7420</ > > > > > > > > ProductID><RejectReasonCode>D30</RejectReasonCode><RejectQuantity>1</R > e > > > jectQuant > > > > > > > > ity><ReturnedProductID>7420</ReturnedProductID><Weight>9.99</Weight><I > t > > > emClass>O > > > > > > > > </ItemClass><InvoiceNumber>1262878</InvoiceNumber><UOM>CS</UOM><ItemID > > > > > 1262878-1 > > > > > > > > </ItemID><OriginalQuantity>1</OriginalQuantity><InvoiceSequence>1</Inv > o > > > iceSequen > > > > > > > > ce><LotNumber></LotNumber><TaxPerItem>0</TaxPerItem><TaxTotal>0</TaxTo > t > > > al><AddCh > > > > > > > gPerItem>0</AddChgPerItem><AddChgTotal>0</AddChgTotal><CreditAmount>74. > > > 06</Credi > > > > > > tAmount><ItemDescription>N A SALMON 2-3 ATLANTIC FILLET > > > PBO</ItemDescription><Al > > > > > > > > ternateProductID></AlternateProductID><Price>7.413</Price></RejectItem > > > > > </RejectI > > > > > > > > tems><InRouteSplits><InRouteSplit><ProductID>64212</ProductID><PackQua > n > > > titySplit > > > > > > > > >10</PackQuantitySplit><SplitReasonCode>D70</SplitReasonCode><Invoiced > A > > > mount>2.7 > > > > > > > > </InvoicedAmount><AdjustedWeight>0</AdjustedWeight><MultiPickIndicator > > > > > false</Mu > > > > > > > > ltiPickIndicator><InRouteSplitQuantity>1</InRouteSplitQuantity><Invoic > e > > > Number>12 > > > > > > > > 62878</InvoiceNumber><UOM>EA</UOM><OriginalQuantity>1</OriginalQuantit > y > > > ><ItemID> > > > > > > > > 1262878-49</ItemID><InvoiceSequence>49</InvoiceSequence><CaseWeight>0< > / > > > CaseWeigh > > > > > > > > t><TaxPerCase>0</TaxPerCase><CaseTaxTotal>0</CaseTaxTotal><CaseCreditA > m > > > ount>3.26 > > > > > > > > </CaseCreditAmount><TaxPerSplit>0</TaxPerSplit><SplitTaxTotal>0</Split > T > > > axTotal>< > > > > > > > > SplitChargeAmount>2.7</SplitChargeAmount><SplitsPerCase>12</SplitsPerC > a > > > se><PackQ > > > > > > uantityReturned>2</PackQuantityReturned><ItemDescription>DELI > PAPER 8 X > > > 10 3 4</ > > > > > > > > ItemDescription><AlternateProductID></AlternateProductID><Price>3.262< > / > > > Price><Sp > > > > > > > > litPrice>0.27</SplitPrice></InRouteSplit></InRouteSplits><CatchWeightA > d > > > justments > > > > > > > > ><CatchWeightAdjustment><ItemID>1262878-55</ItemID><ProductID>90676</P > r > > > oductID>< > > > > > > > > InvoiceNumber>1262878</InvoiceNumber><InvoiceSequence>55</InvoiceSeque > n > > > ce><Origi > > > > > > > > nalWeight>17.95</OriginalWeight><AdjustedWeight>15.22</AdjustedWeight> > < > > > TaxPerIte > > > > > > > > m>0</TaxPerItem><TaxTotal>0</TaxTotal><CreditAmount>11.84</CreditAmoun > t > > > ><Price>4 > > > > > > > > .338</Price></CatchWeightAdjustment></CatchWeightAdjustments><SalesOff > T > > > ruck /></ > > > > > > Stop></Stops><Inputs /></Route></RouteUpdates></DriverProExport> > > > > > > > > > > > > H Copyright('Logistix Software Solutions, 2014') > > > > > > H Option(*SrcStmt: *NoDebugIO) DatEdit(*MDY) DatFmt(*MDY) > > > > > > H DftActGrp(*NO) ActGrp(*CALLER) Bnddir('HTTPAPI') > > > > > > H PgmInfo(*PCML: *MODULE) > > > > > > > > > > ***************************************************************** > > > > > > * Copyright Logistix Software Solutions 2014 > > > > > > > > > > ***************************************************************** > > > > > > > > > > ***************************************************************** > > > > > > * Logistix PoD Header > > > > > > FLPODSHM IF E K DISK > > > > > > > > > /copy qrpglesrc,httpapi_h > > > > > > /copy qrpglesrc,ifsio_h > > > > > > > > > D LPDBPSRR PR ExtPgm('LPDBPSRR') > > > > > > D DriverProExport... > > > > > > D 9999995a Varying > > > > > > D Valid 5a Options(*NoPass) > > > > > > D Msg 256a Options(*NoPass) > > > > > > > > > D LPDBPSRR PI > > > > > > D DriverProExport... > > > > > > D 9999995a Varying > > > > > > D Valid 5a Options(*NoPass) > > > > > > D Msg 256a Options(*NoPass) > > > > > > > > > D StartOfElement PR > > > > > > D UserData * value > > > > > > D depth 10I 0 value > > > > > > D name 1024A varying const > > > > > > D path 24576A varying const > > > > > > D value 65535A varying const > > > > > > D attrs * dim(32767) > > > > > > D const > options(*varsize) > > > > > > > > > D EndOfElement PR > > > > > > D UserData * value > > > > > > D depth 10I 0 value > > > > > > D name 1024A varying const > > > > > > D path 24576A varying const > > > > > > D value 65535A varying const > > > > > > D attrs * dim(32767) > > > > > > D const > options(*varsize) > > > > > > > > > d GetLib PR extpgm('WUTBOBJC') > > > > > > d 10 const > > > > > > d 10 > > > > > > d 7 const > > > > > > d 50 > > > > > > d 1 > > > > > > > > > D RunCommand PR ExtPgm('QCMDEXC') > > > > > > D Command 70a Const > > > > > > D Length 15p 5 Const > > > > > > > > > D SDS > > > > > > D PgmId *PROC > > > > > > D WrkStn 244 253 > > > > > > D UsrNm 254 263 > > > > > > > > > D rc s 10I 0 > > > > > > D fd S 10I 0 > > > > > > D flags S 10U 0 > > > > > > D mode S 10U 0 > > > > > > D len S 10I 0 > > > > > > > > > /Free > > > > > > > > > GetDate(DateTime); > > > > > > wDebugFile = '/Logistix/Debug/DQ' + %EditC(DateTime:'X') > + > > > '.txt'; > > > > > > http_debug(*ON: wDebugFile); > > > > > > > > > GetLib('KINETICS':ObjLib:'*JOBD':ObjDesc:ObjErr); > > > > > > Chain (ObjLib) LPODSHM; > > > > > > > > > wTimeStamp = %Char(%Timestamp():*ISO0); > > > > > > wFile = '/Logistix/Events/EV' + wTimeStamp + '.xml'; > > > > > > flags = O_RDWR + O_CREAT + O_TRUNC; > > > > > > mode = S_IRUSR + S_IWUSR + S_IRGRP + S_IROTH; > > > > > > fd = Open(wFile:flags:mode); > > > > > > If fd >= *Zero; > > > > > > Monitor; > > > > > > callp write(fd:%addr(DriverProExport) + 4: > > > > > > %len(%Trim(DriverProExport))); > > > > > > callp close(fd); > > > > > > rc = http_parse_xml_stmf( wFile > > > > > > : HTTP_XML_CALC > > > > > > : %paddr(StartOfElement) > > > > > > : %paddr(EndOfElement) > > > > > > : *Null); > > > > > > If RC <> *Zero; > > > > > > // Error processing; > > > > > > http_error(err); > > > > > > http_crash(); > > > > > > Valid = 'false'; > > > > > > Msg = 'Unable to parse file'; > > > > > > Else; > > > > > > Valid = 'true'; > > > > > > Msg = 'OK'; > > > > > > // Do some processing > > > > > > EndIf; > > > > > > On-Error; > > > > > > // Error processing; > > > > > > http_error(err); > > > > > > http_crash(); > > > > > > Valid = 'false'; > > > > > > Msg = 'Unknown error in writing or parsing ifs file'; > > > > > > EndMon; > > > > > > Else; > > > > > > // Error processing; > > > > > > http_error(err); > > > > > > http_crash(); > > > > > > Valid = 'false'; > > > > > > Msg = 'Unable to open ifs file'; > > > > > > EndIf; > > > > > > > > > Return; > > > > > > /End-Free > > > > > > > > > Thanks, > > > > > > > > > Kevin > > > > > > > > > > > > Thanks, > > > > > > > > > Kevin > > > > > > References > > > > > > 1. [2][4]http://tempuri.org/ > > > > > > > > > > > > > > ---------------------------------------------------------------------- > > > - This is the FTPAPI mailing list. To unsubscribe, please go to: > > > [3][5]http://www.scottklement.com/mailman/listinfo/ftpapi > > > > > ---------------------------------------------------------------------- > > > - > > References > > 1. [6]http://tempuri.org/%22%3e%3cRouteUpdates%3e%3cRoute%3e%3cDCID%3e2%3c /DCID > 2. [7]http://tempuri.org/ > 3. [8]http://www.scottklement.com/mailman/listinfo/ftpapi > > > > ---------------------------------------------------------------------- > - This is the FTPAPI mailing list. To unsubscribe, please go to: > [9]http://www.scottklement.com/mailman/listinfo/ftpapi > ---------------------------------------------------------------------- > - References 1. mailto:ftpapi-bounces@xxxxxxxxxxxxxxxxxxxxxx 2. mailto:ftpapi-bounces@xxxxxxxxxxxxxxxxxxxxxx 3. http://tempuri.org/%22%3e%3cRouteUpdates%3e%3cRoute%3e%3cDCID%3e2%3c/DCID 4. http://tempuri.org/ 5. http://www.scottklement.com/mailman/listinfo/ftpapi 6. http://tempuri.org/%22%3e%3cRouteUpdates%3e%3cRoute%3e%3cDCID%3e2%3c/DCID 7. http://tempuri.org/ 8. http://www.scottklement.com/mailman/listinfo/ftpapi 9. http://www.scottklement.com/mailman/listinfo/ftpapi
Attachment:
PSRTEST.rpgle
Description: Binary data
Attachment:
PSRTEST1.rpgle
Description: Binary data
----------------------------------------------------------------------- This is the FTPAPI mailing list. To unsubscribe, please go to: http://www.scottklement.com/mailman/listinfo/ftpapi -----------------------------------------------------------------------