проверка образца сообщения fpml путем вызова CURL API fpml.org для проверки fpml завершается с ошибкой, содержимое которой не разрешено в прологе

СВЕРНУТЬ ВЫЗОВ

      - curl -i -w '\n' -H "x-api-key:$MY_KEY" -H "Content-Type:text/xml" https://gvtumr1txd.execute-api.eu-west-1.amazonaws.com/production/validate --data  @SampleFileValuationReportIRS.xml \ --trace-ascii -

Пункты к сведению

  1. Я могу успешно проверить тот же файл, используя веб-интерфейс проверки, предоставленный FPML, здесь - https://www.fpml.org/tools/fpml-validator/
  2. В трассировке ниже я вижу три точки (многоточие) перед фактическим содержимым xml моего файла. Фактический файл XML не имеет этого многоточия в начале, поэтому не уверен, почему он отображается в трассировке. Это вызывает проблему?
  3. Я могу опубликовать фактический файл xml, содержащий сообщение fpml, но трассировка уже содержит содержимое xml (за исключением дополнительного многоточия, упомянутого в пункте 2).

Вот вывод трассировки вызова CURL

      == Info:   Trying 108.128.176.131...
== Info: TCP_NODELAY set
== Info: Connected to gvtumr1txd.execute-api.eu-west-1.amazonaws.com (108.128.176.131) port 443 (#0)
== Info: schannel: SSL/TLS connection with gvtumr1txd.execute-api.eu-west-1.amazonaws.com port 443 (step 1/3)
== Info: schannel: checking server certificate revocation
== Info: schannel: sending initial handshake data: sending 217 bytes...
== Info: schannel: sent initial handshake data: sent 217 bytes
== Info: schannel: SSL/TLS connection with gvtumr1txd.execute-api.eu-west-1.amazonaws.com port 443 (step 2/3)
== Info: schannel: failed to receive handshake, need more data
== Info: schannel: SSL/TLS connection with gvtumr1txd.execute-api.eu-west-1.amazonaws.com port 443 (step 2/3)
== Info: schannel: encrypted data got 4096
== Info: schannel: encrypted data buffer: offset 4096 length 4096
== Info: schannel: encrypted data length: 4030
== Info: schannel: encrypted data buffer: offset 4030 length 4096
== Info: schannel: received incomplete message, need more data
== Info: schannel: SSL/TLS connection with gvtumr1txd.execute-api.eu-west-1.amazonaws.com port 443 (step 2/3)
== Info: schannel: encrypted data got 1024
== Info: schannel: encrypted data buffer: offset 5054 length 5054
== Info: schannel: encrypted data length: 70
== Info: schannel: encrypted data buffer: offset 70 length 5054
== Info: schannel: received incomplete message, need more data
== Info: schannel: SSL/TLS connection with gvtumr1txd.execute-api.eu-west-1.amazonaws.com port 443 (step 2/3)
== Info: schannel: encrypted data got 277
== Info: schannel: encrypted data buffer: offset 347 length 5054
== Info: schannel: sending next handshake data: sending 126 bytes...
== Info: schannel: SSL/TLS connection with gvtumr1txd.execute-api.eu-west-1.amazonaws.com port 443 (step 2/3)
== Info: schannel: encrypted data got 290
== Info: schannel: encrypted data buffer: offset 290 length 5054
== Info: schannel: SSL/TLS handshake complete
== Info: schannel: SSL/TLS connection with gvtumr1txd.execute-api.eu-west-1.amazonaws.com port 443 (step 3/3)
== Info: schannel: stored credential handle in session cache
=> Send header, 249 bytes (0xf9)
0000: POST /production/validate HTTP/1.1
0024: Host: gvtumr1txd.execute-api.eu-west-1.amazonaws.com
005a: User-Agent: curl/7.55.1
0073: Accept: */*
0080: x-api-key:FEUmuAR83D5bwA5JkASyd8LGczAhpgXU5GL3G2M5
00b4: Content-Type:text/xml
00cb: Content-Length: 2794
00e1: Expect: 100-continue
00f7:
== Info: schannel: client wants to read 102400 bytes
== Info: schannel: encdata_buffer resized 103424
== Info: schannel: encrypted data buffer: offset 0 length 103424
== Info: schannel: encrypted data got 54
== Info: schannel: encrypted data buffer: offset 54 length 103424
== Info: schannel: decrypted data length: 25
== Info: schannel: decrypted data added: 25
== Info: schannel: decrypted data cached: offset 25 length 102400
== Info: schannel: encrypted data buffer: offset 0 length 103424
== Info: schannel: decrypted data buffer: offset 25 length 102400
== Info: schannel: schannel_recv cleanup
== Info: schannel: decrypted data returned 25
== Info: schannel: decrypted data buffer: offset 0 length 102400
<= Recv header, 23 bytes (0x17)
0000: HTTP/1.1 100 Continue
HTTP/1.1 100 Continue

=> Send data, 2794 bytes (0xaea)
0000: ...<?xml version="1.0" encoding="utf-8"?><!-- Created with Liqui
0040: d Studio 2021 (https://www.liquid-technologies.com) --><valuatio
0080: nReport xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore" xmln
00c0: s:fpml-annotation="http://www.fpml.org/annotation" xmlns="http:/
0100: /www.fpml.org/FpML-5/reporting" xmlns:xsi="http://www.w3.org/200
0140: 1/XMLSchema-instance" xsi:schemaLocation="http://www.fpml.org/Fp
0180: ML-5/reporting file:///C:/Users/gabriel%20thomas/Documents/GitHu
01c0: b/GitLab/frtbsa/Static/Schemas/XML/reporting-5-12_xml/reporting/
0200: fpml-valuation-reporting-5-12.xsd" fpmlVersion="5-0">    <header
0240: >        <messageId messageIdScheme="gabt_frtbsa_fpml">MSG_VALRE
0280: P_0000001</messageId>    </header>    <party id="party1">
02c0:  <partyId partyIdScheme="http://www.fpml.org/coding-scheme/dummy
0300: -party-id">Party A</partyId>    </party>    <tradeValuationItem>
0340:         <partyTradeIdentifier id="tid-1">            <partyRefer
0380: ence href="party1" />            <tradeId tradeIdScheme="gabt_fr
03c0: tbsa_TradeIDScheme">T00000001</tradeId>        </partyTradeIdent
0400: ifier>        <valuationSet id="val1">            <valuationScen
0440: ario id="valscen1">                <name>EOD Valuation</name>
0480:              <valuationDate>2022-01-08</valuationDate>
04c0:   </valuationScenario>            <baseParty href="party1" />
0500:          <!--results for trade #1-->            <assetValuation>
0540:                 <objectReference href="tid-1" />
0580: <!--quote value and NPV-->                <quote>
05c0:      <value>-14875</value>                    <measureType>NPV</
0600: measureType>                    <sensitivitySet>
0640:         <name>Interest Rate Delta Sensitivity in $/bp</name>
0680:                     <sensitivity name="1D">211</sensitivity>
06c0:                     <sensitivity name="2D">212</sensitivity>
0700:                     <sensitivity name="1M">213</sensitivity>
0740:                     <sensitivity name="3M">214</sensitivity>
0780:                     <sensitivity name="DEC03">215</sensitivity>
07c0:                        <sensitivity name="MAR04">216</sensitivit
0800: y>                        <sensitivity name="JUN04">217</sensiti
0840: vity>                        <sensitivity name="SEP04">218</sens
0880: itivity>                        <sensitivity name="2Y">219</sens
08c0: itivity>                        <sensitivity name="3Y">220</sens
0900: itivity>                        <sensitivity name="4Y">221</sens
0940: itivity>                        <sensitivity name="5Y">222</sens
0980: itivity>                        <sensitivity name="7Y">223</sens
09c0: itivity>                        <sensitivity name="10Y">224</sen
0a00: sitivity>                        <sensitivity name="15Y">225</se
0a40: nsitivity>                    </sensitivitySet>                <
0a80: /quote>            </assetValuation>        </valuationSet>    <
0ac0: /tradeValuationItem>    </valuationReport>
== Info: We are completely uploaded and fine
== Info: schannel: client wants to read 102400 bytes
== Info: schannel: encrypted data buffer: offset 0 length 103424
== Info: schannel: encrypted data got 720
== Info: schannel: encrypted data buffer: offset 720 length 103424
== Info: schannel: decrypted data length: 691
== Info: schannel: decrypted data added: 691
== Info: schannel: decrypted data cached: offset 691 length 102400
== Info: schannel: encrypted data buffer: offset 0 length 103424
== Info: schannel: decrypted data buffer: offset 691 length 102400
== Info: schannel: schannel_recv cleanup
== Info: schannel: decrypted data returned 691
== Info: schannel: decrypted data buffer: offset 0 length 102400
<= Recv header, 17 bytes (0x11)
0000: HTTP/1.1 200 OK
HTTP/1.1 200 OK
<= Recv header, 37 bytes (0x25)
0000: Date: Sun, 23 Jan 2022 13:31:52 GMT
Date: Sun, 23 Jan 2022 13:31:52 GMT
<= Recv header, 32 bytes (0x20)
0000: Content-Type: application/json
Content-Type: application/json
<= Recv header, 21 bytes (0x15)
0000: Content-Length: 377
Content-Length: 377
<= Recv header, 24 bytes (0x18)
0000: Connection: keep-alive
Connection: keep-alive
<= Recv header, 56 bytes (0x38)
0000: x-amzn-RequestId: 71db9ee5-c7d8-427c-a65e-73551125644b
x-amzn-RequestId: 71db9ee5-c7d8-427c-a65e-73551125644b
<= Recv header, 32 bytes (0x20)
0000: Access-Control-Allow-Origin: *
Access-Control-Allow-Origin: *
<= Recv header, 34 bytes (0x22)
0000: x-amz-apigw-id: MZrPPGeyjoEFbYg=
x-amz-apigw-id: MZrPPGeyjoEFbYg=
<= Recv header, 59 bytes (0x3b)
0000: X-Amzn-Trace-Id: Root=1-61ed58c7-5f6bbe6c645e7fc212ccd847
X-Amzn-Trace-Id: Root=1-61ed58c7-5f6bbe6c645e7fc212ccd847

<= Recv header, 2 bytes (0x2)
0000:
<= Recv data, 377 bytes (0x179)
0000: {"info":{"release":{"specification":"FpML","version":"5-11","nam
0040: espace":"http://www.fpml.org/FpML-5/confirmation"},"catalog":"fi
0080: les-fpml/catalog-fpml.xml","rules":"AllRules"},"businessErrors":
00c0: [],"syntaxErrors":[{"level":"fatal","message":"Malformed XML con
0100: tent could not be parsed. Syntax validation disabled."},{"level"
0140: :"fatal","message":"Content is not allowed in prolog."}]}
{"info":{"release":{"specification":"FpML","version":"5-11","namespace":"http://www.fpml.org/FpML-5/confirmation"},"catalog":"files-fpml/catalog-fpml.xml","rules":"AllRules"},"businessErrors":[],"syntaxErrors":[{"level":"fatal","message":"Malformed XML content could not be parsed. Syntax validation disabled."},{"level":"fatal","message":"Content is not allowed in prolog."}]}== Info: Connection #0 to host gvtumr1txd.execute-api.eu-west-1.amazonaws.com left intact

1 ответ

я решил это сейчас ... После долгих исследований я подтвердил по этой ссылке validator.w3.org/i18n-checker/check#validate-by-upload+, что мой файл имел метки порядка байтов (невидимые символы) в начале.

Чтобы удалить спецификацию, я открыл файл в Блокноте, изменил кодировку спецификации UTF-8 на UTF-8, а затем сохранил ее.

Другие вопросы по тегам