Opened 5 years ago

Closed 2 years ago

#102 closed defect (fixed)

Petascope WCPS form processing (Java XML parser) has error.

Reported by: jpass@… Owned by: nkolev
Priority: minor Milestone: 9.0.x
Component: petascope Version: 8.3
Keywords: WCPS ProcessCoveragesRequest Cc: pbaumann, dmisev
Complexity: Medium

Description

I note that when I try to run an XML-POST ProcessCoveragesRequest? through our wcps test page http://earthserver.bgs.ac.uk/petascopeWCPS.html (equivalent to http://localhost:8080/petascope/wcps) using the XML POST form OR the XML File upload (as either xmlSyntax or abstractSyntax) then I get error:

<ows:ExceptionReport version="2.0.0" xsd:schemaLocation="http://www.opengis.net/ows/2.0 http://schemas.opengis.net/ows/2.0/owsExceptionReport.xsd" xmlns:ows="http://www.opengis.net/ows/2.0" xmlns:xsd="http://www.w3.org/2001/XMLSchema-instance" xmlns:xlink="http://www.w3.org/1999/xlink">
<ows:Exception exceptionCode="XmlNotValid">
<ows:ExceptionText>
Content is not allowed in prolog.
</ows:ExceptionText>
</ows:Exception>
</ows:ExceptionReport>

