-
Notifications
You must be signed in to change notification settings - Fork 40
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
namespace problem in the SoapParser of Core #210
Comments
Thanks for reporting this issue. Can you please provide us capability URL to reproduce this issue. I have tried with the following URL: http://sensorweb.demo.52north.org/52n-sos-webapp/service/kvp But it failing immediately with soap request. It would be great if you provide us steps to reproduce this issue. I have a query with the following screenshots: Thank you. |
I have executed the sos20 test with the following capability URL: The SOS test failing with the two tests. TestResult 1. sos:GRTRequestValidRequest_resultRetrieval Cause: The prefix (soap12) is not able to resolve from the XPath and not able to get the expected value. XPath:
Response:
Cause: This test failed due to the XPath: Request:
Response with highlighted part: Only two tests are failing but I am not able to reproduce the same issue that you have reported. It will be great if you provide steps to reproduce this issue, so we can figure out the exact issue let me know your thought on above test failures. Thank you!!! |
@keshav-nangare
<?xml version="1.0" encoding="UTF-8"?>
<env:Envelope
xmlns:ns="http://www.opengis.net/gml/3.2"
xmlns:env="http://www.w3.org/2003/05/soap-envelope"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.w3.org/2003/05/soap-envelope http://www.w3.org/2003/05/soap-envelope/soap-envelope.xsd">
<env:Body>
<sos:GetObservation service="SOS" version="2.0.0" xmlns:sos="http://www.opengis.net/sos/2.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.w3.org/2003/05/soap-envelope http://www.w3.org/2003/05/soap-envelope/soap-envelope.xsd
http://www.opengis.net/sos/2.0 http://schemas.opengis.net/sos/2.0/sos.xsd"
xmlns:soap12="http://www.w3.org/2003/05/soap-envelope" ></sos:GetObservation>
</env:Body>
</env:Envelope>
<?xml version="1.0" encoding="UTF-8"?>
<sos:GetObservationResponse
xmlns:sos="http://www.opengis.net/sos/2.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:om="http://www.opengis.net/om/2.0"
xmlns:gml="http://www.opengis.net/gml/3.2"
xmlns:xlink="http://www.w3.org/1999/xlink" xsi:schemaLocation="http://www.opengis.net/sos/2.0 http://schemas.opengis.net/sos/2.0/sosGetObservation.xsd http://www.opengis.net/gml/3.2 http://schemas.opengis.net/gml/3.2.1/gml.xsd http://www.opengis.net/om/2.0 http://schemas.opengis.net/om/2.0/observation.xsd">
<sos:observationData>
<om:OM_Observation gml:id="o_119F914A8F8F1E1F6025756E9F3D63BBBA50AA9E">
<om:type xlink:href="http://www.opengis.net/def/observationType/OGC-OM/2.0/OM_CountObservation"/>
<om:phenomenonTime>
<gml:TimeInstant gml:id="phenomenonTime_442">
<gml:timePosition>2016-11-19T17:45:15.000Z</gml:timePosition>
</gml:TimeInstant>
</om:phenomenonTime>
<om:resultTime xlink:href="#phenomenonTime_442"/>
<om:procedure xlink:href="http://www.52north.org/test/procedure/9"/>
<om:observedProperty xlink:href="http://www.52north.org/test/observableProperty/9_2"/>
<om:featureOfInterest xlink:href="http://www.52north.org/test/featureOfInterest/9"/>
<om:result
xmlns:xs="http://www.w3.org/2001/XMLSchema" xsi:type="xs:integer">3
</om:result>
</om:OM_Observation>
</sos:observationData>
<sos:observationData>
<om:OM_Observation gml:id="o_4BB6C4F47B7985BE4144BA98AECB84014AF92826">
<om:phenomenonTime>
<gml:TimeInstant gml:id="phenomenonTime_441">
<gml:timePosition>2012-11-19T17:45:15.000Z</gml:timePosition>
</gml:TimeInstant>
</om:phenomenonTime>
<om:resultTime xlink:href="#phenomenonTime_441"/>
<om:procedure xlink:href="http://www.52north.org/test/procedure/9"/>
<om:observedProperty xlink:href="http://www.52north.org/test/observableProperty/9_2"/>
<om:featureOfInterest xlink:href="http://www.52north.org/test/featureOfInterest/9"/>
<om:result
xmlns:xs="http://www.w3.org/2001/XMLSchema" xsi:type="xs:integer">3
</om:result>
</om:OM_Observation>
</sos:observationData>
<sos:observationData>
<om:OM_Observation gml:id="o_5C2D4B29FDA1639D63152D9B91F5AB1120BFB739">
<gml:description>test description for this observation</gml:description>
<gml:identifier codeSpace="http://www.opengis.net/def/nil/OGC/0/unknown">http:/www.tsuruoka-nct.ac.jp/test/observation/0</gml:identifier>
<om:type xlink:href="http://www.opengis.net/def/observationType/OGC-OM/2.0/OM_Measurement"/>
<om:phenomenonTime>
<gml:TimeInstant gml:id="phenomenonTime_430">
<gml:timePosition>2012-11-19T17:45:15.000Z</gml:timePosition>
</gml:TimeInstant>
</om:phenomenonTime>
<om:resultTime xlink:href="#phenomenonTime_430"/>
<om:procedure xlink:href="http://www.tsuruoka-nct.ac.jp/test/procedure/0"/>
<om:observedProperty xlink:href="http://www.tsuruoka-nct.ac.jp/test/observableProperty/Temperature"/>
<om:featureOfInterest xlink:href="http://www.52north.org/test/featureOfInterest/9"/>
<om:result
xmlns:ns="http://www.opengis.net/gml/3.2" uom="test_unit_9_3" xsi:type="ns:MeasureType">0.28
</om:result>
</om:OM_Observation>
</sos:observationData>
</sos:GetObservationResponse> |
@epicureanism Thanks for the details. I will try to reproduce this issue. |
@keshav-nangare, The response body is valid. We might need to find where in TE the validation is occurring for further debugging. Is the ns:MeasureType that is causing the problem.
|
@keshav-nangare Can you please do further investigation? |
I did some workaround and found the root cause. This issue is occurring due to the schema document of the SoapParser. The response is validated with the soap12.xsd and we get the following error:
|
@keshav-nangare As epicureanism already describes in the first comment, the error probably derives from SoapParser not being able to handle the inline namespace declaration. In this case, the |
Yes. I have validated the response and succeded but if we try to validate with the SoapParser schema then the ns prefix error is getting. Here is the SoapParserSchema |
MeasureType is defined in basicTypes.xsd. The SOAP Envelope example imports gml.xsd. However, The solution is to import gmlBase.xsd because it includes both |
@keshav-nangare Please replace http://schemas.opengis.net/gml/3.2.1/gml.xsd with http://schemas.opengis.net/gml/3.2.1/basicTypes.xsd in the test file (https://raw.githubusercontent.com/opengeospatial/ets-sos20/master/src/main/resources/sos-soap-response-demo.xml) and check if it passes the test suite, then. |
I implemented the JUnit test for SoapParser and tried with the above comment variations but it is still failing with the same validation error mentioned in the comment. |
I have added the JUnit test for SoapParser. Please find the changes in #467 PR. |
We have a simple SOS 2.0 test via SOAP, the testing endpoints and request body were saved as the POSTMAN collection which can be imported to see the req/res body:
https://www.getpostman.com/collections/e72b39d08ff37f1e4e0b
This problem was originally produced from
SOS 2.0 Test Suite GetObservation-Test fail for SOAP.
After some detail investigations, this problem might be redirected to the SoapParser which can't handle the inline namespace declaration.
The response body can be validated using other tools without any problem.
But the teamegine reports there is an error for the unrecognized namespace which was defined inline in the soap body, the response is like the following image:
https://github.com/opengeospatial/ets-sos20/blob/master/src/site/resources/img/soap-response-error-desc.png
the xml as well:
https://raw.githubusercontent.com/opengeospatial/ets-sos20/master/src/main/resources/sos-soap-response-demo.xml
The gml namespace was declared in line 6 and again in the om:result (line 26), but in line 28, the namespace was ignored by the SoapParser which causes the error.
In the other hand, the XmlValidatingParser works well without the same problem if there is no Soap wrapper for the response body. So we think it might be the problem from the SoapParser.
The text was updated successfully, but these errors were encountered: