Hi All,
I have a problem I am hoping you can help with.
I am looking to user the Navision Communication Component to read a URL so I can then parse it.
Background
We are looking to read data from SMS text messages into Navision which include order history, we then want to process this data to create invoices I am happy with processing the data in Navision. But the area I am coming unstuck with is Reading in the SMS.
We have registered with a Online SMS handling company which will take the message and pass it on a HTTP Get to a web page of our choice. i.e. it will call http:\\www.Website.com\ProcessSMS.html?Message=hello&Number=930333
Now I can easily write something in .net to handle this and write to a holding table in navison but would love for Navision to be able to process this.
Now I have tried using the Navision Communication Component and got it successfully listening on a port. But using a url just gives a stream cannot find a zero -terminated string.
Has anyone done this before or have some pointers on what to do,
I have used the following code
OnRun()
IF ISCLEAR(CC2) THEN
CREATE(CC2);
IF ISCLEAR(SBA) THEN
CREATE(SBA);
CC2.AddBusAdapter(SBA, 0);
SBA.OpenSocket(9079, ' ');
CC2::MessageReceived(VAR InMessage : Automation "''.IDISPATCH")
InMsg := InMessage;
Ins := InMsg.GetStream();
WHILE NOT (Ins.EOS) DO
BEGIN
Ins.READ(txt);
MESSAGE(txt);
END;
InMsg.CommitMessage();
0
Comments
Independent Consultant/Developer
blog: https://dynamicsuser.net/nav/b/ara3n
http://x-dynamics.blogspot.ru/2011/06/web-service-for-dynamics-nav-server.html
The main idea is to generate correct HTTP header in response to ComCom2.
Follow my blog at http://x-dynamics.blogspot.com