# Web Service Integration

**URL:** <https://www.dynamicsuser.net/t/web-service-integration/26890>\
**Category:** Developers Forum\
**Created:** [September 11, 2010, 10:11pm UTC](https://www.dynamicsuser.net/t/web-service-integration/26890 "2010-09-11T22:11:42Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![dnvpraveen](https://avatars.discourse-cdn.com/v4/letter/d/9de0a6/32.png) [@dnvpraveen](https://www.dynamicsuser.net/u/dnvpraveen)\
**Post date:** [September 11, 2010, 10:11pm UTC](https://www.dynamicsuser.net/t/web-service-integration/26890/1 "2010-09-11T22:11:42Z")

</div>

Dear All with help of Dynamics User Community i had integrated web services In navision. Thanks to all.

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’,‘10.32.9.51:8082/RackConfigService.svc  
//Soap Header  
locautXmlHttp.setRequestHeader(‘Content-type’,‘text/xml; charset=UTF-8’);  
//Soap Action  
locautXmlHttp.setRequestHeader(‘SOAPAction’,‘[tempuri.org/…/CreateRackConfig’);](http://tempuri.org/IRackConfigService/CreateRackConfig')😉  
//Loading XML Response  
locautXmlDoc.loadXML(’\<SOAP-ENV:Envelope xmlns:SOAP-ENV=""\>[schemas.xmlsoap.org/.../](http://schemas.xmlsoap.org/.../)" xmlns:SOAP-ENC="’  
+’["\>schemas.xmlsoap.org/…/" xmlns:xsi="](http://schemas.xmlsoap.org/soap/encoding/)["\>www.w3.org/…/XMLSchema-instance"](http://www.w3.org/2001/XMLSchema-instance) xmlns:xsd="’  
+’[’"\>www.w3.org/…/XMLSchema"\>’](http://www.w3.org/2001/XMLSchema)  
+’ SOAP-ENV:Body’  
+’ \<m:CreateRackConfig xmlns:m="[’"\>http://tempuri.org/"\>’](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="["\>schemas.xmlsoap.org/…/"\>](http://schemas.xmlsoap.org/soap/envelope/)

- \<s:Body\>
- [http://tempuri.org/](http://tempuri.org/)"\>]([http://tempuri.org/](http://tempuri.org/))  
true  
  
\</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.
