[solved]How can I run command of an external webservice
massimopasquali
Member Posts: 82
Hello,
I'm developing NAV2013.
I need to import data from an extenal management program, to do that I have to run "C" or "Java" command from C/AL sentences program. How can I do that?
Now I'm using to developing Visual studio, by "webreference" I can to export from NAV to online, but now I have to do the opposite thing, from an external Webservice I have to import data in NAV to running in C/AL sentence the commands of this webservice management program not NAV
thanks.
I'm developing NAV2013.
I need to import data from an extenal management program, to do that I have to run "C" or "Java" command from C/AL sentences program. How can I do that?
Now I'm using to developing Visual studio, by "webreference" I can to export from NAV to online, but now I have to do the opposite thing, from an external Webservice I have to import data in NAV to running in C/AL sentence the commands of this webservice management program not NAV
thanks.
0
Answers
-
There is more ways. You can create dotnet wrapper and use it through DotNet interop, or use XMLDom to create and send the SOAP request and process the response, or you can use something what Vjeko already published, framework which using DotNet functionality can call the webservices from outside (through reflection and other magic...)0
-
1. Create a C# wrapper for the web service that you can reference inside of C/Side. C# > New Project > Class Library
2. You can delete the default class.
3. Add the Web Service: Service References > Add Service Reference > Advanced > Add Web Reference > [enter url and name the reference ] > build project > insert into Add-Ins folder.
4. In C/Side report/codeunit add .NET variable references - see sample below:
Name DataType Subtype
XYZ_OrderService DotNet XYZWebService.OrderService.blah blah
XYZ_Security DotNet XYZWebService.OrderService.Security.blah blah
//>>Instantiate Web Service
XYZ_OrderService := XYZ_OrderService.OrderServiceService(); //Declare Constructor
//>>Security
XYZ_Security := XYZ_Security.Security(); //Declare Constructor
XYZ_Security.Password := XYZ_Setup."Service Password";
XYZ_Security.Username := XYZ_Setup."Service UserName";
etc. ad infinitumMark Tyler
Pacific City, OR0 -
thanks0
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.6K Microsoft Dynamics NAV
- 18.7K 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
- 617 NAV Courses, Exams & Certification
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 322 Dynamics CRM
- 111 Dynamics GP
- 10 Dynamics SL
- 1.5K Other
- 990 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 35 Design Patterns (General & Best Practices)
- 1 Architectural Patterns
- 10 Design Patterns
- 5 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1.1K General Chat
- 1.6K Website
- 83 Testing
- 1.2K Download section
- 23 How Tos section
- 252 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions

