curl -F ''xml_file=@InfoVersion.xml'' http://localhost:8080/opt/in/InfoVersion
#!/bin/bash file="fsrar_IDs.txt" clear while IFS=" " read -r HostName FsRAR_ID do printf 'HostName: %s, FsRAR_ID: %s\n' "$HostName" "$FsRAR_ID" out_file="InfoVersionTTN_$HostName.xml" #cut trailing ^M symbol FsRAR_ID=${FsRAR_ID/%$'\r'/} echo $'<?xml version="1.0" encoding="UTF-8"?>' >$out_file echo $'<ns:Documents xmlns:ns="http://fsrar.ru/WEGAIS/WB_DOC_SINGLE_01"' >>$out_file echo $'xmlns:qp="http://fsrar.ru/WEGAIS/InfoVersionTTN"' >>$out_file echo $'xmlns:xs="http://www.w3.org/2001/XMLSchema"' >>$out_file echo $'xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">' >>$out_file echo $'<ns:Owner>' >>$out_file echo $'<ns:FSRAR_ID>'$FsRAR_ID'</ns:FSRAR_ID>' >>$out_file echo $'</ns:Owner>' >>$out_file echo $'<ns:Document>' >>$out_file echo $'<ns:InfoVersionTTN>' >>$out_file echo $'<qp:ClientId>'$FsRAR_ID'</qp:ClientId>' >>$out_file echo $'<qp:WBTypeUsed>WayBill_v4</qp:WBTypeUsed>' >>$out_file echo $'</ns:InfoVersionTTN>' >>$out_file echo $'</ns:Document>' >>$out_file echo $'</ns:Documents>' >>$out_file #curl # printf ' curl -F "xml_file=@%s http://%s:8080/opt/in/InfoVersionTTN"\n' "$out_file" "$HostName" curl -F "xml_file=@"$out_file "http://"$HostName":8080/opt/in/InfoVersionTTN" done < "$file" exit 0;
magaz-01 020000280549 magaz01 0200002****1 magaz02 0200002****2 magaz04 0200002****7 ...