Can any one helppp me what's wrong on this code tring to integartion with simple calculate wsdl example but the result is zero
help please
|******************************************************************************
|* tcmcs8889 0 VRC B61U a info
|*
|* Installation user
|* 2022-10-19
|******************************************************************************
|* Main table tcmcs888 Country Currency Test, Form Type 1
|******************************************************************************
|****************************** declaration section ***************************
declaration:
table ttcmcs888 |* Country Currency Test
domain tcid id.x
domain tcinta inta.x
domain tcintb intb.x
domain tcrest rest.x
domain tcopra opra.x
long msgNode
long requestNode
long responseNode
long methodNode
long status
long ns
string result (180)
#include <bic_soap>
|****************************** program section ********************************
before.new.object:
select tcmcs888.id from tcmcs888
order by tcmcs888.id desc
as set with 1 rows
selectdo
tcmcs888.id = tcmcs888.id + 1
endselect
if tcmcs888.id < 1 then
tcmcs888.id = 1
endif
select tcmcs888.id from tcmcs888
order by tcmcs888.id desc
as set with 1 rows
selectdo
tcmcs888.id = tcmcs888.id + 1
endselect
if tcmcs888.id < 1 then
tcmcs888.id = 1
endif
|****************************** group section **********************************
|****************************** CHOICE SECTION *************************
choice.api.get:
on.choice:
api.get()
|****************************** FUNCTION SECTION *************************
functions:
function api.get()
{
id.x = tcmcs888.id
inta.x = tcmcs888.inta
intb.x = tcmcs888.intb
rest.x = tcmcs888.rest
opra.x = tcmcs888.opra
| Create a new SOAP message
msgNode = soap.newMessage( URI_SOAP12 )
| Define the method to call
requestNode = xmlNewNode( "Calculator" )
| Declare and set the namespace
ns = xmlNewNamespace( requestNode, "", "http://tempuri.org" )
message ("ns = "&str$(ns))
xmlSetNamespace( requestNode, ns )
|xmlNewDataElementNs( ns, "operation", opra.x, requestNode )
xmlNewDataElementNs( ns, "intA", inta.x, requestNode )
xmlNewDataElementNs( ns, "intB", intb.x, requestNode )
message ("numberA = "&str$(inta.x))
message ("numberB = "&str$(intb.x))
message ("ns = "&str$(ns))
| Add the method to the SOAP envelope contained the in the SOAP message
soap.addMethod( msgNode, requestNode )
message ("msgNode = "&str$(msgNode))
| Set the SOAP Action
soap.setAction( msgNode, "http://tempuri.org/Add" )
message ("setAction = "&str$(msgNode))
| Invoke the SOAP request
status = soap.invoke( msgNode, "http://www.dneonline.com/calculator.asmx", responseNode )
message ("Invoke Status = "&str$(msgNode))
| Check the response
if status = 0 then
| Get the method result
methodNode = soap.getMethod( responseNode )
result = xmlDataElement$( methodNode, "AddResult" )
if not isspace(result) then
message(result)
endif
else
| Something went wrong...
message( "SOAP Error: %d", status )
message ("status = "&str$(status))
endif
| Cleanup
soap.deleteMessage( msgNode )
soap.deleteMessage( responseNode )
select tcmcs888.* from tcmcs888 for update
where
tcmcs888.id =:id.x
selectdo
tcmcs888.rest = val(result)
message("Id = "&str$( tcmcs888.id))
message ("ns = "&str$(result))
db.update(ttcmcs888,db.retry)
commit.transaction()
endselect
}
|