Hi guys,
I am developing a SOAP webservice, in which i want to update the items in bulk. For this, i have create a table which will have the records of all the items which have to be updated.
Now the challenge which i m facing is, the input of the webservice will be the List of items e.g. if i created a table MyItems then on the input of this method i will have the List<MyItems> .
So how can i receive it in my method as a parameter? how can i treat it as list because in NAV we cannot make dynamics array.
Suggestions will be appreciated. Thanks
Best Regards
Zohaib Ahmed
Dynamics NAV ERP Technical Consultant.
please like / agree / verify my answer, if it was helpful for you. thanks.
1
Answers
ListFunction(myList : DotNet "System.Collections.Generic.List`1")
Zaid Tariq
Dynamics NAV/365 BC Developer at Dynamics 360
please like / agree / verify my answer, if was helpful.
Blog - rockwithnav.wordpress.com/
Twitter - https://twitter.com/RockwithNav
Facebook - https://facebook.com/rockwithnav/
How to do that? do you have any tutorial for this? how to send parameter to the webservice?
Zohaib Ahmed
Dynamics NAV ERP Technical Consultant.
please like / agree / verify my answer, if it was helpful for you. thanks.
The below example is getting an XML as parameter from WebService.
First you need to make the XMLPORT in NAV, make sure the schema would be exactly the same as you will get in parameter. IN the Parameter add Bigtext and get your xmlport as a parameter in it.
Now write this code.
TempBlob.INIT;
TempBlob.Blob.CREATEOUTSTREAM(OutStream);
Bigtest.WRITE(OutStream);//This Bigtext is the Parameter which consists of XML
TempBlob.INSERT;
TempBlob.CALCFIELDS(Blob);
TempBlob.Blob.CREATEINSTREAM(InStream);
XMLPORT.IMPORT(XMLPORT::Your Created XMLPORT,InStream);
Blog - rockwithnav.wordpress.com/
Twitter - https://twitter.com/RockwithNav
Facebook - https://facebook.com/rockwithnav/
so when i call the webservice in .NET then can i pass the c# List or i need to first translate the c# list into xml string and send then xml string to this webservice?
Zohaib Ahmed
Dynamics NAV ERP Technical Consultant.
please like / agree / verify my answer, if it was helpful for you. thanks.
Blog - rockwithnav.wordpress.com/
Twitter - https://twitter.com/RockwithNav
Facebook - https://facebook.com/rockwithnav/