Receive List of Records of MyTable through SOAP webservice.
zohaibu95@hotmail.com
Member Posts: 223
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
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.
Zohaib Ahmed
Dynamics NAV ERP Technical Consultant.
please like / agree / verify my answer, if it was helpful for you. thanks.
1
Best Answer
-
Just you need to play with the Instreams OR Outstreams, either you want to send xmlport as a Parameter from NAV or to get in NAV.
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);Thanks
Blog - rockwithnav.wordpress.com/
Twitter - https://twitter.com/RockwithNav
Facebook - https://facebook.com/rockwithnav/5
Answers
-
I guss you can do it like
ListFunction(myList : DotNet "System.Collections.Generic.List`1")Best Regards:
Zaid Tariq
Dynamics NAV/365 BC Developer at Dynamics 360
please like / agree / verify my answer, if was helpful.1 -
Why not using XMLPORT as a webservice parameter in which you will have list of all the Items.Thanks
Blog - rockwithnav.wordpress.com/
Twitter - https://twitter.com/RockwithNav
Facebook - https://facebook.com/rockwithnav/1 -
RockWithNAV wrote: »Why not using XMLPORT as a webservice parameter in which you will have list of all the Items.
How to do that? do you have any tutorial for this? how to send parameter to the webservice?Best Regards
Zohaib Ahmed
Dynamics NAV ERP Technical Consultant.
please like / agree / verify my answer, if it was helpful for you. thanks.0 -
Just you need to play with the Instreams OR Outstreams, either you want to send xmlport as a Parameter from NAV or to get in NAV.
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);Thanks
Blog - rockwithnav.wordpress.com/
Twitter - https://twitter.com/RockwithNav
Facebook - https://facebook.com/rockwithnav/5 -
RockWithNAV wrote: »Just you need to play with the Instreams OR Outstreams, either you want to send xmlport as a Parameter from NAV or to get in NAV.
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);
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?Best Regards
Zohaib Ahmed
Dynamics NAV ERP Technical Consultant.
please like / agree / verify my answer, if it was helpful for you. thanks.1 -
You should translate in XML String.Thanks
Blog - rockwithnav.wordpress.com/
Twitter - https://twitter.com/RockwithNav
Facebook - https://facebook.com/rockwithnav/0
Categories
- All Categories
- 75 General
- 75 Announcements
- 66.7K Microsoft Dynamics NAV
- 18.8K 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
- 610 NAV Courses, Exams & Certification
- 1.9K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 251 Dynamics CRM
- 103 Dynamics GP
- 6 Dynamics SL
- 1.5K Other
- 991 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 28 Design Patterns (General & Best Practices)
- Architectural Patterns
- 9 Design Patterns
- 4 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1K General Chat
- 1.6K Website
- 77 Testing
- 1.2K Download section
- 23 How Tos section
- 249 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions
