Microsoft dynamics AX : Simple AIF issues with SOAPUI

Recently I have faced some issues on sending XML from SOAPUI  to AIF inbound port for ‘Create’ operation.

Initially i have used my custom document service, however later on to simplify  and to detect the issue I tried the out – of the box AIF document service of HcmService  and the result was same. Then Finally i created a new table with 2 string fields and created a new document query to even more simply the issue and to be able to debug that.

So below were the issues i have faced during sending the XML via SOAP UI. Note that the service was working fine on VS c# project when i consume the service.

Issue # 1:  Root element is missing

After debugging i have found out that, AX was expecting ‘Fields’ tag from the SOAP XML which were not actually send within the XML.

Resolution: 

Instead of Customizing documents from data policies, I have unmarked the ‘Customize document’ check box and leave it as by default and finally that did trick for me and the issue was gone.

 

Issue # 2: Invalid document schema. The following error was returned: Value cannot be null.
Parameter name: documentXml

<faultcode>s:SchemaValidationFailed</faultcode>
<faultstring xml:lang=”en-US”>Invalid document schema. The following error was returned: Value cannot be null.
Parameter name: documentXml</faultstring>
<detail xmlns:s=”http://www.w3.org/2003/05/soap-envelope”&gt;
<AifFault xmlns=”http://schemas.microsoft.com/dynamics/2008/01/documents/Fault&#8221; xmlns:i=”http://www.w3.org/2001/XMLSchema-instance”&gt;
<CustomDetailXml i:nil=”true”/>
<FaultMessageListArray i:nil=”true”/>
<InfologMessageList xmlns:b=”http://schemas.datacontract.org/2004/07/Microsoft.Dynamics.AX.Framework.Services”&gt;
<b:InfologMessage>
<b:InfologMessageType>Error</b:InfologMessageType>
<b:Message>AifRequestProcessor-processWcfRequest Invalid document schema. The following error was returned: Value cannot be null.
Parameter name: documentXml</b:Message>

Resolution: I have found that, SOAP xml goes under some xml validation and it throughs above error from Ax*classes. So i explicitly un marked the ‘Validate document xml’ on the port configuration.

 

Issue # 3: Value cannot be null.Parameter name: key

<faultcode xmlns:a=”http://schemas.microsoft.com/net/2005/12/windowscommunicationfoundation/dispatcher”>a:InternalServiceFault</faultcode&gt;
<faultstring xml:lang=”en-US”>Value cannot be null.
Parameter name: key</faultstring>
<detail xmlns:s=”http://www.w3.org/2003/05/soap-envelope”&gt;
<ExceptionDetail xmlns=”http://schemas.datacontract.org/2004/07/System.ServiceModel&#8221; xmlns:i=”http://www.w3.org/2001/XMLSchema-instance”&gt;
<HelpLink i:nil=”true”/>
<InnerException i:nil=”true”/>
<Message>Value cannot be null.
Parameter name: key</Message>

 

Resolution: During inputting the parameters , in order to send the request as xml. I was leaving below fields blank.

So instead of leaving these field blank, Actually it requires the table index name and index field used as a replacment key or primary key. So in my case i create a new index with the name ‘Idx’ and added one field ‘stringA’ and created that index as a primary key. And then set the values as below

And finally i was able to create a new record with-in my custom table  from SOAP UI.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s