Main > Forum > 1C:Enterprise Platform > 1C:Integration > How can I find returned type XDTOObject or XDTOList

Forum

Search UsersRules
How can I find returned type XDTOObject or XDTOList
#1
Active user
Points:: 0
Joined:: Jul 28, 2015

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.

Profile
#2
Guest
Points::
Joined::

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>

Profile
#3
Active user
Points:: 0
Joined:: Jul 28, 2015

Timofey Bugaevsky,

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

Profile
Subscribe
Users browsing this topic (guests: 1, registered: 0, hidden: 0)



© 1C LLC. All rights reserved
1C Company respects the privacy of our customers and visitors
to our Web-site.