Options

Web Service Integration

dnvpraveendnvpraveen Member Posts: 6
edited 2010-09-10 in NAV Three Tier
Dear All with help of Mibuso Community i had integrated web services In navision. Thanks to all the Members.

I am able communicate, send Soap Requests and save the value in a XMl Doc.

A Small issue is still pending I am unable to get Node value to a text Variable.

Code

// Webservice call method
//Initialization
IF ISCLEAR(locautXmlDoc) THEN
CREATE(locautXmlDoc);
locautXmlDoc.async:=FALSE;
IF ISCLEAR(XMLnode) THEN
CREATE(XMLnode);
XMLnode.async:=FALSE;
//Posting WSDL
IF ISCLEAR(locautXmlHttp) THEN
CREATE(locautXmlHttp);
locautXmlHttp.open('post','http://10.32.9.51:8082/RackConfigService.svc?wsdl',0);
//Soap Header
locautXmlHttp.setRequestHeader('Content-type','text/xml; charset=UTF-8');
//Soap Action
locautXmlHttp.setRequestHeader('SOAPAction','http://tempuri.org/IRackConfigService/CreateRackConfig');
//Loading XML Response
locautXmlDoc.loadXML('<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/&quot; xmlns:SOAP-ENC="'
+'http://schemas.xmlsoap.org/soap/encoding/&quot; xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance&quot; xmlns:xsd="'
+'http://www.w3.org/2001/XMLSchema">'
+' <SOAP-ENV:Body>'
+' <m:CreateRackConfig xmlns:m="http://tempuri.org/">'
+' <m:strOrderKey>2</m:strOrderKey>'
+' <m:intSqueezeByPer>0</m:intSqueezeByPer>'
+' </m:CreateRackConfig>'
+'</SOAP-ENV:Body>'
+'</SOAP-ENV:Envelope>');

//Sending XML Response
locautXmlHttp.send(locautXmlDoc);
//Captureing the Final Response
locautXmlDoc.load(locautXmlHttp.responseXML);

//Save XML result
locautXmlDoc.save('c:\NHW\Ws.xml');

//unable to collect the NODE value
XMLnode:= locautXmlDoc.selectSingleNode('//CreateRackConfigResponse/CreateRackConfigResult');


Error is invalid assignment. it is not possible to assign a IXMLDOMELEMENT to a DOMDocumnet

IF NOT ISCLEAR(XMLnode) THEN
MESSAGE(XMLnode.text);



This is the response. In which i want to capture the Node value to a text variable.
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/"&gt;
- <s:Body>
- <CreateRackConfigResponse xmlns="http://tempuri.org/"&gt;
<CreateRackConfigResult>true</CreateRackConfigResult>
</CreateRackConfigResponse>
</s:Body>
</s:Envelope>


Variable i defined in Navision
Name DataType Subtype Length
locautXmlDoc Automation 'Microsoft XML, v6.0'.DOMDocument
locautXmlHttp Automation 'Microsoft XML, v6.0'.XMLHTTP
test Text 250
XMLnode Automation 'Microsoft XML, v6.0'.DOMDocument

Please help me In this issue.
Sign In or Register to comment.