http://peoplesoft.wikidot.com/consuming-a-web-service
Those who are in PeopleTools greater than 8.50 make sure below highlighted check box "Build Document Messages" is unchecked to build non rowset based messages. For the above pagelet which you are creating this checkbox has to be unchecked.
After creating a pagelet, also planned to create a custom page where user can enter the From Currency and To Currency for conversion.
Below is the page layout I created for this purpose. Below the screenshot I placed the code which I had in field change of the Currency Convertor button.
Below Message is created based on the service operation CONVERSIONRATE that was created based on the steps specified in the above referred site.
&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", PORTAL_DR.FROM_CURRENCY);
&soapReq.AddParm("ToCurrency", PORTAL_DR.TO_CURRENCY);
&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, PORTAL_DR.FROM_CURRENCY | " to " | PORTAL_DR.TO_CURRENCY | " = " | &myRet [1].nodevalue);
No comments:
Post a Comment