Hi All,
We have a problem in NAV2013 that we donot understand:
We are trying to compile a CU with a XmlHTTPConn creation in it. Compiling goes well, from the designer, but saving gives an error message : You cannot create an Automation object "XmlHttpConn" on Microsoft Dynamics NAV Server. You must create it on a client computer.
The solution apperently is : place the creation between a "if not isservicetier" begin/end. Afterwards we are able to save and compile the codeunit.
The only problem that remains is executing the codeunit : In NAV2013 the coding is always running on the servicetier? So calling webservices is not possible anymore?
How do we create objects on a client in NAV2013?
Regards
Benno
0
Answers
MVP - Dynamics NAV
My BLOG
NAVERTICA a.s.
By having to use Interopt we are back at the discussions last TechDay's on using .Net by Navision developers.....
Thanks Anyway, not you fault
MVP - Dynamics NAV
My BLOG
NAVERTICA a.s.
No PM,please use the forum. || May the <SOLVED>-attribute be in your title!
Maybe I am a bit stubborn on not wanting to use .NET Interopt. It has to do with being afraid to lose the “old” skills and productivity, and getting back more time consuming .NET programming.
Perhaps you can help to solve this problem with Interopt, and prove me being to skeptical :
I want to read a XmlFile into a XmlDoc. In the classic environment it can be solved easy with In/OutStreams
Running it on NAV2013 results in : Streams cannot be used with client-side invoked automation objects.
Can you give me a start on how to solve it with Interopt (Simply declaring a DONET Memory Stream variable is not the answer)
Benno
MVP - Dynamics NAV
My BLOG
NAVERTICA a.s.
Trying to load the XmlFile (on the server) results in an empty XmlDoc.
Copying the save XmlDoc to the client, and loading it from there makes it all working.
Creating the XmlFile on the client does not work either, because it has to be filled using a XmlPort, with streams... and they do not work on the client.
Trying to do something Microsoft did not thought of?
MVP - Dynamics NAV
My BLOG
NAVERTICA a.s.
1. Create an outstream based on tempBLOB
2. Export using XMLPort
3. Create an instream based on the same tempBLOB
4. DOWNLOADFROMSTREAM into a client side file
5. Use XMLDoc.load to import the file.
Gunnar Gestsson
Microsoft Certified IT Professional
Dynamics NAV MVP
http://www.dynamics.is
http://Objects4NAV.com
Did not know of the existence of DOWNLOADFROMSTREAM!
Thanks Gunner and Kine :thumbsup:
This means that CREATE(XmlHttpConn, FALSE, TRUE) will prevent this error from occurring.
Peter Conijn
-The Learning Network-
http://www.dynamics.is/?p=1018
Gunnar Gestsson
Microsoft Certified IT Professional
Dynamics NAV MVP
http://www.dynamics.is
http://Objects4NAV.com
Exactly my question, without automation, no server/client site dependency's!
I am going to fit it in into our old solution, and try it on Nav2013.
Thanks
Benno
I can create my XMLHttpConn using CREATE(XMLDoc, FALSE, TRUE), call Send and load the response into an XMLDoc. I can pass that XMLDoc as a variable to a a function in a codeunit which saves a debug xml file on my file system and the files looks just fine. But I cant pass the XMLDoc to a function in a codeunit where I try to use the XMLDoc whith functions like XMLDoc.getElementsByTagName to process it.
Any suggestions?
http://www.linkedin.com/in/larswestman
http://www.linkedin.com/in/larswestman