Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

QueryParameter.FieldName 'System.IndexOutOfRangeException' #496

Closed
yvdh opened this issue Mar 13, 2024 · 3 comments · Fixed by #500
Closed

QueryParameter.FieldName 'System.IndexOutOfRangeException' #496

yvdh opened this issue Mar 13, 2024 · 3 comments · Fixed by #500
Assignees

Comments

@yvdh
Copy link

yvdh commented Mar 13, 2024

Hello,

Really great work on this EPCIS 1.x - 2.0 project! We are looking into using this project as our EPCIS repository.

So far I have added our own security model (role based) and swagger to your code, and I am hosting on IIS. All quite straightforward.
The SOAP XML 1.2 interfaces seem to work quite well in PostMan (Query, Capture and Subscriptions tested).

However, when performing queries in the REST-JSON interface (EPCIS 2.0) I get 'System.IndexOutOfRangeException' on parameters like GE_errorDeclarationTime. Looking a the code for the FieldName extension of QueryParameter this seems logical:

public static string FieldName(this QueryParameter parameter) => parameter.Name.Split('_')[1].Split('#')[1];

'GE_errorDeclarationTime' contains no '#' so this has to fail ...

This seems to occur for any LT_ or GE_ query parameter.
The same parameters do work in SOAP-XML (which does not use the same methods, right?).

Is this a bug or am I missing something?

Cheers
Yves

@louisaxel-ambroise louisaxel-ambroise self-assigned this Mar 14, 2024
@louisaxel-ambroise
Copy link
Owner

Hi @yvdh,

Thanks for opening this ticket.
It looks like these errorDeclarationTime parameters were omitted in the query handler. I'll add them as soon as possible.

The v1 and v2 queries are handled in the exact same way, so if you run this SOAP query you should also get an error:

<?xml version="1.0" encoding="UTF-8"?>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:urn="urn:epcglobal:epcis-query:xsd:1">
  <soapenv:Body>
    <urn:Poll>
      <queryName>SimpleEventQuery</queryName>
      <params>
        <param>
          <name>GE_errorDeclarationTime</name>
          <value>2018-04-01T10:21:10.521Z</value>
        </param>
      </params>
    </urn:Poll>
  </soapenv:Body>
</soapenv:Envelope>

Did you also receive this exception with other standard parameters and if so do you remember which ones?

Thanks!

@yvdh
Copy link
Author

yvdh commented Mar 14, 2024

Hi,

you are right, it also fails with the SOAP query you provided:

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:epcisq="urn:epcglobal:epcis-query:xsd:1" xmlns:xsd="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsi="http://www.w3.org/2001/XMLSchema">
soapenv:Body
epcisq:ImplementationException
Error
</epcisq:ImplementationException>
</soapenv:Body>
</soapenv:Envelope>

I tried with a 'GE_eventTime' parameter, and that seems to work, both in SOAP and in JSON.

Cheers
Yves

@louisaxel-ambroise
Copy link
Owner

Hi,

These parameters are now available in the main branch for both 1.x and 2.0 versions.

Thanks again for raising this ticket!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants