Git Product home page Git Product logo

Comments (2)

marcc-orange avatar marcc-orange commented on June 12, 2024

Orion expects the Context Entity and its attributes to exist, by having been previously added by an APPEND or registerContext request, when using UPDATE.

We just recently changed our examples and code to use APPEND instead of UPDATE as we also hit this error.

So the latest version (0.1.2-SNAPSHOT from master branch) examples and code should work fine with Orion.

Strangely, orion returns http status 200, even though the content indicates, that the request failed.

This is expected from Orion as this behavior is specified as part of the NGSI v1 protocol specification. All NGSI requests will always return 200 Ok HTTP response code, applications are expected to check for errorCode and statusCode tags in the response.

What is unexpected is the orionError tag which are not part of the NGSI v1 specification.

Can you confirm you still get the error once you use UPDATE with an existing Context Entity, I tried to reproduce with Postman on orion.lab.fiware.org:1026 but got no error:

POST /ngsi10/updateContext HTTP/1.1
Host: orion.lab.fiware.org:1026
Accept: application/xml
X-Auth-Token: **********************************
Content-Type: application/xml
Cache-Control: no-cache

<updateContextRequest><updateAction>UPDATE</updateAction><contextElementList><contextElement><entityId type="Floor" isPattern="false"><id>Floor3</id></entityId><contextAttributeList><contextAttribute><name>temperature</name><type>double</type><contextValue>23.46153846153846</contextValue><metadata/></contextAttribute></contextAttributeList></contextElement></contextElementList></updateContextRequest>

response :

<updateContextResponse>
    <contextResponseList>
        <contextElementResponse>
            <contextElement>
                <entityId type="Floor" isPattern="false">
                    <id>Floor3</id>
                </entityId>
                <contextAttributeList>
                    <contextAttribute>
                        <name>temperature</name>
                        <type>double</type>
                        <contextValue></contextValue>
                    </contextAttribute>
                </contextAttributeList>
            </contextElement>
            <statusCode>
                <code>200</code>
                <reasonPhrase>OK</reasonPhrase>
            </statusCode>
        </contextElementResponse>
    </contextResponseList>
</updateContextResponse>

If the Context Entity Floor3 does not exist when using UPDATE this is what is answerd by Orion:

<updateContextResponse>
    <contextResponseList>
        <contextElementResponse>
            <contextElement>
                <entityId type="Floor" isPattern="false">
                    <id>Floor3</id>
                </entityId>
                <contextAttributeList>
                    <contextAttribute>
                        <name>temperature</name>
                        <type>double</type>
                        <contextValue></contextValue>
                    </contextAttribute>
                </contextAttributeList>
            </contextElement>
            <statusCode>
                <code>404</code>
                <reasonPhrase>No context element found</reasonPhrase>
                <details>Floor3</details>
            </statusCode>
        </contextElementResponse>
    </contextResponseList>
</updateContextResponse>

from fiware-cepheus.

manubaum avatar manubaum commented on June 12, 2024

Hi Mark. Thanks for the hint with the UPDATE/APPEND. With the latest cepheus we see it working now. Also thanks for the hint reg. http status 200/400. Regarding the orion Error tag, we just opened an issue reg. that: telefonicaid/fiware-orion#1500

from fiware-cepheus.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.