AXForum  
Go Back   AXForum > Microsoft Dynamics AX > DAX: Программирование
All
Forgotten Your Password?
Register Forum Rules FAQ Members List Today's Posts Search

 
 
Thread Tools Search this Thread Display Modes
Old 17.08.2015, 15:25   #1  
syl is offline
syl
Участник
syl's Avatar
 
236 / 21 (1) +++
Join Date: 10.06.2015
Location: Киев
ошибка в AIF
Доброго времени суток!

UPD: По сути моя проблема описана в этом посте http://www.itanswerz.com/1334843/the...-ax-2012-fails

Настраиваю коннектор между CRM и AX, в АХ создан AIF Document Service (само собой открыт соответствующий порт), но при попытке записать через него данные (простой пример записи кастомера) получается такой error: Invalid xml document. (Недопустимый XML-документ.).

Кто подскажет в чем может быть проблема?

Last edited by syl; 17.08.2015 at 16:04.
Old 17.08.2015, 16:42   #2  
gl00mie is offline
gl00mie
Участник
MCBMSS
Most Valuable Professional
Лучший по профессии 2017
Лучший по профессии 2015
Лучший по профессии 2014
Лучший по профессии AXAWARD 2013
Лучший по профессии 2011
Лучший по профессии 2009
 
3,684 / 5813 (201) ++++++++++
Join Date: 28.11.2005
Location: Москва
Blog Entries: 3
Quote:
Originally Posted by syl View Post
в АХ создан AIF Document Service, но при попытке записать через него данные получается такой error: Invalid xml document
при такой общей ошибке проблема может быть в чем угодно смотрите, что не так с xml, для этого включите диагностику на входящем порту AIF и затем смотрите в исключениях. В меню это:
  • Администрирование системы/Настройка/Services and Application Integration Framework/Входящие порты, деактивировать порт, в Устранении неполадок выбрать режим ведения журнала Исходный документ, активировать порт
  • Администрирование системы/Периодические операции/Services and Application Integration Framework/Исключения - тут смотрите код сообщения (GUID)
  • Администрирование системы/Периодические операции/Services and Application Integration Framework/История - фильтруетесь по коду сообщения, жмете Журналы документа/Просмотр XML-документа, смотрите, что не так с XML.
Собственно, на форме Исключения отображается более-менее детализированная ошибка с XPath до проблемного узла XML, если такая информация доступна.
Old 17.08.2015, 17:28   #3  
syl is offline
syl
Участник
syl's Avatar
 
236 / 21 (1) +++
Join Date: 10.06.2015
Location: Киев
Это все делаю, там пишется только "Недопустимый XML-документ". Уже определил что ошибка из за поля AgreementClassification в SalesAgreementHeader (по ссылке расписано более детально). Судя по маппингу туда надо писать Name из AgreementClasification, что я в принципе и делаю, но получаю ошибку. Если же опустить заполнение SalesAgreementHeader, то запись проходит нормально

UPD: XML из журнала
X++:
  <?xml version="1.0" encoding="UTF-8" ?> 
- <CustImportServiceCreateRequest xmlns="http://tempuri.org">
- <CustImport xmlns="http://schemas.microsoft.com/dynamics/2008/01/documents/CustImport">
  <SenderId xsi:nil="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" /> 
- <CustTableT class="entity">
  <_DocumentHash xsi:nil="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" /> 
  <AccountNum>20957066</AccountNum> 
  <AgencyLocationCode xsi:nil="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" /> 
  <AuthorityOffice_IT xsi:nil="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" /> 
  <BankAccount xsi:nil="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" /> 
  <BankCentralBankPurposeCode xsi:nil="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" /> 
  <BankCentralBankPurposeText xsi:nil="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" /> 
  <BankCustPaymIdTable xsi:nil="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" /> 
  <BirthCountyCode_IT xsi:nil="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" /> 
  <BirthPlace_IT xsi:nil="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" /> 
  <Blocked>No</Blocked> 
  <CashDisc xsi:nil="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" /> 
  <CCMNum_BR xsi:nil="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" /> 
  <ClearingPeriod xsi:nil="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" /> 
  <CNAE_BR xsi:nil="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" /> 
  <CNPJCPFNum_BR xsi:nil="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" /> 
  <CommercialRegister xsi:nil="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" /> 
  <CommercialRegisterInsetNumber xsi:nil="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" /> 
  <CommercialRegisterSection xsi:nil="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" /> 
  <CommissionGroup xsi:nil="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" /> 
  <CompanyChainId xsi:nil="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" /> 
  <CompanyIdSiret xsi:nil="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" /> 
  <CompanyNAFCode xsi:nil="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" /> 
  <ContactPersonId xsi:nil="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" /> 
  <CreditRating xsi:nil="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" /> 
  <Curp_MX xsi:nil="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" /> 
  <Currency>USD</Currency> 
  <CustClassificationId xsi:nil="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" /> 
  <CustGroup>B2C</CustGroup> 
  <CustItemGroupId xsi:nil="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" /> 
  <CustTradingPartnerCode xsi:nil="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" /> 
  <DAXIntegrationId xsi:nil="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" /> 
