Focal Point
Passing multi values in a &var to a web service

This topic can be found at:
https://forums.informationbuilders.com/eve/forums/a/tpc/f/7971057331/m/6441086682

June 05, 2008, 02:31 PM
dballest
Passing multi values in a &var to a web service
Hi All,

I have combobox in my html page that accepts multiple values and I wrote a javascript function to parse that values and put it in a 'value1','value2',...etc format.

So PROCCODE = 'D498','D2M8' is then passed to my FEX to call a webservice to get the data.

Here's a snippet:

-SET &WHR_PROCESSCODE = 'WHERE strProcessCode EQ ' | '''' | &PROCCODE | '''' | ' ;' ;

TABLE FILE rv_getfabproductasobjectarray_ws
SUM
BASEPRODUCT
LINECODE
PROCESSCODE
DIVISIONPRODUCT
CONDITIONKEY
STEPCODE
BY
BASEPRODUCT NOPRINT
BY
LINECODE NOPRINT

&WHR_PROCESSCODE
&WHR_DIVISIONPRODUCT
&WHR_BASEPRODUCT
&WHR_CONDITIONKEY
&WHR_STRSTEPCODE

ON TABLE HOLD AS RV_PRODUCT_TMP
END

The error message:


TABLE FILE rv_getfabproductasobjectarray_ws
SUM
BASEPRODUCT
LINECODE
PROCESSCODE
DIVISIONPRODUCT
CONDITIONKEY
STEPCODE
BY
BASEPRODUCT NOPRINT
BY
LINECODE NOPRINT
WHERE strProcessCode EQ ''D498','D2M8'' ;
WHERE strDivisionProduct EQ ' ' ;
WHERE strBaseProduct EQ ' ' ;
WHERE strConditionKey EQ ' ' ;
WHERE strStepCode EQ 'A01J41' ;
-* ON TABLE HOLD AS RV_PRODUCT_TMP
END
-EXIT
0 ERROR AT OR NEAR LINE 15 IN PROCEDURE newfex FOCEXEC *
(FOC257) MISSING QUOTE MARKS: ,'D2M8'' ;
BYPASSING TO END OF COMMAND
(FOC009) INCOMPLETE REQUEST STATEMENT


I need to pass the value of process code to the webservice in 'value1','value2' format (value in single quotes).

Any inputs or suggestions would be greatly appreciated.

Dan


Dev: WebFOCUS 7.6.10, Data Migrator 7.6.10
QA: WebFOCUS 7.6.10, Data Migrator 7.6.10
Prod: WebFOCUS 7.6.2, Data Migrator 7.6.8
Windows 2K3, Tomcat 5.5.17, IIS 6
Usage: HTML, PDF, Excel, Self-serve, BID and MRE
June 05, 2008, 02:41 PM
Francis Mariani
WHERE strProcessCode EQ ''D498','D2M8'' ;

Wouldn't this be better:
WHERE strProcessCode IN ('D498','D2M8');



Francis


Give me code, or give me retirement. In FOCUS since 1991

Production: WF 7.7.05M, Dev Studio, BID, MRE, WebSphere, DB2 / Test: WF 8.1.05M, App Studio, BI Portal, Report Caster, jQuery, HighCharts, Apache Tomcat, MS SQL Server
June 05, 2008, 02:52 PM
dballest
Francis,

I need to pass the whole 'D498','D2M8' string to a parameter in the webservice. There is logic in the webservice that will parse this and query whatever data source it needs.

If I access the webservice directly via browser, I enter 'D498','D2M8' on the Process Code parameter input and were no errors and I get data returned as object array.


Dev: WebFOCUS 7.6.10, Data Migrator 7.6.10
QA: WebFOCUS 7.6.10, Data Migrator 7.6.10
Prod: WebFOCUS 7.6.2, Data Migrator 7.6.8
Windows 2K3, Tomcat 5.5.17, IIS 6
Usage: HTML, PDF, Excel, Self-serve, BID and MRE
June 05, 2008, 03:07 PM
Francis Mariani
You may get away with QUOTEDSTRING:

-SET &ECHO=ALL;

-SET &VAR1 = '''' | 'CANADA' | ''',''' |'UKRAINE' | '''';

-TYPE &VAR1

TABLE FILE CAR
PRINT
EQUIP
WHERE EQUIP EQ &VAR1.QUOTEDSTRING
END
-RUN



Francis


Give me code, or give me retirement. In FOCUS since 1991

Production: WF 7.7.05M, Dev Studio, BID, MRE, WebSphere, DB2 / Test: WF 8.1.05M, App Studio, BI Portal, Report Caster, jQuery, HighCharts, Apache Tomcat, MS SQL Server
June 05, 2008, 03:07 PM
j.gross
quote:
WHERE strProcessCode EQ ''D498','D2M8'' ;


You need to generate
WHERE strProcessCode EQ '''D498'',''D2M8''' ;

(doubling all but the outermost quote marks),

so Focus will parse it properly as a single quoted value, and will pass
'D498','D2M8'
to the called service as a single value.

This message has been edited. Last edited by: j.gross,


- Jack Gross
WF through 8.1.05
June 05, 2008, 04:08 PM
dballest
That's it! Thanks Francis and J.G. for your suggestions.


Dev: WebFOCUS 7.6.10, Data Migrator 7.6.10
QA: WebFOCUS 7.6.10, Data Migrator 7.6.10
Prod: WebFOCUS 7.6.2, Data Migrator 7.6.8
Windows 2K3, Tomcat 5.5.17, IIS 6
Usage: HTML, PDF, Excel, Self-serve, BID and MRE