IBM webMethods Hybrid Integration

IBM webMethods Hybrid Integration

Join this online group to communicate across IBM product users and experts by sharing advice and best practices with peers and staying up to date regarding product enhancements.

 View Only
Expand all | Collapse all

Loading XML from FTP to Record

  • 1.  Loading XML from FTP to Record

    Posted Mon August 31, 2009 08:05 PM

    This is Acapulco and it’s my first post in wmUsers, so, hello everyone!

    Ok, here’s my problem, I’m using webMethods Integration Server 4.61 and I need to get an XML file from an FTP server, so I can then parse it and process the data in it and insert it into a database.

    Unfortunately I’m new with this IS stuff and I didn’t get any training :/, so I’m figuring everything by myself and the help of the included docs. Right now I can correctly get the file by using an ftp service, then getFile which loads the local file and puts it in a byte array, then a bytesToString service to finish up with an XMLValuesToRecord. The DB insertion will be done later, when I manage to read the XML file correctly.

    Ok, so I can read the file correctly (aside from some charset problems, righ now I’m using ASCII mode so a few latin chars get screwed up, but nothing too bad) and I can properly see it in a pipeline variable (called string). The problem comes when the XMLValuesToRecord tries to process the string.

    It spits out a com.util.coder.InvalidDatatypeException: [B2BCORE.0076.9010] Sibling root element is null
    rootTag:values localName:ZEVALPROV_TB root:Element:null:ZEVALPROV_TB

    and I have no idea why.

    My XML is as follows:

    <?xml version="1.0"?>
    <ZEVALPROV_TB>
    <IDOC BEGIN="1">
    <EDI_DC40 SEGMENT="1">
    <TABNAM>EDI_DC40</TABNAM>
    <MANDT>250</MANDT>
    <DOCNUM>0000000000549519</DOCNUM>
    <DOCREL>46C</DOCREL>
    <STATUS>30</STATUS>
    <DIRECT>1</DIRECT>
    <OUTMOD>2</OUTMOD>
    <EXPRSS></EXPRSS>
    <TEST></TEST>
    <IDOCTYP>ZEVALPROV_TB</IDOCTYP>
    <CIMTYP></CIMTYP>
    <MESTYP>ZEVALPROV_M</MESTYP>
    <MESCOD></MESCOD>
    <MESFCT></MESFCT>
    <STD></STD>
    <STDVRS></STDVRS>
    <STDMES>ZEVALP</STDMES>
    <SNDPOR>SAPDV2</SNDPOR>
    <SNDPRT>LS</SNDPRT>
    <SNDPFC></SNDPFC>
    <SNDPRN>TELXON</SNDPRN>
    <SNDSAD></SNDSAD>
    <SNDLAD></SNDLAD>
    <RCVPOR>A000000013</RCVPOR>
    <RCVPRT>LS</RCVPRT>
    <RCVPFC></RCVPFC>
    <RCVPRN>EFICENTRUM</RCVPRN>
    <RCVSAD></RCVSAD>
    <RCVLAD></RCVLAD>
    <CREDAT>2009-05-14</CREDAT>
    <CRETIM>19:22:10</CRETIM>
    <REFINT></REFINT>
    <REFGRP></REFGRP>
    <REFMES></REFMES>
    <ARCKEY></ARCKEY>
    <SERIAL>20090514183357</SERIAL>
    </EDI_DC40>
    <ZEVALPROV SEGMENT="1">
    <ZMANDT>250</ZMANDT>
    <Z_PROVEEDOR>0000020019</Z_PROVEEDOR>
    <Z_CONTRATISTA>001</Z_CONTRATISTA>
    <Z_GRAFO>030000004102</Z_GRAFO>
    <Z_FECH_OPER>20090514</Z_FECH_OPER>
    <Z_TIME_OPER>183357</Z_TIME_OPER>
    <Z_USR>CUCO2001</Z_USR>
    <Z_STATUS>NC</Z_STATUS>
    <ZQUEST01>EL PROVEEDOR CUMPLIO CON LA NORMATIVIDAD DE SEGURIDAD AL INICIO Y DURANTE LA ETAPA CONSTRUCTIVA?</ZQUEST01>
    <Z_QUEST_01>S</Z_QUEST_01>
    <ZQUEST02>EL PROVEEDOR DEBERÀ TRAER ALCANCE DEL PROYECTO GRAFO ASI COMO LA DOCUMENTACIÒN TECNICA?</ZQUEST02>
    <Z_QUEST_02>S</Z_QUEST_02>
    <ZQUEST03>CUMPLIO CON LOS MATERIALES Y HERRAMIENTAS (NORMAS, PROCEDIMIENTOS, PROTOCOLO, ETC ) QUE GARANTICEN LA CALIDAD EN LA INSTALACIÒN</ZQUEST03>
    <Z_QUEST_03>S</Z_QUEST_03>
    <ZQUEST04>SE CUMPLIO CON LA NORMATIVIDAD EN LA INSTALACIÒN?</ZQUEST04>
    <Z_QUEST_04>S</Z_QUEST_04>
    <ZQUEST05>SE ENTREGO EL PROTOCOLO DE PRUEBAS DEBIDAMENTE LLENADO ASI COMO EL CHEKLIST G/020/010?</ZQUEST05>
    <Z_QUEST_05>S</Z_QUEST_05>
    <Z_FECH_PROC>00000000</Z_FECH_PROC>
    <Z_COMENTS>PRUEBA CON CUCO</Z_COMENTS>
    </ZEVALPROV>
    </IDOC>
    </ZEVALPROV_TB>

    Any ideas?

    Thanks a lot!


    #Integration-Server-and-ESB
    #Flow-and-Java-services
    #webMethods


  • 2.  RE: Loading XML from FTP to Record

    Posted Mon August 31, 2009 08:31 PM

    Ok. Apparently I didn’t do a thorough search before, but I solved my problem.

    I read this post:

    [url]wmusers.com

    And now I have the following services:

    ftp
    getFile
    stringToDocument
    documentToRecord

    Apparently the XMLValuesToRecord service only works if you use the XMLCoder service, or at least that’s what I understood.


    #webMethods
    #Flow-and-Java-services
    #Integration-Server-and-ESB