Fiware Proton Orion订阅-解析通知XML时出错
我已经配置了Orion和Proton FIWARE通用启用码,并在Orion中订阅了一个订阅,以便在修改Node类型的实体时向Proton发送通知 Proton恰好返回了一个与解析接收到的XML相关的错误Fiware Proton Orion订阅-解析通知XML时出错,fiware,complex-event-processing,Fiware,Complex Event Processing,我已经配置了Orion和Proton FIWARE通用启用码,并在Orion中订阅了一个订阅,以便在修改Node类型的实体时向Proton发送通知 Proton恰好返回了一个与解析接收到的XML相关的错误 proton | Mar 02, 2016 11:46:47 AM com.ibm.hrl.proton.webapp.providers.EventXmlNgsiMessageReader readFrom proton | INFO: started event message body
proton | Mar 02, 2016 11:46:47 AM com.ibm.hrl.proton.webapp.providers.EventXmlNgsiMessageReader readFrom
proton | INFO: started event message body reader
proton | Mar 02, 2016 11:46:47 AM com.ibm.hrl.proton.webapp.providers.EventXmlNgsiMessageReader readFrom
proton | INFO: Event: NodeContextUpdate
proton | Mar 02, 2016 11:46:47 AM com.ibm.hrl.proton.webapp.providers.EventXmlNgsiMessageReader readFrom
proton | SEVERE: Could not parse XML NGSI event java.lang.NullPointerException, reason: null
proton | last attribute name: null last value: null
我发现至少有另一个用户发布了一个类似的问题,但该问题的答案并不适合(并解决)我的情况
编辑:
以下是Proton收到的POST请求:
........POST /ProtonOnWebServer/rest/events HTTP/1.1
User-Agent: orion/0.27.0-next libcurl/7.19.7
Host: 192.168.99.100:8080
Accept: application/xml, application/json
Content-length: 901
Content-type: application/xml
<notifyContextRequest>
<subscriptionId>570b7cad849a7fd6c9ebaaf3</subscriptionId>
<originator>localhost</originator>
<contextResponseList>
<contextElementResponse>
<contextElement>
<entityId type="Node" isPattern="false">
<id>Node3</id>
</entityId>
<contextAttributeList>
<contextAttribute>
<name>temperature</name>
<type>double</type>
<contextValue>23</contextValue>
</contextAttribute>
<contextAttribute>
<name>pressure</name>
<type>double</type>
<contextValue>15</contextValue>
</contextAttribute>
</contextAttributeList>
</contextElement>
<statusCode>
<code>200</code>
<reasonPhrase>OK</reasonPhrase>
</statusCode>
</contextElementResponse>
</contextResponseList>
</notifyContextRequest>
谢谢。为了其他查看此线程的人,以下是Jose对解决此问题的解释。我希望何塞对此表示同意: 当我第一次遇到类似的错误时,我并没有做出正确的判断 Orion中的订阅以XML格式发送信息。这个 解决方案是使用“Accept”:“application/xml”作为 订阅后重新请求,以便Orion以XML形式通知Proton NGSI。(应该使用XML的原因是JSON格式 质子接受的不是NGSI) 这次我只是忘了在 NodeContextUpdate事件定义