You can invoke webservice from a button fieldchange event also .
using &Request = CreateMessage(Operation.serviceoperation_name, %IntBroker_Request);Example:-
&msg = CreateMessage(Operation.CONVERSIONRATE);
/* Creating the SOAP Request */
&soapReq = CreateSOAPDoc();
&soapReq.AddHeader();
&soapReq.AddEnvelope(%SOAP_Custom);
&EnvNode = &soapReq.EnvelopeNode;
&EnvNode.AddAttribute("xmlns", "http:/ / www.webserviceX.NET");
&soapReq.AddMethod("ConversionRate", 1);
&soapReq.AddParm("FromCurrency", "USD");
&soapReq.AddParm("ToCurrency", "CAD");
&xmldoc = &soapReq.XmlDoc;
&msg.SetXmlDoc(&soapReq.XmlDoc);
&res = %IntBroker.SyncRequest(&msg);
&Response = &res.GenXMLString();
&myXML = CreateXmlDoc(&Response);
/* Extract the Results; */
&myRet = &myXML.GetElementsByTagName("ConversionRateResult");
/* Show Result */
MessageBox(0, "", 0, 0, "USD to CAD = " | &myRet [1].nodevalue);
/* Creating the SOAP Request */
&soapReq = CreateSOAPDoc();
&soapReq.AddHeader();
&soapReq.AddEnvelope(%SOAP_Custom);
&EnvNode = &soapReq.EnvelopeNode;
&EnvNode.AddAttribute("xmlns", "http:/
&soapReq.AddMethod("ConversionRate", 1);
&soapReq.AddParm("FromCurrency", "USD");
&soapReq.AddParm("ToCurrency", "CAD");
&xmldoc = &soapReq.XmlDoc;
&msg.SetXmlDoc(&soapReq.XmlDoc);
&res = %IntBroker.SyncRequest(&msg);
&Response = &res.GenXMLString();
&myXML = CreateXmlDoc(&Response);
/* Extract the Results; */
&myRet = &myXML.GetElementsByTagName("ConversionRateResult");
/* Show Result */
MessageBox(0, "", 0, 0, "USD to CAD = " | &myRet [1].nodevalue);
--------------------------------------------------------------------------------------------------
/* all are not required ,take the values from wsdl") */
&EnvNode.AddAttribute("xmlns:xsi", "http:/ / www.w3.org/ 2001/ XMLSchema-instance");
&EnvNode.AddAttribute("xmlns:xsd", "http:/ / www.w3.org/ 2001/ XMLSchema");
&EnvNode.AddAttribute("xmlns:soap", "http:/ / schemas.xmlsoap.org/ soap/ envelope");
&EnvNode.AddAttribute("xmlns", "http:/ / www.xignite.com/ services");
&EnvNode.AddAttribute("xmlns:xsi", "http:/
&EnvNode.AddAttribute("xmlns:xsd", "http:/
&EnvNode.AddAttribute("xmlns:soap", "http:/
&EnvNode.AddAttribute("xmlns", "http:/
No comments:
Post a Comment