If I take the same XML and use Fiddler to post the same request to our service (http://earthserver.bgs.ac.uk/petascope?) I get the expected results

E.g. These requests work in Fiddler:

<?xml version="1.0" encoding="UTF-8"?>
<ProcessCoveragesRequest service="WCS" version="1.0.0"
 xmlns="http://www.opengis.net/wcps/1.0 http://schemas.opengis.net/wcps/1.0/wcpsProcessCoverages.xsd">
<query>
<xmlSyntax>
<coverageIterator>
<iteratorVar>c</iteratorVar>
<coverageName>NIR</coverageName>
</coverageIterator>
<encode store="false">
<trim>
<coverage>c</coverage>
<axis>x</axis>
<lowerBound><numericConstant>0</numericConstant></lowerBound><upperBound><numericConstant>450</numericConstant></upperBound>
<axis>y</axis>
<lowerBound><numericConstant>0</numericConstant></lowerBound><upperBound><numericConstant>300</numericConstant></upperBound>
</trim>
<format>png</format>
</encode>
</xmlSyntax>
</query>
</ProcessCoveragesRequest>

and

<?xml version="1.0" encoding="UTF-8"?>
<ProcessCoveragesRequest service="WCS" version="1.0.0"
 xmlns="http://www.opengis.net/wcps/1.0 http://schemas.opengis.net/wcps/1.0/wcpsProcessCoverages.xsd">
<query>
<abstractSyntax>
for c in (bgs_rs)
return
encode(
        (char) ( ((c.red / (c.red + c.blue))
                 -(c.blue / (c.red + c.blue)))
        > 0.6 ) * 255,
       "png" )
</abstractSyntax>
</query>
</ProcessCoveragesRequest>

Our form starts:

<form action="http://earthserver.bgs.ac.uk/petascope?" method="post" id="pPCxml">
<fieldset><legend>XML POST REQUEST (using xmlSyntax)</legend>
<textarea cols="85" rows="26" id="xml" name="xml"><?xml version="1.0" encoding="UTF-8"?>
<ProcessCoveragesRequest service="WCS" version="1.0.0"
 xmlns="http://www.opengis.net/wcps/1.0 http://schemas.opengis.net/wcps/1.0/wcpsProcessCoverages.xsd">
<query>
<xmlSyntax>

i.e. There doesn't appear to be any character before the xml declaration, so this issue seems to be an artifact of the XML parser and not the form...

Change History (23)

comment:1 Changed 5 years ago by dmisev

  • Cc pbaumann added
  • Owner changed from dmisev to erodriguez
  • Status changed from new to assigned

comment:2 Changed 4 years ago by pbaumann

  • Milestone set to 8.4
  • Owner changed from erodriguez to pcampalani
  • Version set to 8.3

comment:3 Changed 4 years ago by pcampalani

I cannot reproduce the error: I am checking this against a sample XML query in our WCPS test suite (<rasdaman>/systemtest/testcases_petascope/test_wcps/queries/*.xml) and both file upload and query pasting work fine here.

@jpass: sorry, it seems this ticket got lost in the stack. Can you please check again the status?

comment:4 Changed 4 years ago by pcampalani

  • Resolution set to worksforme
  • Status changed from assigned to closed

resolving the ticket as worksforme: please James re-open it if the issue persists.

comment:5 Changed 4 years ago by jpass@…

In the BGS lighthouse application we are using the following rasdaman packages:

rasdaman-devel-8.3.1-0.el6.x86_64
rasdaman-debuginfo-8.3.1-0.el6.x86_64
rasdaman-examples-8.3.1-0.el6.x86_64
rasdaman-8.3.1-0.el6.x86_64
rasdaman-petascope-8.3.1-0.el6.x86_64
rasdaman-rasgeo-8.3.1-0.el6.x86_64
rasdaman-docs-8.3.1-0.el6.x86_64
rasdaman-rasdaview-8.3.1-0.el6.x86_64

On this implementation the error as described still occurs (our test page still exists we just moved it to a different location) see http://earthserver.bgs.ac.uk/issues/petascopeWCPS.html to replicate the error reported...

Please reopen the ticket (I tried doing this myself but don't have permission), until I can verify that the issue is resolved.

Thanks

comment:6 Changed 4 years ago by dmisev

  • Milestone changed from 8.4 to 8.5
  • Resolution worksforme deleted
  • Status changed from closed to reopened

Those packages look ancient :) Anyway, I reopen the ticket.

comment:7 Changed 4 years ago by dmisev

You can probably reopen yourself by registering on the trac btw.

comment:8 Changed 4 years ago by jpass

If you are saying that this issue has been resolved (by some active coding, or other active changes) between our ancient packages and the new packages, then please mark the issue as resolved. We are waiting for the next stable release before we update our packages, so we will not be able to test the issue is resolved until that time. If on the other hand you are saying that you have never been able to reproduce this error, and that no active coding etc has occurred to resolve the issue, then the issue should remain open.

comment:9 Changed 4 years ago by dmisev

Let's just wait for the RPM update and then come back to this ticket.

comment:10 Changed 4 years ago by pcampalani

  • Complexity set to Very Hard

The issue is still there with rasdaman 8.4.1 RPMs.

comment:11 Changed 4 years ago by pcampalani

  • Complexity changed from Very Hard to Medium

comment:12 Changed 4 years ago by mase

I've done some further testing with v8.4.1 RPMs and copying the <form> elements that are given in the query test pages as supplied by the rasdaman software at /petascope and /petascope/wcps

It seems I get the correct responses if I use the form

<form action="/petascope/wcps" method="post">
	<textarea cols="64" rows="16" name="xml"></textarea>
	<input value="Send" type="submit">
</form>

or

    <form action="/petascope" method="post">
        <textarea cols="64" rows="16" name="request"></textarea>
        <input value="Send" type="submit" />
    </form>

and the problem only occurs using the form

    <form action="/petascope" method="post">
    <textarea cols="64" rows="16" name="xml"></textarea>
    <input value="Send" type="submit" />
    </form>

So maybe the original error was just because the textarea was given the name "xml" when posting to the /petascope endpoint when that endpoint is expecting a parameter called "request" and it is the /petascope/wcps endpoint that expects a parameter called "xml".

So I'm inclined to close this as we can create forms which work but really the error should say something about missing/wrong form parameter rather than the obscure error in prolog message. Are the expected form parameters documented? I suppose the standard would be to directly POST the xml in the message body but it is useful to be able to put it in an HTML form for test requests as well.

comment:13 Changed 4 years ago by pcampalani

  • Cc dmisev added

comment:14 follow-up: Changed 4 years ago by dmisev

  • Milestone changed from 8.5 to 8.5.1
  • Owner changed from pcampalani to nkolev
  • Status changed from reopened to assigned

Nikolche, this should be fixed in PetascopeInterface?, if the post parameter is not "request" then an appropriate error should be thrown, e.g. "Expected POST parameter 'request', got 'BadParam?'"

comment:15 in reply to: ↑ 14 Changed 4 years ago by j.yu

Replying to dmisev:

Nikolche, this should be fixed in PetascopeInterface?, if the post parameter is not "request" then an appropriate error should be thrown, e.g. "Expected POST parameter 'request', got 'BadParam?'"

The post "request" parameter should only work for WCPS and not effect WCS. Otherwise, WCS Post 1.0 will fail the test.

comment:16 Changed 3 years ago by pbaumann

what's the status of this?

comment:17 Changed 3 years ago by pcampalani

I don't know if Nikolche could investigate this, but I still cannot reproduce the error, this works fine here:

<?xml version="1.0" encoding="UTF-8"?>
<ProcessCoveragesRequest service="WCS" version="1.0.0"
 xmlns="http://www.opengis.net/wcps/1.0 http://schemas.opengis.net/wcps/1.0/wcpsProcessCoverages.xsd">
  <query>
    <xmlSyntax>
      <coverageIterator>
        <iteratorVar>c</iteratorVar>
        <coverageName>mr</coverageName>
      </coverageIterator>
      <encode store="false">
        <trim>
          <coverage>c</coverage>
          <axis>i</axis>
          <lowerBound>
            <numericConstant>0</numericConstant>
          </lowerBound>
          <upperBound>
            <numericConstant>200</numericConstant>
          </upperBound>
          <axis>j</axis>
          <lowerBound>
            <numericConstant>0</numericConstant> 
          </lowerBound>
          <upperBound>
            <numericConstant>300</numericConstant>
          </upperBound>
        </trim>
        <format>png</format>
      </encode>
    </xmlSyntax>
  </query>
</ProcessCoveragesRequest>

comment:18 Changed 3 years ago by pcampalani

As far as I understood, the XML protocol is going to be removed from WCPS in Petascope. Is it still true and is it going to happen for WCS protocols as well?

comment:19 Changed 3 years ago by pbaumann

  • WCPS, yes XML encoding will not be in next version - nobody wants it / uses it
  • WCS: the XML/POST extension will stay and is a valid choice.

comment:20 Changed 3 years ago by nkolev

I had submitted a patch, that I think fixes this,it should now work with both query/request (I don't know the reason why, at different end-points different names were used, while it's actually the same thing). At the time trac was down so the status was not changed.
Did j.yu get a problem with my patch or?
I cannot reproduce any problems now.

comment:21 Changed 3 years ago by pcampalani

I see, there are two patches for this ticket that you made:

None of those were applied tp release_8.5 branch, but here it works just as well.
I used the query in comment:17, but correcting the axes labels:

---       <axis>i</axis>
+++       <axis>x</axis>
---       <axis>j</axis>
+++       <axis>y</axis>

James, please let us know when you can check this, thanks.

comment:22 Changed 3 years ago by dmisev

Comment from James:

We're still on the rasdaman-8.4.3-1 rpm, so I can't test at the moment.

comment:23 Changed 2 years ago by dmisev

  • Resolution set to fixed
  • Status changed from assigned to closed

This is very old, I assume it's been fixed by now (reopen if it hasn't).

Note: See TracTickets for help on using tickets.