- <DefaultDimension>
- <Values xmlns="http://schemas.microsoft.com/dynamics/2008/01/sharedtypes">
- <Value>
  <Name>BusinessUnit</Name> 
  <Value>B2C</Value> 
  </Value>
  </Values>
  </DefaultDimension>
  <DefaultDirectDebitMandate xsi:nil="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" /> 
  <DefaultInventStatusId xsi:nil="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" /> 
  <DestinationCodeId xsi:nil="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" /> 
  <DlvMode xsi:nil="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" /> 
  <DlvReason xsi:nil="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" /> 
  <DlvTerm xsi:nil="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" /> 
  <EinvoiceEANNum xsi:nil="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" /> 
  <EndDisc xsi:nil="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" /> 
  <EnterpriseCode xsi:nil="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" /> 
  <EnterpriseNumber xsi:nil="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" /> 
  <FactoringAccount xsi:nil="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" /> 
  <FederalComments xsi:nil="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" /> 
  <FineCode_BR xsi:nil="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" /> 
  <FiscalCode xsi:nil="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" /> 
  <ForeignerId_BR xsi:nil="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" /> 
  <FreightZone xsi:nil="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" /> 
  <IdentificationNumber xsi:nil="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" /> 
  <IENum_BR xsi:nil="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" /> 
  <INSSCEI_BR xsi:nil="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" /> 
  <IntBank_LV xsi:nil="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" /> 
  <InterestCode_BR xsi:nil="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" /> 
  <InventLocation xsi:nil="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" /> 
  <InventProfileId_RU xsi:nil="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" /> 
  <InventSiteId xsi:nil="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" /> 
  <InvoiceAccount xsi:nil="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" /> 
  <IssuerCountry_HU xsi:nil="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" /> 
  <LineDisc xsi:nil="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" /> 
  <LineOfBusinessId xsi:nil="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" /> 
  <LvPaymTransCodes xsi:nil="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" /> 
  <MainContactPersonnelNumber xsi:nil="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" /> 
  <MainContactWorker xsi:nil="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" /> 
  <MarkupGroup xsi:nil="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" /> 
  <MCRMergedParent xsi:nil="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" /> 
  <MCRMergedRoot xsi:nil="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" /> 
  <Memo xsi:nil="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" /> 
  <MultiLineDisc xsi:nil="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" /> 
  <Name xsi:nil="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" /> 
  <NIT_BR xsi:nil="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" /> 
  <numberSequenceGroup xsi:nil="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" /> 
  <OrderEntryDeadlineGroupId xsi:nil="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" /> 
  <OrgId xsi:nil="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" /> 
  <OurAccountNum xsi:nil="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" /> 
  <PackMaterialFeeLicenseNum xsi:nil="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" /> 
  <Party xsi:nil="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" /> 
  <PartyCountry xsi:nil="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" /> 
  <PartyState xsi:nil="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" /> 
  <PassportNo_HU xsi:nil="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" /> 
  <PaymDayId xsi:nil="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" /> 
  <PaymentReference_EE xsi:nil="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" /> 
  <PaymMode xsi:nil="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" /> 
  <PaymSched xsi:nil="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" /> 
  <PaymSpec xsi:nil="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" /> 
  <PaymTermId xsi:nil="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" /> 
  <PBACustGroupId xsi:nil="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" /> 
  <PdsCustRebateGroupId xsi:nil="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" /> 
  <PdsRebateTMAGroup xsi:nil="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" /> 
  <PriceGroup xsi:nil="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" /> 
  <RegNum_W xsi:nil="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" /> 
  <ResidenceForeignCountryRegionId_IT xsi:nil="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" /> 
  <Rfc_MX xsi:nil="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" /> 
  <SalesCalendarId xsi:nil="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" /> 
  <SalesDistrictId xsi:nil="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" /> 
  <SalesGroup xsi:nil="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" /> 
  <SalesPoolId xsi:nil="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" /> 
  <SegmentId xsi:nil="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" /> 
  <ShipCarrierAccount xsi:nil="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" /> 
  <ShipCarrierAccountCode xsi:nil="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" /> 
  <ShipCarrierId xsi:nil="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" /> 
  <StateInscription_MX xsi:nil="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" /> 
  <StatisticsGroup xsi:nil="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" /> 
  <SubsegmentId xsi:nil="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" /> 
  <SuframaNumber_BR xsi:nil="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" /> 
  <SuppItemGroupId xsi:nil="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" /> 
  <SyncEntityId xsi:nil="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" /> 
  <TaxBorderNumber_FI xsi:nil="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" /> 
  <TaxGroup xsi:nil="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" /> 
  <TaxGSTReliefGroupHeading_MY xsi:nil="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" /> 
  <TaxLicenseNum xsi:nil="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" /> 
  <TaxPeriodPaymentCode_PL xsi:nil="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" /> 
  <TaxWithholdGroup_TH xsi:nil="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" /> 
  <VATNum xsi:nil="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" /> 
  <VendAccount xsi:nil="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" /> 
- <DirPartyTableT class="entity">
  <KnownAs xsi:nil="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" /> 
  <LanguageId>RU</LanguageId> 
  <Name> </Name> 
  <NameAlias></NameAlias> 
  <PartyNumber xsi:nil="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" /> 
  <PrimaryAddressLocation xsi:nil="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" /> 
  </DirPartyTableT>
- <SalesAgreementHeaderT class="entity">
- <AgreementClassification>
  <Name xmlns="http://schemas.microsoft.com/dynamics/2008/01/sharedtypes">B2B</Name> 
  </AgreementClassification>
  <AgreementState>Effective</AgreementState> 
  <Currency>USD</Currency> 
  <DefaultAgreementLineEffectiveDate>2015-08-17</DefaultAgreementLineEffectiveDate> 
  <DefaultDimension xsi:nil="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" /> 
  <DocumentExternalReference xsi:nil="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" /> 
  <DocumentTitle xsi:nil="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" /> 
  <Language>RU</Language> 
  <Originator xsi:nil="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" /> 
  <CustAccount>20957066</CustAccount> 
  <CustomerDataAreaId xsi:nil="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" /> 
  <SalesNumberSequence>20957066</SalesNumberSequence> 
  <SellingLegalEntity xsi:nil="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" /> 
- <SalesAgreementHeaderExt_RUT class="entity">
  <AgreementDate>2015-08-17</AgreementDate> 
  <AgreementId xsi:nil="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" /> 
  <AgreementSubject xsi:nil="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" /> 
  <CellularPhone xsi:nil="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" /> 
  <DefaultDimension xsi:nil="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" /> 
  <Email xsi:nil="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" /> 
  <InventProfileId xsi:nil="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" /> 
  <LineOfBusinessId xsi:nil="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" /> 
  <PaymDayId xsi:nil="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" /> 
  <Phone xsi:nil="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" /> 
  <PhoneLocal xsi:nil="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" /> 
  <TeleFax xsi:nil="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" /> 
  <Telex xsi:nil="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" /> 
  <Url xsi:nil="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" /> 
  <CustPostingProfile xsi:nil="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" /> 
  <CustPrepaymentPostingProfile xsi:nil="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" /> 
  </SalesAgreementHeaderExt_RUT>
  </SalesAgreementHeaderT>
  </CustTableT>
  </CustImport>
  </CustImportServiceCreateRequest>
Не вижу в нем никаких проблем

Last edited by syl; 17.08.2015 at 17:56.
Old 18.08.2015, 10:27   #4  
syl is offline
syl
Участник
syl's Avatar
 
236 / 21 (1) +++
Join Date: 10.06.2015
Location: Киев
В общем насколько я понял, из той немногой информации которая есть в интернете, проблема заключается в том что таблица SalesAgreementHeader расширяет AgreementHeader, и AIF не умеет правильно обрабатывать такие таблицы. Кто может подсказать хоть какие то варианты решения?
Old 18.08.2015, 11:39   #5  
gl00mie is offline
gl00mie
Участник
MCBMSS
Most Valuable Professional
Лучший по профессии 2017
Лучший по профессии 2015
Лучший по профессии 2014
Лучший по профессии AXAWARD 2013
Лучший по профессии 2011
Лучший по профессии 2009
 
3,684 / 5813 (201) ++++++++++
Join Date: 28.11.2005
Location: Москва
Blog Entries: 3
Посмотрите, в каком контексте возникает указанная ошибка. Если поискать метки для текста ошибки, то найдем @SYS335397 и @SYS320343. Судя по перекрестным ссылкам, нам нужна именно вторая, она используется в следующих интересных местах:
  • \Classes\AfDataContainerSerializer\moveToNextElement
  • \Classes\AfDataContainerSerializer\skipEndElement
  • \Classes\AxdBaseCreate\checkCurrentElement
  • \Classes\AxdBaseCreate\moveToNextElement
  • \Classes\AxdBaseCreate\moveToNextXmlElement
  • \Classes\AxdBaseCreate\readDimensionAttributeValues
  • \Classes\AxdBaseCreate\skipEndElement
В свою очередь, скажем, \Classes\AxdBaseCreate\checkCurrentElement вызывается из \Classes\AxdBaseCreate\readSurrogateForeignKeyValue, что уже наводит на размышления. Посмотрим, как вы передаете ссылку на классификацию договоров:
PHP Code:
<SalesAgreementHeaderT class="entity">
  <
AgreementClassification>
  <
Name xmlns="http://schemas.microsoft.com/dynamics/2008/01/sharedtypes">B2B</Name
  </
AgreementClassification
А теперь взгляните на ключ замены на таблице AgreementClassification: в него кроме поля Name еще входит поле AgreementRelationType

В поле AgreementRelationType в вашем случае должно быть значение tableNum(SalesAgreementHeader), т.е. 4903. Таким образом, есть версия, что вы передаете не все поля ключа замены для таблицы AgreementClassification.
Old 18.08.2015, 11:44   #6  
syl is offline
syl
Участник
syl's Avatar
 
236 / 21 (1) +++
Join Date: 10.06.2015
Location: Киев
Quote:
Таким образом, есть версия, что вы передаете не все поля ключа замены для таблицы AgreementClassification.
Тоесть мне надо еще передавать tableNum для таблици AgreementClassification? Но данное поле не отображается в списке, я выжу единственное поле Name...

