Connect to a webservice using value of an expression

Sundreamz

New Member
Hi Friends,

I am trying to connect to a webservice from progress 4GL using the following statement,
hWebService:CONNECT("-WSDL C:\BIR\wsdl\DiscrepancyService.wsdl").
I am able to connect successfully this way.....


Now I want to achive the same connection by connecting to the webservice using the value of an expression. something like.......

DEFINE VARIABLE cParam AS CHARACTER.
cParam =
"-WSDL C:\BIR\wsdl\DiscrepancyService.wsdl".

hWebService:CONNECT(VALUE(cParam)).

This throws me an error "Unable to understand after -- "hWebService:CONNECT"

What want to achive out of all this is to write a common program to consume the webservice from Progress Program that takes all the Connection Parameters, Service Names, XML as input. So that this program can be used to call any webservice. something like.........

DEFINE VARIABLE hWebService AS HANDLE NO-UNDO.
DEFINE VARIABLE hServiceType AS HANDLE NO-UNDO.

DEFINE INPUT PARAMETER ipXml AS LONGCHAR NO-UNDO.
DEFINE INPUT PARAMETER ipWsdl AS CHARACTER NO-UNDO.
DEFINE INPUT PARAMETER ipServiceName AS CHARACTER NO-UNDO.
DEFINE INPUT PARAMETER ipServiceCall AS CHARACTER NO-UNDO.
DEFINE OUTPUT PARAMETER opXml AS LONGCHAR NO-UNDO.

CREATE SERVER hWebService.

hWebService:CONNECT VALUE(ipWsdl).

IF NOT hWebService:CONNECTED() THEN
MESSAGE "SERVER NOT CONNECTED" VIEW-AS ALERT-BOX.

RUN VALUE(ipServiceName) SET hServiceType ON hWebService.
IF NOT VALID-HANDLE(hServiceType) THEN
MESSAGE "ServiceType invalid: " VALID-HANDLE(hServiceType) VIEW-AS ALERT-BOX.

RUN VALUE(ipServiceCall) IN hServiceType(INPUT ipXml, OUTPUT opXml).

DELETE PROCEDURE hServiceType.
hWebService:DISCONNECT().
DELETE OBJECT hWebService.
Please Let me know is there any way I can achive this????????

Thanks in Advance,
Sundreamz
 
Top