web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics AX (Archived)

Value was either too large or too small for an Int32, AIF.

(0) ShareShare
ReportReport
Posted on by

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 have the same question (0)
  • Martin Dráb Profile Picture
    237,967 Most Valuable Professional on at

    What kind of service are you calling? It looks like a document service, but they doesn't exist in AX 7 anymore. Or didn't you tag your question with a wrong version of AX?

    Which of those fields use int data type.

  • Community Member Profile Picture
    on at

    Hi Martin.

    Ops, yea, that may be the wrong version, i use AX 2012 R3.

  • Community Member Profile Picture
    on at

    I dont know really. The 'Login' field might use Int data type. But it is only 6 chars long.

  • Martin Dráb Profile Picture
    237,967 Most Valuable Professional on at

    I'll continue assuming that you're calling a document service. The first I would do is enabling message logging (see Configure troubleshooting options for integration ports) and review what messages are received and sent. The next step depends on findings from the log - if you see that something fails in AX but you don't know what, you can use the debugger.

  • Community Member Profile Picture
    on at

    Yes, I'm sorry , it is document service. I have logging enabled(All document versions and include exceptions in fault). In the history log it says that jmgShopFloorService.clockOut was called, as it should. And the exception log does not contain any errors regarding this.

  • Martin Dráb Profile Picture
    237,967 Most Valuable Professional on at

    Message log contains message send to and from AX. I think you're looking at the exception log, not the message log.

  • Community Member Profile Picture
    on at

    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.

  • Martin Dráb Profile Picture
    237,967 Most Valuable Professional on at

    "History" is if what contains logged messages, including actual XML representations.

  • Community Member Profile Picture
    on at

    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&quot;>

       <_clockOutData xmlns:a="schemas.datacontract.org/.../Dynamics.Ax.Application&quot; xmlns:i="www.w3.org/.../XMLSchema-instance&quot;>

          <a:AbsenceCodeId>Flexinn</a:AbsenceCodeId>

          <a:ClientDateTime>0001-01-01T00:00:00</a:ClientDateTime>

          <a:Login>000005</a:Login>

        </_clockOutData>

    </ShopFloorServiceClockOutRequest>

  • Martin Dráb Profile Picture
    237,967 Most Valuable Professional on at

    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.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

#1
Martin Dráb Profile Picture

Martin Dráb 4 Most Valuable Professional

#1
Priya_K Profile Picture

Priya_K 4

#3
MyDynamicsNAV Profile Picture

MyDynamicsNAV 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans