разобрать xml в cxml и голос наоборот в java

Я работаю с интеграцией Sap-Ariba, мне нужно преобразовать запрос счета-фактуры xml в cxml, потому что ariba принимает cxml. Могу ли я разобрать xml-пакет на cxml? Если да, то с чего я могу начать этот разбор, я потратил на это много времени, но не нашел ничего полезного.

это запрос ariba в cxml

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE cXML SYSTEM "http://svcdev6.ariba.com/schemas/cXML/1.2.042/InvoiceDetail.dtd">
<cXML payloadID="1566287213497-3191938426863.1.124" timestamp="2019-08-20T00:46:53-07:00">
    <Header>
        <From>
            <Credential domain="privateid">
                <Identity>1234567</Identity>
            </Credential>
        </From>
        <To>
            <Credential domain="NetworkId">
                <Identity>AN71000003970</Identity>
            </Credential>
        </To>
        <Sender>
            <Credential domain="NetworkId">
                <Identity>AN71000003970</Identity>
                <SharedSecret>welcome1a</SharedSecret>
            </Credential>
            <UserAgent>Buyer</UserAgent>
        </Sender>
    </Header>
    <Request>
        <InvoiceDetailRequest>
            <InvoiceDetailRequestHeader
                invoiceOrigin="supplier" invoiceDate="2019-11-06T13:47:50-08:00"
                operation="new" purpose="standard"
                invoiceID="_88">
                <InvoiceDetailHeaderIndicator />
                <InvoiceDetailLineIndicator
                    isAccountingInLine="yes" />
                <InvoicePartner>
                    <Contact addressID="US006" role="billTo">
                        <Name xml:lang="en">New York Sales</Name>
                        <PostalAddress name="default">
                            <Street>89 That Street</Street>
                            <City>City</City>
                            <State>NY</State>
                            <PostalCode>18037</PostalCode>
                            <Country isoCountryCode="US">United States</Country>
                        </PostalAddress>
                        <Phone name="work">
                            <TelephoneNumber>
                                <CountryCode isoCountryCode="US">1</CountryCode>
                                <AreaOrCityCode>212</AreaOrCityCode>
                                <Number>5551212</Number>
                            </TelephoneNumber>
                        </Phone>
                        <Fax name="work">
                            <TelephoneNumber>
                                <CountryCode isoCountryCode="US" />
                                <AreaOrCityCode />
                                <Number />
                            </TelephoneNumber>
                        </Fax>
                    </Contact>
                </InvoicePartner>
                <InvoicePartner>
                    <Contact addressID="RA11-1" role="remitTo">
                        <Name xml:lang="en">Any Name</Name>
                        <PostalAddress name="default">
                            <Street>89 That Street</Street>
                            <City>City</City>
                            <State>TX</State>
                            <PostalCode>78701</PostalCode>
                            <Country isoCountryCode="US">United States</Country>
                        </PostalAddress>
                    </Contact>
                </InvoicePartner>
                <InvoicePartner>
                    <Contact addressID="RA11-1" role="soldTo">
                        <Name xml:lang="en">Any Name</Name>
                        <PostalAddress name="default">
                            <Street>89 That Street</Street>
                            <City>City</City>
                            <State>TX</State>
                            <PostalCode>78701</PostalCode>
                            <Country isoCountryCode="US">United States</Country>
                        </PostalAddress>
                        <Email></Email>
                    </Contact>
                </InvoicePartner>
                <InvoiceDetailShipping>
                    <Contact addressID="144" role="shipFrom">
                        <Name xml:lang="de">jeder Name</Name>
                        <PostalAddress name="Standardwert">
                            <Street>Schelmenwasenstrasse 00</Street>
                            <City>Stuttgart</City>
                            <PostalCode>7000</PostalCode>
                            <Country isoCountryCode="DE">Germany</Country>
                        </PostalAddress>
                        <Phone name="work">
                            <TelephoneNumber>
                                <CountryCode isoCountryCode="DE">49</CountryCode>
                                <AreaOrCityCode>1</AreaOrCityCode>
                                <Number>1720000000</Number>
                            </TelephoneNumber>
                        </Phone>
                    </Contact>
                    <Contact addressID="US0806" role="shipTo">
                        <Name xml:lang="en">New York buyer</Name>
                        <PostalAddress name="default">
                            <Street>89 That Street</Street>
                            <City>City</City>
                            <State>NY</State>
                            <PostalCode>10937</PostalCode>
                            <Country isoCountryCode="US">United States</Country>
                        </PostalAddress>
                        <Phone name="work">
                            <TelephoneNumber>
                                <CountryCode isoCountryCode="US">1</CountryCode>
                                <AreaOrCityCode>212</AreaOrCityCode>
                                <Number>5551212</Number>
                            </TelephoneNumber>
                        </Phone>
                        <Fax name="work">
                            <TelephoneNumber>
                                <CountryCode isoCountryCode="US" />
                                <AreaOrCityCode />
                                <Number />
                            </TelephoneNumber>
                        </Fax>
                    </Contact>
                </InvoiceDetailShipping>
                <PaymentTerm payInNumberOfDays="45"></PaymentTerm>
                <PaymentTerm payInNumberOfDays="30">
                    <Discount>
                        <DiscountPercent percent="2" />
                    </Discount>
                </PaymentTerm>
                <PaymentTerm payInNumberOfDays="20">
                    <Discount>
                        <DiscountPercent percent="3" />
                    </Discount>
                </PaymentTerm>
                <Comments>
                    <Attachment>
                        <URL>cid:testpdf</URL>
                    </Attachment>
                </Comments>
                <Extrinsic name="invoiceSourceDocument">NoOrderInformation</Extrinsic>
                <Extrinsic name="invoiceSubmissionMethod">Post</Extrinsic>
                <Extrinsic name="PurchasingUnit">US100</Extrinsic>
                <Extrinsic name="Custom(H)" />
            </InvoiceDetailRequestHeader>
            <InvoiceDetailOrder>
                <InvoiceDetailOrderInfo>
                    <SupplierOrderInfo orderID="Unknown" />
                </InvoiceDetailOrderInfo>
                <InvoiceDetailItem quantity="1"
                    invoiceLineNumber="1">
                    <UnitOfMeasure>EA</UnitOfMeasure>
                    <UnitPrice>
                        <Money alternateCurrency="" alternateAmount="" currency="USD">5.95</Money>
                    </UnitPrice>
                    <InvoiceDetailItemReference lineNumber="0">
                        <ItemID>
                            <SupplierPartID> NEWHEIRARCHYabc156</SupplierPartID>
                        </ItemID>
                        <Description xml:lang="en-US">Adapter Din5M/MD6F Keyboard</Description>
                        <ManufacturerPartID>abc156</ManufacturerPartID>
                        <ManufacturerName>All Cables</ManufacturerName>
                        <Country isoCountryCode="DE">Germany</Country>
                    </InvoiceDetailItemReference>
                    <SubtotalAmount>
                        <Money alternateCurrency="" alternateAmount="" currency="USD">5.95</Money>
                    </SubtotalAmount>
                    <GrossAmount>
                        <Money alternateCurrency="" alternateAmount="" currency="USD">5.95</Money>
                    </GrossAmount>
                    <NetAmount>
                        <Money alternateCurrency="" alternateAmount="" currency="USD">5.95</Money>
                    </NetAmount>
                    <Distribution>
                        <Accounting name="DistributionCharge">
                            <AccountingSegment id="301">
                                <Name xml:lang="en">AccountingCombinationID</Name>
                                <Description xml:lang="en">AccountingCombinationID</Description>
                            </AccountingSegment>
                            <AccountingSegment id="GD">
                                <Name xml:lang="en">Company</Name>
                                <Description xml:lang="en">ID</Description>
                            </AccountingSegment>
                            <AccountingSegment id="">
                                <Name xml:lang="en">ERPSplitValue</Name>
                                <Description xml:lang="en">ERPSplitValue</Description>
                            </AccountingSegment>
                            <AccountingSegment id="100">
                                <Name xml:lang="en">Percentage</Name>
                                <Description xml:lang="en">Percentage</Description>
                            </AccountingSegment>
                            <AccountingSegment id="US100">
                                <Name xml:lang="en">BusinessUnit</Name>
                                <Description xml:lang="en">ID</Description>
                            </AccountingSegment>
                            <AccountingSegment id="3100">
                                <Name xml:lang="en">CostCenter</Name>
                                <Description xml:lang="en">ID</Description>
                            </AccountingSegment>
                            <AccountingSegment id="US100">
                                <Name xml:lang="en">ProcurementUnit</Name>
                                <Description xml:lang="en">ID</Description>
                            </AccountingSegment>
                            <AccountingSegment id="5008">
                                <Name xml:lang="en">SubAccount</Name>
                                <Description xml:lang="en">ID</Description>
                            </AccountingSegment>
                            <AccountingSegment id="7752">
                                <Name xml:lang="en">Account</Name>
                                <Description xml:lang="en">ID</Description>
                            </AccountingSegment>
                        </Accounting>
                        <Charge>
                            <Money alternateCurrency="" alternateAmount=""
                                currency="USD">5.95</Money>
                        </Charge>
                    </Distribution>
                    <Comments>
                        [Ariba added comment: Created in the name and on behalf of the supplier]
                        <Attachment>
                            <URL>cid:test.pdf</URL>
                        </Attachment>
                    </Comments>
                    <Extrinsic name="OriginatingSystemLineNumber">0</Extrinsic>
                    <Extrinsic name="Custom(L)" />
                </InvoiceDetailItem>
            </InvoiceDetailOrder>
            <InvoiceDetailSummary>
                <SubtotalAmount>
                    <Money alternateCurrency="" alternateAmount="" currency="USD">5.95</Money>
                </SubtotalAmount>
                <Tax>
                    <Money alternateCurrency="" alternateAmount="" currency="USD">0.00</Money>
                    <Description xml:lang="en">TotalTax                    </Description>
                </Tax>
                <SpecialHandlingAmount>
                    <Money alternateCurrency="" alternateAmount="" currency="USD">0.00</Money>
                </SpecialHandlingAmount>
                <ShippingAmount>
                    <Money alternateCurrency="" alternateAmount="" currency="USD">0.00</Money>
                </ShippingAmount>
                <GrossAmount>
                    <Money alternateCurrency="" alternateAmount="" currency="USD">5.95</Money>
                </GrossAmount>
                <InvoiceDetailDiscount>
                    <Money alternateCurrency="" alternateAmount="" currency="USD">0.00</Money>
                </InvoiceDetailDiscount>
                <NetAmount>
                    <Money alternateCurrency="" alternateAmount="" currency="USD">5.95</Money>
                </NetAmount>
                <DueAmount>
                    <Money alternateCurrency="" alternateAmount="" currency="USD">5.95</Money>
                </DueAmount>
            </InvoiceDetailSummary>
        </InvoiceDetailRequest>
    </Request>
</cXML>

0 ответов

Другие вопросы по тегам