AIF document services invalid schema

Hi all,

when I already available AIF documents services in ax2012 its working fyn,

but my requirement is, want to import data with custom table, am able to do all the things as per material,

but during the process am getting error msg as invalid schmea file, so later I understood I should create schema for XMl,i generated xml schema also, but now the pblm is how to merger the schema with my XML file.

can anyone guide me pls???

once again thank you in advance :slight_smile:

Are you saying that you want to import an XML file that has a different format than expected by AX? If it’s the case, you’ll have to transform your file to the right format (see About the AIF Pipeline and Transforms [AX 2012]).

hi martin,

thank you.

I have converted my csv file into xml.

<?xml version="1.0" encoding="utf-8" ?>

-

1

Fourth Coffee

20

USD

2

Graphic Design Institute

20

USD

-

3

Lucerne Publishing

20

EUR

here still those schema files are missing, from where I need to take those schema files???

thank you

Open AifService form, find the service you need, press Service operations, choose the operation and press Parameter schema. You’ll get the XML schema defining expected format.

If you created an enhanced inbound port and changed Data policies, display the schema from Document data policies form.

hi martin thank you,

I have chosen one services and I exported schema for tat,

<?xml version="1.0" encoding="utf-16" ?>

- <xs:schema xmlns:tns=β€œhttp://schemas.microsoft.com/dynamics/2008/01/documents/AIF_employee” xmlns:st=β€œhttp://schemas.microsoft.com/dynamics/2008/01/sharedtypes” elementFormDefault=β€œqualified” targetNamespace=β€œhttp://schemas.microsoft.com/dynamics/2008/01/documents/AIF_employee” xmlns:xs=β€œhttp://www.w3.org/2001/XMLSchema”>
<xs:import schemaLocation=β€œSharedTypes.xsd” namespace=β€œhttp://schemas.microsoft.com/dynamics/2008/01/sharedtypes” />

<xs:element name=β€œAIF_employee” type=β€œtns:AxdAIF_employee” />
- <xs:complexType name=β€œAxdAIF_employee”>

- xs:sequence

<xs:element minOccurs=β€œ0” name=β€œClearNilFieldsOnUpdate” nillable=β€œtrue” type=β€œst:AxdEnum_boolean” />

<xs:element minOccurs=β€œ0” name=β€œDocPurpose” nillable=β€œtrue” type=β€œst:AxdEnum_XMLDocPurpose” />

<xs:element minOccurs=β€œ0” name=β€œSenderId” nillable=β€œtrue” type=β€œst:AxdExtType_DataAreaId” />

<xs:element minOccurs=β€œ0” maxOccurs=β€œunbounded” name=β€œemployee_1” type=β€œtns:AxdEntity_employee_1” />

</xs:sequence>

</xs:complexType>

- <xs:complexType name=β€œAxdEntity_employee_1”>

- xs:sequence

<xs:element minOccurs=β€œ0” name="_DocumentHash" nillable=β€œtrue” type=β€œxs:string” />

<xs:element minOccurs=β€œ0” name=β€œDob” nillable=β€œtrue” type=β€œxs:date” />

<xs:element minOccurs=β€œ0” name=β€œEmpname” nillable=β€œtrue” type=β€œst:AxdUnion_AxdType_Str_AxdType_ExtCodeValue” />

<xs:element minOccurs=β€œ0” name=β€œEmpno” nillable=β€œtrue” type=β€œst:AxdUnion_AxdType_Str_AxdType_ExtCodeValue” />

</xs:sequence>

<xs:attribute fixed=β€œentity” name=β€œclass” use=β€œrequired” />

<xs:attribute name=β€œaction” type=β€œst:AxdEnum_AxdEntityAction” />

</xs:complexType>

</xs:schema>

in these how to separate my schema alone or I have to modify this file with my input.

thank you ur helps :slight_smile:

hi

anyone give me some suggestion pls

You have to transform your file to the format defined by AX (you can use the schema for validation and for generating a sample XML file). See my first reply for details about transformation.

The schema file shd be,

namespace/ " External service name"

u can find your namespace and external name by right click ur services.

Namespace : http://schemas.microsoft.com/dynamics/2008/01/services

External name: Stuname

http://schemas.microsoft.com/dynamics/2008/01/services/Stuname