I am looking for a basic example of using an xmlport with web services. I have followed Freddy's Blog which does this with a Vista Gadget + J Script. So I am just looking for the simplest example of the vb.net code, I already have a codeunit + Functions + xmlport setup similar to the one in Freddy's Blog - Vista Gadget - My "Stuff". For an easy example I am just looking to return the results of the xmlport to a variable.
0
Comments
http://www.mibuso.com/forum/viewtopic.php?f=32&t=29557
Hopefully that helps
Group Program Manager, Client
Microsoft Dynamics NAV
http://blogs.msdn.com/freddyk
The information in this post is provided "AS IS" with no warranties, and confers no rights. This post does not represent the thoughts, intentions, plans or strategies of my employer. It is solely my opinion.
WSTest1.MyXMLCusts myXMLcusts = new WSTest1.MyXMLCusts();
test.GetXMLPort(ref myXMLcusts);
foreach (WSTest1.MyXMLCust myXMLcust in myXMLcusts.MyXMLCust)
Can you add the rest of the code for the initial connection? I think the test variable is the web service
jwilder@stonewallkitchen.com
jwilder@stonewallkitchen.com
Group Program Manager, Client
Microsoft Dynamics NAV
http://blogs.msdn.com/freddyk
The information in this post is provided "AS IS" with no warranties, and confers no rights. This post does not represent the thoughts, intentions, plans or strategies of my employer. It is solely my opinion.
I was looking at your VB Code and I was wondering what I would need to change to be able to pass an XML file as a parameter to a function that had a data type of type file as opposed to XML Port?
I have a function called NewInvoice(VAR InvoiceXMLDoc : File). I want NewInvoice to be accessible via web services but I don't know much about VB and I need to test my NAV function works when called from another programming language.
I have tried but I am battling to understand the VB syntax and I cannot try any other language as I only have VB on my laptop (from Excel).
ANy help would be greatly apperciated.
](*,)
1) Create an xmlport (make sure property Encoding is set to UTF-8)
2) Create a funcion in a codeunit that you will publish as a web service. Required Parameter is
Bigtext (make sure var is checked)
3) You'll need some Navision code like this:
TempBlob.Blob.CREATEOUTSTREAM(StreamOut)
YourXMLPort.SETDESTINATION(StreamOut);
YourXMLPort.EXPORT; //This fills the tempblob with your xmlfile
TempBlob.MODIFY;
TempBlob.Blob.CREATEINSTREAM(StreamIn);
BigText.READ(StreamIn); //This copys the xmlfile stored in the blob into the bigtext variable
Tempblob datatype record 99008535 temporary = yes
streamOut datatype Outstream
YourXMLPort datatype XMLPort ####?
StreamIn datatype InStream
BigText datatype BigText
Tell me if table 99008535 does not exist in your database. The trick behind this whole thing is to fill the BigText variable with whatever you want (Xml,csv file etc...) and pass it to your vb.net call.
The vb.net call just needs to pass a blank string into the bigtext parameter. It the end this string will contain your xmlfile.
jwilder@stonewallkitchen.com
jwilder@stonewallkitchen.com