  | | | Sending or receiving unnamed parameter arrays/lists with Axiom,ADB in Ax | Sending or receiving unnamed parameter arrays/lists with Axiom,ADB in Ax 2007-11-07 - By Pantvaidya, Vishwajit
Back I need to dynamically call any given webservice using its wsdl provided as a parameter. Since I do not know the signature of the service, I need to be able to provide for sending or receiving parameter arrays/lists. So I have coded a client which creates a payload by adding a number of children to an OMElement i .e
OMNamespace ns = fac.createOMNamespace(operationNamespace, "ns1"); payload = fac.createOMElement(operationName, ns); for (each parameter value) { OMElement value = fac.createOMElement(parameterName, ns); value.addChild(fac.createOMText(value, parameterValue.toString())); payload.addChild(value); }
Is this correct?
And do I absolutely need to provide parameter names as in the call "OMElement value = fac.createOMElement(parameterName, ns)" or is their another way by which I can only provide a list of input param values and have them associated with the webservice parameters based on position rather than name?
<html xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas -microsoft-com:office:word" xmlns="http://www.w3.org/TR/REC-html40">
<head> <meta http-equiv=Content-Type content="text/html; charset=us-ascii"> <meta name=Generator content="Microsoft Word 11 (filtered medium)"> <style> <!-- /* Style Definitions */ p.MsoNormal, li.MsoNormal, div.MsoNormal {margin:0in; margin-bottom:.0001pt; font-size:12.0pt; font-family:"Times New Roman";} a:link, span.MsoHyperlink {color:blue; text-decoration:underline;} a:visited, span.MsoHyperlinkFollowed {color:purple; text-decoration:underline;} span.EmailStyle17 {mso-style-type:personal-compose; font-family:Arial; color:windowtext;} @(protected) Section1 {size:8.5in 11.0in; margin:1.0in 1.25in 1.0in 1.25in;} div.Section1 {page:Section1;} --> </style>
</head>
<body lang=EN-US link=blue vlink=purple>
<div class=Section1>
<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt; font-family:Arial'>I need to dynamically call any given webservice using its wsdl provided as a parameter. Since I do not know the signature of the service, I need to be able to provide for sending or receiving parameter arrays/lists. So I have coded a client which creates a payload by adding a number of children to an OMElement i.e <o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt; font-family:Arial'><o:p> </o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt; font-family:Arial'>OMNamespace ns = fac.createOMNamespace(operationNamespace, "ns1");<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt; font-family:Arial'>payload = fac.createOMElement(operationName, ns);<o:p></o:p> </span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt; font-family:Arial'>for (each parameter value) {<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt; font-family:Arial'>OMElement value = fac.createOMElement(parameterName, ns);<o :p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt; font-family:Arial'>value.addChild(fac.createOMText(value, parameterValue.toString()));<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt; font-family:Arial'>payload.addChild(value);<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt; font-family:Arial'>}<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt; font-family:Arial'><o:p> </o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt; font-family:Arial'>Is this correct?<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt; font-family:Arial'><o:p> </o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt; font-family:Arial'>And do I absolutely need to provide parameter names as in the call “OMElement value = fac.createOMElement(parameterName, ns)” or is their another way by which I can only provide a list of input param values and have them associated with the webservice parameters based on position rather than name?<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt; font-family:Arial'><o:p> </o:p></span></font></p>
</div>
</body>
</html>
|
|
 |