Web Service C# Wrapper Produces Intermitant Results
tarkmyler
Member Posts: 57
Using NAV 2013r2 we have a codeunit that calls a dll we authored in C# that simply references a web service. I believe the term is C# "wrapper". It works like a champ on our development server and produces the expected results. We are testing on an Amazon EC2 instance. I installed the dll in the Add-ins directory(s) on that server. When the codeunit is called, it comes back with nothing and no error.
When operating normally, it comes back with an array of orders that has a property called "Length" or "RecordCount". Both of those have a value of zero. The response isSuccessful property is True, and the Errors array is null. I've written a C# form based gadget that duplicates the NAV code and it works without issue on the same Amazon instance.
I have no clue where to go from here with regard to the EC2 instance, and have started working on a VM server. Anybody have any ideas?
Thanks,
When operating normally, it comes back with an array of orders that has a property called "Length" or "RecordCount". Both of those have a value of zero. The response isSuccessful property is True, and the Errors array is null. I've written a C# form based gadget that duplicates the NAV code and it works without issue on the same Amazon instance.
I have no clue where to go from here with regard to the EC2 instance, and have started working on a VM server. Anybody have any ideas?
Thanks,
Mark Tyler
Pacific City, OR
Pacific City, OR
0
Comments
-
Ok. More information. I downloaded fidder2 - check it out if you don't know what it is... and ran it on the Amazon instance. When I ran my little C# gadget the traffic to the web service showed up. When I launched the C# wrapper from the codeunit, there was no activity. NAV just seems to ignore the dll and is happy to compile and call it without producing any errors. Lovely. Different timezone (UTC) on that server. I installed VS2k12, copied the project, compiled it, installed it. Same result. Can't figure out... next up is changing the fromdatetime in the request to UTC before shipping it up to the web service. Stay tuned.Mark Tyler
Pacific City, OR0 -
This is in the Windows Client? If so, can't you debug the wrapper?0
-
How do you call the codeunit?
Just a few remarks:
a) External components could be executed either on the client machine or on the server machine.
b) The user who's executing the component might need permissions to instantiate his user profile even though the component doesn't provide any GUI."Money is likewise the greatest chance and the greatest scourge of mankind."0 -
This was resolved with SOAPUI. I captured the request and issued it using SOAPUI so I could see the actual response from the website. It turned out that the request was sending non-null values for some of the dates and the resulting query wasn't bringing back any valid results.
Backgroud: C/Side in NAV throws an error when trying to set values for fields in the Web Service Request that can be null. I had edited the source for ALL of the dates mentioned in the request, (C# wrapper), and removed the web service references that allowed them to be null in the C# wrapper. However, I only needed to change the fields I was setting/using. Lift foot, fire gun. ](*,) - Now the webservice call from inside NAV works like a champ every time. \:D/
See below the Date(s) Completed versus Date(s) Shipped in the C# request:
private System.DateTime dateCompletedFromField;
private System.DateTime dateCompletedToField;
private System.Nullable<System.DateTime> dateShippedFromField;
private System.Nullable<System.DateTime> dateShippedToField;Mark Tyler
Pacific City, OR0
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