简体   繁体   English

通过对 fpml.org api 发出 CURL 调用来验证示例 fpml 消息验证失败,错误内容不允许在 prolog

[英]validation of sample fpml message by making a CURL call to the fpml.org api for fpml validation is failing with error content not allowed in prolog

CURL Call CURL 调用

- 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 -

Points to Note注意事项

  1. I am able to validate the same file successfully using the validation web interface provided by FPML over here - https://www.fpml.org/tools/fpml-validator/我能够使用此处由 FPML 提供的验证 web 接口成功验证同一个文件 - https://www.fpml.org/tools/fpml-validator/
  2. IN the trace below i can see three dots (ellipsis) before the actual xml content of my file.在下面的跟踪中,我可以在文件的实际 xml 内容之前看到三个点(省略号)。 The actual XML file doesn't have this ellipsis at the beginning, so not sure why its showing up in the trace.实际的 XML 文件在开头没有这个省略号,所以不确定为什么它会出现在跟踪中。 Is this causing a problem?这会导致问题吗?
  3. I can post the actual xml file containing the fpml message, but the trace already contains the xml content (except for the additional ellipsis mentioned in point 2)我可以发布包含 fpml 消息的实际 xml 文件,但跟踪已经包含 xml 内容(除了第 2 点中提到的附加省略号)

Here is the trace output from the CURL call这是来自 CURL 调用的跟踪 output

== 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

i resolved this now...After much research i confirmed via this link validator.w3.org/i18n-checker/check#validate-by-upload+ that my file had Byte Order Marks (invisible characters) at the beginning.我现在解决了这个问题...经过大量研究,我通过此链接验证器.w3.org/i18n-checker/check#validate-by-upload+ 确认我的文件在开头有字节顺序标记(不可见字符)。

To remove BOM i opened the file in Notepad, changed the encoding from UTF-8 BOM to UTF-8 and then saved it.要删除 BOM,我在记事本中打开文件,将编码从 UTF-8 BOM 更改为 UTF-8,然后保存。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM