Web Service C# Wrapper Produces Intermitant Results

tarkmylertarkmyler Member Posts: 57
edited 2014-05-29 in NAV Three Tier
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,
Mark Tyler
Pacific City, OR

Comments

  • tarkmylertarkmyler Member Posts: 57
    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, OR
  • mdPartnerNLmdPartnerNL Member Posts: 802
    This is in the Windows Client? If so, can't you debug the wrapper?
  • einsTeIn.NETeinsTeIn.NET Member Posts: 1,050
    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."
  • tarkmylertarkmyler Member Posts: 57
    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, OR
Sign In or Register to comment.