Код класса AgreementClassificationKey
X++:
#AifTableNaturalKeyDataContainerTypes
[AifDataContainerTypeAttribute(#TableNaturalKey_AgreementClassification)]
class AgreementClassificationKey extends AfStronglyTypedDataContainer
{
    #define.Name('Name')
    #define.AgreementRelationType('AgreementRelationType')

}

public boolean existsAgreementRelationType()
{
    return this.exists(#AgreementRelationType);
}

public boolean existsName()
{
    return this.exists(#Name);
}

public RelationType parmAgreementRelationType(RelationType _value = 0)
{
    if (!prmisdefault(_value))
    {
        this.set_Attribute(#AgreementRelationType, _value);
    }

    return this.get_Attribute(#AgreementRelationType);
}

public Name parmName(Name _value = '')
{
    if (!prmisdefault(_value))
    {
        this.set_Attribute(#Name, _value);
    }

    return this.get_Attribute(#Name);
}
правильно ли будет в данном случае изменить класс таким образом:
X++:
public RelationType parmAgreementRelationType(RelationType _value = tableNum(SalesAgreementHeader))
{
    if (!prmisdefault(_value))
    {
        this.set_Attribute(#AgreementRelationType, _value);
    }

    return this.get_Attribute(#AgreementRelationType);
}

Last edited by syl; 18.08.2015 at 12:00.
Old 18.08.2015, 12:46   #7  
gl00mie is offline
gl00mie
Участник
MCBMSS
Most Valuable Professional
Лучший по профессии 2017
Лучший по профессии 2015
Лучший по профессии 2014
Лучший по профессии AXAWARD 2013
Лучший по профессии 2011
Лучший по профессии 2009
 
3,684 / 5813 (201) ++++++++++
Join Date: 28.11.2005
Location: Москва
Blog Entries: 3
Зачем вот чего-то править в AgreementClassificationKey?.. Ошибка возникает, скорее всего, на разборе ключа замены: AIF видит в соотв. индексе два поля, а в XML значение только для одного из них. Какие при этом значения по умолчанию будут у параметрических методов AgreementClassificationKey, никак не влияет на то, что в XML-документе отсутствует ожидаемое значение. Поле AgreementClassification.AgreementRelationType помечено как невидимое, поэтому тот же обозреватель таблиц его не показывает, но в базе оно есть и входит в ключ замены для таблицы, поэтому AIF ожидает его значение на ряду с Name, иначе он не сможет однозначно идентифицировать запись в AgreementClassification. Попробуйте передавать привязку к классификации договоров так:
PHP Code:
<SalesAgreementHeaderT class="entity"
<
AgreementClassification
<
Name xmlns="http://schemas.microsoft.com/dynamics/2008/01/sharedtypes">B2B</Name>  
<
AgreementRelationType xmlns="http://schemas.microsoft.com/dynamics/2008/01/sharedtypes">4903</AgreementRelationType>  
</
AgreementClassification
Old 18.08.2015, 12:53   #8  
syl is offline
syl
Участник
syl's Avatar
 
236 / 21 (1) +++
Join Date: 10.06.2015
Location: Киев
дело в том, что я не могу править xml, единственное решение сделать поле видимым в запросе, что бы конектор его увидел, тогда его можно будет заполнять...
Old 18.08.2015, 12:58   #9  
gl00mie is offline
gl00mie
Участник
MCBMSS
Most Valuable Professional
Лучший по профессии 2017
Лучший по профессии 2015
Лучший по профессии 2014
Лучший по профессии AXAWARD 2013
Лучший по профессии 2011
Лучший по профессии 2009
 
3,684 / 5813 (201) ++++++++++
Join Date: 28.11.2005
Location: Москва
Blog Entries: 3
Еще обычно можно какую-нить XSLT-шечку применять, куда как раз можно дописать добавление недостающего узла. Хотя сделать поле видимым - тоже вариант.
This post has been rated by: syl (1).
Old 18.08.2015, 17:46   #10  
syl is offline
syl
Участник
syl's Avatar
 
236 / 21 (1) +++
Join Date: 10.06.2015
Location: Киев
В общем проблема не решена, сделал AgreementRelationType видимым, переконфигурировал сервис AIF, коннектор данное поле не видит...
Old 18.08.2015, 18:11   #11  
gl00mie is offline
gl00mie
Участник
MCBMSS
Most Valuable Professional
Лучший по профессии 2017
Лучший по профессии 2015
Лучший по профессии 2014
Лучший по профессии AXAWARD 2013
Лучший по профессии 2011
Лучший по профессии 2009
 
3,684 / 5813 (201) ++++++++++
Join Date: 28.11.2005
Location: Москва
Blog Entries: 3
Quote:
Originally Posted by syl View Post
сделал AgreementRelationType видимым, переконфигурировал сервис AIF
Расшифруйте plz, что вошло во второе действие.
Old 19.08.2015, 10:39   #12  
Dreadlock is offline
Dreadlock
Участник
Dreadlock's Avatar
 
298 / 224 (8) ++++++
Join Date: 07.05.2009
Location: Москва
Quote:
Originally Posted by syl View Post
В общем проблема не решена, сделал AgreementRelationType видимым, переконфигурировал сервис AIF, коннектор данное поле не видит...
Попробуйте почистить кэш и пересобрать полный CIL.
З.Ы. Я недавно в контракте сервиса EDT поменял, тот еще челлендж был.
Old 19.08.2015, 11:43   #13  
syl is offline
syl
Участник
syl's Avatar
 
236 / 21 (1) +++
Join Date: 10.06.2015
Location: Киев
Quote:
Originally Posted by gl00mie View Post
Расшифруйте plz, что вошло во второе действие.
Сервис -> AIF -> Обновить службу документов (в опциях пересоздать существующие классы)
Old 19.08.2015, 20:17   #14  
Vasiliy Petrovich is offline
Vasiliy Petrovich
Участник
 
83 / 17 (1) ++
Join Date: 26.06.2015
Quote:
Originally Posted by syl View Post
Сервис -> AIF -> Обновить службу документов (в опциях пересоздать существующие классы)
деплойнуть сервис попробуйте
или соотв пункт из initialization checklist
Old 20.08.2015, 15:25   #15  
syl is offline
syl
Участник
syl's Avatar
 
236 / 21 (1) +++
Join Date: 10.06.2015
Location: Киев
Итак, после того как я сделал поле видимым, полностью пересоздал Document Service поле отобразилось и ошибка ушла (правда появился еще маленький вагончик ошибок и вопросов)
 

Similar Threads
Thread Thread Starter Forum Replies Last Post
Ошибка в проекте AIF web services kpoxa DAX: Программирование 2 07.05.2015 09:13
AIF: Microsoft Dynamics AX Services and Windows Azure Service Bus Blog bot DAX Blogs 0 24.07.2013 03:13
daxdilip: How to: Configure Dynamics AX AIF Services to listen for SSL Requests (https) Blog bot DAX Blogs 0 23.01.2011 10:12
Dianne Siebold: AIF Top Ten Blog bot DAX Blogs 1 22.04.2008 11:19
Русская локализация Axapta 3 ? SlavaK DAX: Администрирование 59 01.07.2003 22:38

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Рейтинг@Mail.ru
All times are GMT +3. The time now is 15:40.
Powered by vBulletin® Version 3.8.5
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Contacts E-mail, Advertising.