Hi, i made a node.js application which communicates with AX through AIF(http service hosted on iis). The application is clocking in and out workers, and also starts and stops jobs. I am using the buildt-in jmgshopfloorservice for this.
My problem is, when i try to send a 'clock-out' request to the server, i get in response 'Value was either too large or too small for an Int32', and this message isn't telling me much about the problem. Is it the request that is too large/small or is it the response?
This is the XMLbody i am sending:
<s:Envelope xmlns:s="schemas.xmlsoap.org/.../envelope"> <s:Header> <h:CallContext xmlns:h="schemas.microsoft.com/.../datacontracts" xmlns:i="www.w3.org/.../XMLSchema-instance"> <h:Company>INT</h:Company> <h:Language i:nil="true"/> <h:LogonAsUser i:nil="true"/> <h:MessageId i:nil="true"/> <h:PartitionKey i:nil="true"/> <h:PropertyBag i:nil="true" xmlns:a="schemas.microsoft.com/.../Arrays"/> </h:CallContext> </s:Header> <s:Body> <ShopFloorServiceClockOutRequest xmlns="schemas.microsoft.com/.../routing"> <_clockOutData xmlns:a="schemas.datacontract.org/.../Dynamics.Ax.Application" xmlns:i="www.w3.org/.../XMLSchema-instance"> <a:AbsenceCodeId i:nil="true"/> <a:ClientDateTime>0001-01-01T00:00:00</a:ClientDateTime> <a:Login>000005</a:Login> </_clockOutData> </ShopFloorServiceClockOutRequest> </s:Body> </s:Envelope>
The request-headers looks like this:
'Content-Type': 'text/xml; charset=utf-8', 'Authorization': 'Basic ' + new Buffer('domain\\user:pass').toString('base64'), 'SOAPAction': 'schemas.microsoft.com/.../clockOut'
In AIF history in AX i can see that jmgShopFloorService.clockout got called, and the AIF exception log shows nothing.
I do not know if this error comes from AX or IIS. I would appreciated some help on this.
EDIT: I did some more testing and found out that this error appears when i have started a job and then tries to clock out, so it is an AX error as of my understanding. Either way this error still does not make any sense.
*This post is locked for comments
I passed 1900-01-01T00:00:00 in JmgRegistrationData.ClientDateTime(<a:ClientDateTime>1900-01-01T00:00:00</a:ClientDateTime>), but sadly I got the same response: Value was either too large or too small for an Int32.
JmgRegistrationData has a field ClientDateTime that is a UtcDateTime. Inside AX, it will default to DateTimeUtil::minValue() which is 1900-01-01T00:00:00. Outside of AX, you need to pass in a valid UtcDateTime. Pass in 1900-01-01T00:00:00 if you want the equivalent of passing in a 'null' date. See msdn.microsoft.com/.../cc597805.aspx
I have not been able to work on this issue again until now. I get the same fault message when trying to report a job as "completed" or as "stopped". I can call the same methods from AX and it works perfectly:
JmgRegistrationData regData = new JmgRegistrationData();
List list = new List(Types::Class);
JmgShopFloorServiceClass jmg = new JmgShopFloorServiceClass();
JmgJobFeedbackData data = new JmgJobFeedbackData();
data.parmJobId("INT-000729");
data.parmGoodQuantity(1);
data.parmStatus(JmgFeedbackStatus::Stopped);
regData.parmLogin("807");
list.addEnd(data);
jmg.reportFeedback(regData,list);
I have tested it in nodejs, C# and SOAPUI and I get the same response: "Value was either too large or too small for an Int32".
In the XML ClientDateTime is a JmgDateTime which is of type UtcDateTime. I'm guessing the error is because "0001-01-01T00:00:00" is not a valid UtcDateTime, the minimum utcdatetime is "1900-01-01T00:00:00"
Did you find a fix for this error message?
I cannot find any response in the history-log, but I know it is sending a response, because i can print it out in my node.js application. This is the response body:
<s:Envelope xmlns:s="schemas.xmlsoap.org/.../">
<s:Body>
<s:Fault>
<faultcode>s:Client</faultcode>
<faultstring xml:lang="nb-NO">Value was either too large or too small for an Int32.</faultstring>
</s:Fault>
</s:Body>
</s:Envelope>
It's useful, because it will also tell what response you was sent (or that none was sent at all). I still don't have this information from you, so I assumed you don't know it.
It also allows you to check if all the data was received and sent as expected. It's boring if everything goes as planned, but it's extremely important if not.
I also told you what you can do if you find that thing failed somewhere in AX - you can debug the code.
Yea, there is not really anything useful info here, it basically says that it called jmgShopFloorService.clockOut.
And the XML looks like this:
<?xml version="1.0" encoding="UTF-8" ?>
<ShopFloorServiceClockOutRequest xmlns="schemas.microsoft.com/.../routing">
<_clockOutData xmlns:a="schemas.datacontract.org/.../Dynamics.Ax.Application" xmlns:i="www.w3.org/.../XMLSchema-instance">
<a:AbsenceCodeId>Flexinn</a:AbsenceCodeId>
<a:ClientDateTime>0001-01-01T00:00:00</a:ClientDateTime>
<a:Login>000005</a:Login>
</_clockOutData>
</ShopFloorServiceClockOutRequest>
"History" is if what contains logged messages, including actual XML representations.
Hmm, the only logs i can find is 'History-log' and 'Exception-log' under System Administration > Periodic > Services and Application Integration Framework. Can't find any message log.
Stay up to date on forum activity by subscribing. You can also customize your in-app and email Notification settings across all subscriptions.
André Arnaud de Cal... 290,900 Super User 2024 Season 2
Martin Dráb 229,297 Most Valuable Professional
nmaenpaa 101,156