Home | Forums | Contact | Search | Syndication  
 
 [login] [create account]   Thursday, August 28, 2025 
 
slxdeveloper.com Community Forums  
   
The Forums on slxdeveloper.com are now retired. The forum archive will remain available for the time being. Thank you for your participation on slxdeveloper.com!
 Architect Forums - SalesLogix Scripting & Customization
Forum to discuss writing script in Architect plugins for SalesLogix & general SalesLogix customization topics (for Windows client only). View the code of conduct for posting guidelines.
Forums RSS Feed


 Back to Forum List | Back to SalesLogix Scripting & Customization | New ThreadView:  Search:  
 Author  Thread: Parse DOM in LAN Client - help
Veronka Capone
Posts: 113
 
Parse DOM in LAN Client - helpYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 03 Apr 09 7:59 AM
Hi,

I need some help on sending/parsing a XMLDocument from a Web Service. I feel that my code on the client is a bit clumsy. I need some advice how to aproach this problem or better implementation.

I am sending a request to a Web Service. That WebService is doing some heavy processing on the server side and then returns a XMLDocument to the client.

Just for comparisioan, I created 2 samples on the client, one parsing from a static .xml file, one parsing directly from the WebService(this is what I want)
Both of them are working, I understand how to parse the xml document, but I am lost on the dynamic one, and my code is working just because of trial of error.

Thanks.

------------------------------------------
Code on the Web Service
------------------------------------------
[WebMethod]
public XmlDocument HelloWorld()
{
XmlDocument doc = new XmlDocument();
doc.LoadXml("" +
"Error" +
"C:\\Temp\\blah.PDF" +
"
");
doc.Save(@"C:\Temp\Test.xml"); //just to test static load into DOM
return doc;
}

------------------------------------------
1) Code SLX Client - Static
------------------------------------------
Sub GetXML_Static(Sender)
'method 1 - load .XML file - works fine
dim objXML
set objXML = CreateObject("Microsoft.XMLDOM")
objXML.async = false

if objXML.Load("C:\Temp\Test.xml") then
dim Root, NodeList, Elem
Set Root = objXML.documentElement
Set NodeList = Root.getElementsByTagName("status")
For Each Elem In NodeList
MsgBox Elem.firstChild.nodeValue
Next

Set NodeList = Root.getElementsByTagName("filename")
For Each Elem In NodeList
MsgBox Elem.firstChild.nodeValue
Next
else
MsgBox "Error reading the respone from the Web Server"
end if

set objXML = nothing
end sub

------------------------------------------
2) Code SLX Client - Dynamic
------------------------------------------
sub GetXmlDOM(Sender)
'invoke SOAP
dim c
set c = CreateObject("MSSOAP.SOAPClient30")

if IsNull(c) then
MsgBox("Could not create SOAPClient")
exit sub
end if

c.mssoapinit("http://localhost:1723/Service1.asmx?WSDL")

dim objXML
set objXML = CreateObject("Microsoft.XMLDOM")
objXML.async = false

dim response
set response = c.HelloWorld()
set objXML = response.context 'Load, LoadXML it's not working ??? why response.context? This seems to be a XMLNode already !!

dim strStatus, strFileName
strStatus = objXML.getElementsByTagName("status").item(0).text
strFileName = objXML.getElementsByTagName("filename").item(0).text

MsgBox strStatus
MsgBox strFileName
end sub

[Reply][Quote]
Veronka Capone
Posts: 113
 
Re: Parse DOM in LAN Client - helpYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 03 Apr 09 8:11 AM
Oh. I see that the tags are dropped in my WebMethod. How do I post text with "<" and ">" ?
[Reply][Quote]
 Page 1 of 1 
  You can subscribe to receive a daily forum digest in your user profile. View the site code of conduct for posting guidelines.

   Forum RSS Feed - Subscribe to the forum RSS feed to keep on top of the latest forum activity!
 

 
 slxdeveloper.com is brought to you courtesy of Ryan Farley & Customer FX Corporation.
 This site, and all contents herein, are Copyright © 2025 Customer FX Corporation. The information and opinions expressed here are not endorsed by Sage Software.

code of conduct | Subscribe to the slxdeveloper.com Latest Article RSS feed
   
 
page cache (param): 8/28/2025 4:11:49 PM