SmS through XML

navuser1
Member Posts: 1,334
Dear all,
I have an XML Format :
How to use this in Navision 2009 SP1 to send SMS ??
kindly share our knowledge.
I have an XML Format :
How to use this in Navision 2009 SP1 to send SMS ??
kindly share our knowledge.
Now or Never
0
Comments
-
You need to somehow send this XML to correct provider which will use it to send the sms. I assume that you will have some URL of their webservice and you need to send this XML as part of WebService request, e.g. through SOAP protokol. Just search this forum for how to consume webservices. You will find examples...0
-
I have created the xml file through C/AL(code given below) in Navision(Classic Client) now I want to send this to the provider (http://keepsmsing.com/myhome/RequestListener). What should I do ? Kindly relpy.
Thanks you.CREATE(xmlDoc); xmlMgt.SetNormalCase; xmlProcessingInst:=xmlDoc.createProcessingInstruction('xml','version="1.0"'); CurrNode := xmlDoc.appendChild(xmlProcessingInst); CurrNode := xmlDoc.createElement('TICKJL'); CurrNode := xmlDoc.appendChild(CurrNode); xmlMgt.AddAttribute(CurrNode,'version','1.0'); xmlMgt.AddElement(CurrNode,'request','','',NewChild); xmlMgt.AddAttribute(NewChild,'userID','pass001'); xmlMgt.AddAttribute(NewChild,'password','pass002'); xmlMgt.AddAttribute(NewChild,'pin','0006'); xmlMgt.AddAttribute(NewChild,'Type','push'); CurrNode:=NewChild; //one level deeper xmlMgt.AddElement(CurrNode,'publishData','','',NewChild); xmlMgt.AddElement(CurrNode,'FromAddress','ASDRF','',NewChild); xmlMgt.AddElement(CurrNode,'Message','Your Message Here','',NewChild); xmlMgt.AddElement(CurrNode,'AddressArray','','',NewChild); CurrNode1:=NewChild; //One level deeper xmlMgt.AddElement(CurrNode1,'address','9051720463','',NewChild); xmlMgt.AddElement(CurrNode,'ScheduleTime','','',NewChild); xmlDoc.save('D:\xmlFile1.xml');
Now or Never0 -
Check my approach at http://x-dynamics.blogspot.com/2011/07/ ... m-nav.htmlSincerely yours, GRIZZLY
Follow my blog at http://x-dynamics.blogspot.com0 -
GRIZZLY wrote:Check my approach at http://x-dynamics.blogspot.com/2011/07/ ... m-nav.html
Unable to create Xml file through the approach you described.You wrote:RequestText := xmlBegin +
'<Package....
.....
.....
'</Package>';
What is xmlBegin ?
kindly reply.
Thanks!!!Now or Never0 -
It's a Text constant:
<?xml version="1.0" encoding="utf-8" ?>Sincerely yours, GRIZZLY
Follow my blog at http://x-dynamics.blogspot.com0 -
Thanks for your reply...
Code which is still not working given below...SMSTable.GET(); CLEAR(XMLRequest); IF ISCLEAR(XMLRequest) THEN CREATE(XMLRequest); text :=xmlBegin+ '<SMS version=1.0>'+ '<request userid="'+SMSTable.ID+'" password="'+SMSTable.Password+'" pin="'+SMSTable.PIN+'" type="'+SMSTable.Type+'">'+ '<publishData>'+ '<fromAddress>'+SMSTable.Type+'</fromAddress>'+ '<messageTxt>Your message here</messageTxt>'+ '<addressArray>'+ '<address>9051720463</address>'+ '</addressArray>'+ '</publishData>'+ '<scheduleTime></scheduleTime>'+ '</request>'+ '</SMS>'; IF NOT XMLRequest.loadXML(text) THEN ERROR('Request Failed'); XMLRequest.save('D:\xmlFile4.xml'); IF ISCLEAR(HTTP) THEN CREATE(HTTP); HTTP.open('POST','http://www.msing.com/home/ReqListener',FALSE); HTTP.setRequestHeader('Content-Type','text/xml'); HTTP.send(text);
XMLRequest.LoadXML gives an error message('Request Failed').
Kindly reply..Now or Never0 -
It means your xml document is not well-formed.
Try to add double quotes in constant:
'<SMS version="1.0">'+Sincerely yours, GRIZZLY
Follow my blog at http://x-dynamics.blogspot.com0 -
It's done.
Thanks!Now or Never0 -
-
Now! I'm trying the whole thing within SQL Server (version 2008).Now or Never0
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.6K Microsoft Dynamics NAV
- 18.7K NAV Three Tier
- 38.4K NAV/Navision Classic Client
- 3.6K Navision Attain
- 2.4K Navision Financials
- 116 Navision DOS
- 851 Navision e-Commerce
- 1K NAV Tips & Tricks
- 772 NAV Dutch speaking only
- 617 NAV Courses, Exams & Certification
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 320 Dynamics CRM
- 111 Dynamics GP
- 10 Dynamics SL
- 1.5K Other
- 990 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 35 Design Patterns (General & Best Practices)
- 1 Architectural Patterns
- 10 Design Patterns
- 5 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1.1K General Chat
- 1.6K Website
- 83 Testing
- 1.2K Download section
- 23 How Tos section
- 252 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions