Opened 13 years ago

Closed 10 years ago

#102 closed defect (fixed)

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

Reported by: jpass@… Owned by: Nikolche Kolev
Priority: minor Milestone: 9.0.x
Component: petascope Version: 8.3
Keywords: WCPS ProcessCoveragesRequest Cc: Peter Baumann, Dimitar Misev
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 by Dimitar Misev, 12 years ago

Cc: Peter Baumann added
Owner: changed from Dimitar Misev to Ernesto Rodriguez
Status: newassigned

comment:2 by Peter Baumann, 12 years ago

Milestone: 8.4
Owner: changed from Ernesto Rodriguez to Piero Campalani
Version: 8.3

comment:3 by Piero Campalani, 12 years ago

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 by Piero Campalani, 12 years ago

Resolution: worksforme
Status: assignedclosed

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

comment:5 by jpass@…, 12 years ago

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 by Dimitar Misev, 12 years ago

Milestone: 8.48.5
Resolution: worksforme
Status: closedreopened

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

comment:7 by Dimitar Misev, 12 years ago

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

comment:8 by James Passmore, 12 years ago

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 by Dimitar Misev, 12 years ago

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

comment:10 by Piero Campalani, 12 years ago

Complexity: Very Hard

The issue is still there with rasdaman 8.4.1 RPMs.

comment:11 by Piero Campalani, 12 years ago

Complexity: Very HardMedium

comment:12 by Marcus Sen, 11 years ago

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 by Piero Campalani, 11 years ago

Cc: Dimitar Misev added

comment:14 by Dimitar Misev, 11 years ago

Milestone: 8.58.5.1
Owner: changed from Piero Campalani to Nikolche Kolev
Status: reopenedassigned

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

in reply to:  14 comment:15 by Jinsongdi Yu, 11 years ago

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 by Peter Baumann, 11 years ago

what's the status of this?

comment:17 by Piero Campalani, 11 years ago

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 by Piero Campalani, 11 years ago

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 by Peter Baumann, 11 years ago

  • 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 by Nikolche Kolev, 11 years ago

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 by Piero Campalani, 11 years ago

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 by Dimitar Misev, 11 years ago

Comment from James:

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

comment:23 by Dimitar Misev, 10 years ago

Resolution: fixed
Status: assignedclosed

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.