How can I find returned type XDTOObject or XDTOList

1C:Enterprise platform integration capabilities and techniques

#1
People who like this:0Yes/0No
Active user
Rating: 7
Joined: Jul 28, 2015
Company:

Hi every one, I'm in trouble with xml could you help me please?

I have a xml file and I try to get datas from that xml file.

In that files have some times one object some times many object

for example

Code
<Sales_Invoices>
  <Invoice>
    <Curr_Acc_Code ..... />
     .
     .
     .
  </Invoice>
</Sales_Invoices>

some times this xml could be like that
Code
<Sales_Invoices>
  <Invoice>
    <Curr_Acc_Code ..... />
     .
     .
     .
  </Invoice>
 <Invoice>
    <Curr_Acc_Code ..... />
     .
     .
     .
  </Invoice>
</Sales_Invoices>

if that xml file have many Invoice my for each can work very good.But if that xml file have just one Invoice for each gives error because if xml have many Invoice ObjectXDTO.Invoice return XDTOList type but If xml have a Ivoice ObjectXDTO return XDTOObject. I try to fix with TypeOf but I couldn't. How can I fix this situation.

Could you help me please?

edit: TypeOf Function doesn't useful. İf I check Shift+F9 return Type is XDTOList or XDTOObject but If I check TypeOf method return type always XDTOObject.

Edited: Mehmet Tuğrul SARIÇİÇEK - Aug 11, 2015 11:51 PM
 
#2
People who like this:0Yes/0No
Timofey Bugaevsky
Guest

Joined:
Company:

Hello, Mehmet Tuğrul SARIÇİÇEK.

You need to configure Saes_Invoices to be a sequence of Invoice. In your schema you need to have xs:sequence tag around Invoice:

Code
   <xs:complexType name="Sales_Invoice">
      <xs:sequence>
         <xs:element name="Invoices" type="tns:Invoice" minOccurs="0" maxOccurs="unbounded"/>
      </xs:sequence>
   </xs:complexType>

Download xdto.png (29.93 KB)
 
#3
People who like this:0Yes/0No
Active user
Rating: 7
Joined: Jul 28, 2015
Company:

Timofey Bugaevsky,

Thank you so much sir, I'm appreceate for your interest and answer. Thank you

 
Subscribe
Users browsing this topic (guests: 1, registered: 0, hidden: 0)
Be the first to know tips & tricks on business application development!

A confirmation e-mail has been sent to the e-mail address you provided .

Click the link in the e-mail to confirm and activate the subscription.