cancel
Showing results for 
Search instead for 
Did you mean: 

cXML integration

Former Member
0 Kudos

Hi,

I am implementing this cxml to IDOC scenario in PI.

I have downloaded invoicedetail.dtd file from cxml website and converted it into XSD.

then I have imported xsd into external definition. after that I can see various messages in the message tab. like HEADER , INVOICE REQUEST.

Where as I was expecting that these elements will be grouped in a segment ??? is that correct ? as any inbound cxml file will have header and invoice lines with them , so should they be separate messages ? something wrong ?

Regards

Accepted Solutions (1)

Accepted Solutions (1)

markangelo_dihiansan
Active Contributor
0 Kudos

Hello,

Since you have already converted it to an xsd, maybe it would help to look inside the xsd for the message that would contain both the HEADER and the INVOICE BODY. e.g


<xsd:complexType name="rootType">
 <xsd:sequence>
     <xsd:element name="HEADER" type="headerType"/>
     <xsd:element name="BODY" type="invoiceType"/>
 </xsd:sequence>
</xsd:complexType>

I'm not sure if my syntax is correct as I'm not using any XML tools right now. But in the example, since the rootType contains both the header and the body, you could look for it's equivalent message type e.g

<xsd:element name="Invoice" type="rootType"/>

Take note that the element name declared above does not belong in any sequence.

Hope this helps,

Former Member
0 Kudos

Hi ,

I don't see any <xsd:complexType name="rootType"> statement in XSD file. Shouldnt it be there ?

markangelo_dihiansan
Active Contributor
0 Kudos

Hello,

That was just an example. If it would be possible to paste the xsd here, I could take a look.

Regards,

Mark

Former Member
0 Kudos

Hi,

Here is the XSD file I created from the invoicedetail.DTD file . original DTD file is at cXML website. Though there is another CXML.DTD file which does have this other node , but for invoice they are suggesting to use invoicedetail.

<xs:schema xmlns:xs='http://www.w3.org/2001/XMLSchema'>
 <xs:annotation>
  -- This schema was automatically generated by Syntext Dtd2Schema --
  -- conversion tool (from file: C:\Documents and Settings\bhandariv\Desktop\InvoiceDetail.dtd) --
  -- Copyright (C) 2002, 2003 Syntext Inc. See <a href="http://www.syntext.com" TARGET="test_blank">http://www.syntext.com</a> for updates. --
 </xs:annotation>
 <xs:attributeGroup name='xmlLangCode'>
 </xs:attributeGroup>
 <xs:attributeGroup name='isoCountryCode'>
 </xs:attributeGroup>
 <xs:attributeGroup name='isoCurrencyCode'>
 </xs:attributeGroup>
 <xs:attributeGroup name='uint'>
 </xs:attributeGroup>
 <xs:attributeGroup name='URL'>
 </xs:attributeGroup>
 <xs:element name='Accounting'>
  <xs:complexType>
   <xs:sequence>
     <xs:choice>
       <xs:element ref='Segment' maxOccurs='unbounded'/>
       <xs:element ref='AccountingSegment' maxOccurs='unbounded'/>
     </xs:choice>
   </xs:sequence>
  <xs:attribute name='name' use='required'/>
  </xs:complexType>
 </xs:element>
 <xs:element name='AccountingSegment'>
  <xs:complexType>
   <xs:sequence>
     <xs:element ref='Name'/>
     <xs:element ref='Description'/>
   </xs:sequence>
  <xs:attribute name='id' use='required'/>
  </xs:complexType>
 </xs:element>
 <xs:element name='Address'>
  <xs:complexType>
   <xs:sequence>
     <xs:element ref='Name'/>
     <xs:element ref='PostalAddress' minOccurs='0'/>
     <xs:element ref='Email' minOccurs='0'/>
     <xs:element ref='Phone' minOccurs='0'/>
     <xs:element ref='Fax' minOccurs='0'/>
     <xs:element ref='URL' minOccurs='0'/>
   </xs:sequence>
  <xs:attribute name='isoCountryCode'/>
  <xs:attributeGroup ref='isoCountryCode'/>
  <xs:attribute name='addressID'/>
  </xs:complexType>
 </xs:element>
 <xs:element name='AgreementItemOut'>
  <xs:complexType>
   <xs:sequence>
     <xs:element ref='MaxAmount' minOccurs='0'/>
     <xs:element ref='MinAmount' minOccurs='0'/>
     <xs:element ref='MaxReleaseAmount' minOccurs='0'/>
     <xs:element ref='MinReleaseAmount' minOccurs='0'/>
     <xs:element ref='ItemOut'/>
   </xs:sequence>
  <xs:attribute name='maxQuantity'/>
  <xs:attribute name='minQuantity'/>
  <xs:attribute name='maxReleaseQuantity'/>
  <xs:attribute name='minReleaseQuantity'/>
  </xs:complexType>
 </xs:element>

Edited by: V bhandari on Dec 7, 2010 9:01 PM

markangelo_dihiansan
Active Contributor
0 Kudos

Hi,

When I imported the document, I am seeing 4 messages (on the same level):

Accounting

AccountingSegment

Address

AgreementItemOut

Which I think is not what is your requirement. Are there multiple xsds generated? If so, you need to import them one by one in PI. Also, If you will be using the .dtd itself, you need to clear out the any namespaces since this is not allowed in PI 7.1.

Hope this helps,

Mark

Former Member
0 Kudos

Hi Mark,

Yes they are on same level. Now on CXML website there are two DTD files.

cXML.DTD

there is an element CXML ( which I need as root element)

Invoicedetail.DTD

in there are 2 elements on same level , which I need

Header

InvoiceLInes

Now, The file I am expecting will come as

CXML

Hedaer

Invoicelines

</>

Now the issue is if I have two diff DTD , How can I map it to one message interface ? so that it resembles the incoming XML file?

markangelo_dihiansan
Active Contributor
0 Kudos

Hi.

I'm not sure if DTDs can have multiple references just like xsds. But in your case, since you have a DTD to XSD converter. You can try creating another xsd that will contain the CML structure, Header and Invoicelines. No need to copy paste, just use the xsd:include in your declaration.

Hope this helps,

Mark

Former Member
0 Kudos

so do you think, I should create one XSD from those 2 DTD file and then create one External definition in PI ?

Thanks,

markangelo_dihiansan
Active Contributor
0 Kudos

Yup, that is correct.

Regards,

Mark

Former Member
0 Kudos

HI,

You can convert DTD to XSD file using converter and make it into one XSD file under External Defination in PI Server

Regards,

Ravi.

Former Member
0 Kudos

Thanks guys for your input, this was resolved this way.

1. Convert DTD into one XSD file.

2. upload that XSD as external definition into PI

3. In service defn , while using that ext defn use the message cXML( since that is the root node) and everything goes fine.

Answers (1)

Answers (1)

markangelo_dihiansan
Active Contributor
0 Kudos

Hi,

A DTD can be composed of many messages. Usually, the name of the DTD itself will indicate the root node of the message that will contain the sub-messages. e.g for Orders.dtd, go to the Messages tab in the external definition and find the Orders there. The Orders message will contain all the items from Header to Items. It should also be the same in your case.

Regards,

Mark

Former Member
0 Kudos

Hi Mark,

Thanks for the reply. That doesnot looks like , invoicedetail.dtd seems to contain all the segments related to Invoice .

Thanks,