Translate C# .NET example parameters to a data structure for transmitting to a WebService using an RPGLE program

Have a vendor product CT FreightRater, an automated rating database used to calculate rates for loads we haul. We can enter hundreds of scenarios for rates like mileage, flat rate from point to point.
FreitRater recently did a changeover from running their WebService using XML, to using JSON. I have my JSON data conversion code ready, but need assistance setting up the front parameters that allow the HTTP URL, validation, etc.
In my RPGLE program, I use a product called RPG-XML Suite from Krengeltech. It supplies API's I can use to formulate my data into the JSON format, and that's working fine.
I can test through a program on the FreitRater Server called 'MultiRater'. This allows me to 'drop' in formed JSON statements to test against the rating database, and receive a response.
Unfortunately, FreitRater is unable to provide the specs for what these parameters are.
The only example I received from them to allow testing sending a RatingRequest example (C# .NET), is attached.

I'm also including the RXS_TransmitDS_t data structure used to 'send' to the FreitRater WebService in an attachment.

I need a 'translation' of sorts between the C# .NET example, to be able to  plug in those parameters to the RXS_TransmitDS_t data structure.


David MusgraveIT DirectorAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Gary PattersonVP Technology / Senior Consultant Commented:
I've never personally used RPG-XML Suite from Krengeltech, though I have worked with clients who have it, and seen a few programs that use it.  Maybe another expert has used the tool and can supply some example code.

My thought is that this might be a very good question to ask of Krengletech tech support.
David MusgraveIT DirectorAuthor Commented:
I'm actually meeting with them in about 10 minutes. I'm trying all avenues to get this going. That's why I reached out to EE. I'll see how this goes and might holler at you if Krengletech con't figure it out.
Gary PattersonVP Technology / Senior Consultant Commented:
OK.  Post back one way or the other - might be able to track down someone who can supply some sample code.
Active Protection takes the fight to cryptojacking

While there were several headline-grabbing ransomware attacks during in 2017, another big threat started appearing at the same time that didn’t get the same coverage – illicit cryptomining.

David MusgraveIT DirectorAuthor Commented:
OK, guys. I have some different results in detail from the SQL server in a log file. Krengeltech has an API to output the parameters along with the JSON code, over to the HTTPS:// WebService. I've spoken with the CSR at CT FreitRater and she told me (after I sent the log file), "The developer advised that the log is not generated by FreitRater so he is unsure."

I'm posting the log file here. PLEASE review it for me and see if any up front parameters before the actual JSON are missing or entered incorrectly. I think, since I'm not a WebService guru, IIS (I think that's what it's called) isn't able to validate something in my transmitted data.

For security purposes, some actual real content has been modified with 'x'.
Gary PattersonVP Technology / Senior Consultant Commented:
Error from remote server indicates that you passed a null value for a required parameter in your JSON.  If the error is correct, this is an application-specific problem:

  "Message": "An error has occurred.",
  "ExceptionMessage": "Value cannot be null.\r\nParameter name: value",
  "ExceptionType": "System.ArgumentNullException",
  "StackTrace": "   at Newtonsoft.Json.JsonConvert.DeserializeObject(String value, Type type, JsonSerializerSettings settings)\r\n   ...

Appears there is a Java program at the other end that is trying to "deserialize" the JSON (take it apart and put it into a structure usable by the Java program), and the deserialize call is failing because it has encountered an unexpected null in one of the values in the JSON.

You generally have to inspect the web service documentation or talk to the owner of the web service to determine which parameter is causing the failure.  Developer at web service owner supporting the service should be able to tell you what the problem with the JSON is - instead of sending the unfamiliar log file, maybe you should just send the problem JSON and the error message, and specifically ask for help identifying which NULL element is causing the problem.

By the way "not our log file" is a pretty pathetic excuse from the developer at the other end.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
David MusgraveIT DirectorAuthor Commented:
OK, thanks for at least helping point to the actual culprit, the JSON file. Yeah, I agree the 'not our log file' seemed a little lame.
David MusgraveIT DirectorAuthor Commented:
Oh btw, this is Phillip Knox. I sent the message breakdown to the developer to interpret. He won't be back in his office till tomorrow. I'll go ahead and accept your solution above, cause it's the first real answer someone's given me about this error log. I'm not sure the dev guy at FreitRater is very up to speed on helping with questions like this.
David MusgraveIT DirectorAuthor Commented:
And they have NO technical documentation related to this situation
David MusgraveIT DirectorAuthor Commented:
Thanks Gary
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.