Mechanics of Importing and Exporting XML Larry Talley National Marine Fisheries Service
Outline How to import and export XML How to import and export XML Choosing an interface approach Choosing an interface approach Trouble-shooting Trouble-shooting Experience Experience
eLandings Interfaces Website “eLandings” includes XML Import and Export Agency Interface review & edit data At-sea Fleet reporting via Web Services
XML Export Browse to: Browse to: Login as “amarx”…”A_marx” Login as “amarx”…”A_marx” Reports Menu, find, display report Reports Menu, find, display report Red line common in Training Red line common in Training Click report id to see XML Click report id to see XML Save the XML file Save the XML file
XML Import Browse to: Browse to: Login as amarx A_marx Login as amarx A_marx Reports Menu, Import…Report Reports Menu, Import…Report Browse to locate LR.xml file Browse to locate LR.xml file Press Import Press Import
Bulk XML Export DataDump: DataDump: Extract multiple landing reports Extract multiple landing reports Flexible selection criteria Flexible selection criteria Returns Returns
Review XML – platform independent data XML – platform independent data XML Unicode, character encoding, UTF-8 Unicode, character encoding, UTF-8 Unicodecharacter encodingUTF-8 Unicodecharacter encodingUTF-8 eLandings XML schema eLandings XML schemaschema Schema versioning Schema versioning Import, Export, Bulk Export Import, Export, Bulk Export
Import and Export in Your Business Context
Import vs. Export In the context of your business
Import vs. Export
Don’t Try This at Home (IFQ)
Export Pros Agency validation Agency validation No business rule surprises No business rule surprises Computational results match government record Computational results match government record Immediate validation of compliance Immediate validation of compliance
Export Cons You don’t control user experience You don’t control user experience User experience may include fields and complexity beyond requirements of your business User experience may include fields and complexity beyond requirements of your business Requires more eLandings knowledge Requires more eLandings knowledge More dependencies on things outside of your control More dependencies on things outside of your control
Import Pros User experience under your control User experience under your control Requires less eLandings knowledge Requires less eLandings knowledge Fewer dependencies on things outside of your control Fewer dependencies on things outside of your control
Import Cons Not practical for IFQ reporting Not practical for IFQ reporting Requires more knowledge of agency business rules, or; Requires more knowledge of agency business rules, or; Late validation may require retroactive fix Late validation may require retroactive fix Computational results may not match government record Computational results may not match government record May increase frustration/stress May increase frustration/stress Late printing of fish tickets Late printing of fish tickets
Web Service Pros User experience under your control User experience under your control precisely tailored to your businessprecisely tailored to your business optimized for your technologyoptimized for your technology Seamless user experience Seamless user experience Users require less eLandings knowledge Users require less eLandings knowledge Programmed response to things outside of your control Programmed response to things outside of your control
Web Service Cons Not practical for IFQ reporting Not practical for IFQ reporting Web Service API not comprehensively versioned Web Service API not comprehensively versioned Risk of breaking customer systemsRisk of breaking customer systems We can’t freeze evolution of eLandingsWe can’t freeze evolution of eLandings Requires significant software development Requires significant software development Limited eLandings documentation Limited eLandings documentation Some topics only documented in codeSome topics only documented in code No reference implementationNo reference implementation API may be too comprehensive API may be too comprehensive 39 methods – reducible to 12?39 methods – reducible to 12?
Troubleshooting Import and Export Invalid XML -- missing tags, etc. Invalid XML -- missing tags, etc. Use XMLCheck for feedbackUse XMLCheck for feedback Unacceptable data values (violations of eLandings business rules) Unacceptable data values (violations of eLandings business rules) eLandings messageseLandings messages
Practice Import landing report Import landing report Import production report Import production report Find new landing report and export Find new landing report and export Find new production report and export Find new production report and export Attempt to import from invalid XML Attempt to import from invalid XML Export multiple landing reports Export multiple landing reports
Conclusion Import and export of XML Import and export of XML Choosing an interface approach Choosing an interface approach Trouble-shooting Trouble-shooting Practice Practice