SES-WNS-Translator parsing failed

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

SES-WNS-Translator parsing failed

Chenfeng
I have installed SES(1.2.2), SES-WNS-Translator(1.1.2) and WNS(2.1.2) successful.
and the translator can connecte SES and WNS well.

This is what I have set in the config file of the Translator:

wns_url = http://localhost:8080/wns-master/wns;
ses_version = 1.2.2;
ses_url = http://localhost:8080/52n-ses-1.2.2/services/Broker

When I subscribe on SES side, I have set the customer reference to "http://localhost:8080/52n-notification-translator-1.1.2/translate"

But when I do an operation on the SES side, on SES customer  endpoint I can received notification successful via the tool SimpleWSNConsumer, but when i check the logs of the Translator and WNS, there are some errors, the Translator cannot parsing something.

This is the file I send to SES in order to do the Notify operation:
<?xml version="1.0" encoding="UTF-8"?>
<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope" xmlns:wsa="http://www.w3.org/2005/08/addressing" xmlns:wsnt="http://docs.oasis-open.org/wsn/b-2">
    <soap:Header>
        <wsa:To>http://localhost:8080/52n-ses-1.2.2/services/Broker</wsa:To>
        <wsa:Action>http://docs.oasis-open.org/wsn/bw-2/NotificationConsumer/Notify</wsa:Action>
        <wsa:MessageID>uuid:1b4d3025-f80a-a5b6-aa37-864c47fa1a7e</wsa:MessageID>
        <wsa:From>
            <wsa:Address>http://www.w3.org/2005/08/addressing/role/anonymous</wsa:Address>
        </wsa:From>
    </soap:Header>
    <soap:Body>
        <wsnt:Notify>
            <wsnt:NotificationMessage>
                <wsnt:Topic xmlns:sestopic="http://www.opengis.net/ses/topics" Dialect="http://docs.oasis-open.org/wsn/t-1/TopicExpression/Simple"> 
        sestopic:Measurements
                </wsnt:Topic>
                <wsnt:Message>
                        <om:Observation gml:id="oc2109"
                                xmlns:gml="http://www.opengis.net/gml"
                                xmlns:om="http://www.opengis.net/om/1.0"
                                xmlns:sa="http://www.opengis.net/sampling/1.0"
                                xmlns:swe="http://www.opengis.net/swe/1.0.1"
                                xmlns:xlink="http://www.w3.org/1999/xlink"
                                xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.opengis.net/om/1.0 http://schemas.opengis.net/om/1.0.0/om.xsd http://www.opengis.net/sampling/1.0 http://schemas.opengis.net/sampling/1.0.0/sampling.xsd">
                                <om:samplingTime>
                                        <gml:TimePeriod xsi:type="gml:TimePeriodType">
                                                <gml:beginPosition>2007-08-30T01:00:00+02:00</gml:beginPosition>
                                                <gml:endPosition>2007-08-30T23:00:00+02:00</gml:endPosition>
                                        </gml:TimePeriod>
                                </om:samplingTime>
                                <om:procedure xlink:href="urn:ogc:object:feature:Sensor:IFGI:dummysensor1"/>
                                <om:observedProperty>
                                        <swe:CompositePhenomenon dimension="1" gml:id="cpid0">
                                                <gml:name>resultComponents</gml:name>
                                                <swe:component xlink:href="urn:ogc:def:phenomenon:OGC:1.0.30:temperature"/>
                                        </swe:CompositePhenomenon>
                                </om:observedProperty>
                                <om:featureOfInterest>
                                        <gml:FeatureCollection>
                                                <gml:featureMember>
                                                        <sa:SamplingPoint gml:id="IFGI_d1">
                                                                <gml:name>IFGI dummysensor1</gml:name>
                                                                <sa:sampledFeature xlink:href=""/>
                                                                <sa:position>
                                                                        <gml:Point>
                                                                                <gml:pos srsName="urn:ogc:crs:epsg:4326">10.0 10.0</gml:pos>
                                                                        </gml:Point>
                                                                </sa:position>
                                                        </sa:SamplingPoint>
                                                </gml:featureMember>
                                        </gml:FeatureCollection>
                                </om:featureOfInterest>
                                <om:result>

                                        <swe:Quantity definition="urn:ogc:def:phenomenon:OGC:1.0.30:temperature">
                                                <swe:uom code="[degF]"/>
                                                <swe:value>87.9</swe:value>
                                        </swe:Quantity>

                                </om:result>
                        </om:Observation>
                </wsnt:Message>       
        </wsnt:NotificationMessage>
</wsnt:Notify>
</soap:Body>
</soap:Envelope>


This is the logs in Translator:

2017-08-07 12:33:47,175 DEBUG [http-nio-8080-exec-8] [RequestHandler.java:193] 1 Begin: Extraction of message element
2017-08-07 12:33:47,176 DEBUG [http-nio-8080-exec-8] [RequestHandler.java:200] 1 Extracted notify element
2017-08-07 12:33:47,176 DEBUG [http-nio-8080-exec-8] [RequestHandler.java:218] 1 Begin: Creating Service Description
2017-08-07 12:33:47,176 DEBUG [http-nio-8080-exec-8] [RequestHandler.java:239] 1 Begin: Creating Notify Message for WNS
2017-08-07 12:33:47,177 DEBUG [http-nio-8080-exec-8] [RequestHandler.java:249] 1 Begin: Parsing of EML document
2017-08-07 12:33:47,506 ERROR [http-nio-8080-exec-8] [RequestHandler.java:484] 1 Problems while parsing XML :Element Observation@http://www.opengis.net/om/1.0 is not a valid DerivedEvent@http://www.opengis.net/em/0.2.0 document or a valid substitution.
org.apache.xmlbeans.XmlException: Element Observation@http://www.opengis.net/om/1.0 is not a valid DerivedEvent@http://www.opengis.net/em/0.2.0 document or a valid substitution.
        at org.apache.xmlbeans.impl.store.Locale.autoTypeDocument(Locale.java:328) ~[xmlbeans-2.5.0.jar:na]
        at org.apache.xmlbeans.impl.store.Locale.parse(Locale.java:715) ~[xmlbeans-2.5.0.jar:na]
        at org.apache.xmlbeans.impl.store.Locale.parseToXmlObject(Locale.java:696) ~[xmlbeans-2.5.0.jar:na]
        at org.apache.xmlbeans.impl.store.Locale.parseToXmlObject(Locale.java:683) ~[xmlbeans-2.5.0.jar:na]
        at org.apache.xmlbeans.impl.schema.SchemaTypeLoaderBase.parse(SchemaTypeLoaderBase.java:208) ~[xmlbeans-2.5.0.jar:na]
        at net.opengis.em.x020.DerivedEventDocument$Factory.parse(DerivedEventDocument.java:52) ~[52n-xml-em-v020-1.1.4.jar:1.1.4]
        at org.n52.sensorweb.sesWnsTranslator.RequestHandler.buildWNSNotifyMessage(RequestHandler.java:250) ~[classes/:na]
        at org.n52.sensorweb.sesWnsTranslator.Translator.doPost(Translator.java:123) [classes/:na]
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:661) [servlet-api.jar:na]
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:742) [servlet-api.jar:na]
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:231) [catalina.jar:8.5.16]
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) [catalina.jar:8.5.16]
        at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52) [tomcat-websocket.jar:8.5.16]
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) [catalina.jar:8.5.16]
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) [catalina.jar:8.5.16]
        at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:198) [catalina.jar:8.5.16]
        at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96) [catalina.jar:8.5.16]
        at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:478) [catalina.jar:8.5.16]
        at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:140) [catalina.jar:8.5.16]
        at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:80) [catalina.jar:8.5.16]
        at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:624) [catalina.jar:8.5.16]
        at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:87) [catalina.jar:8.5.16]
        at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:342) [catalina.jar:8.5.16]
        at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:799) [tomcat-coyote.jar:8.5.16]
        at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66) [tomcat-coyote.jar:8.5.16]
        at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:868) [tomcat-coyote.jar:8.5.16]
        at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1455) [tomcat-coyote.jar:8.5.16]
        at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49) [tomcat-coyote.jar:8.5.16]
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [na:1.8.0_144]
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [na:1.8.0_144]
        at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) [tomcat-util.jar:8.5.16]
        at java.lang.Thread.run(Thread.java:748) [na:1.8.0_144]
2017-08-07 12:33:47,507 DEBUG [http-nio-8080-exec-8] [RequestHandler.java:618] 1 Begin: Send Notify Message to WNS: http://localhost:8080/wns-master/wns
2017-08-07 12:33:47,565 DEBUG [http-nio-8080-exec-8] [RequestHandler.java:160] 1 Begin: Creating anonymous response
2017-08-07 12:33:47,565 DEBUG [http-nio-8080-exec-8] [Translator.java:143] 1 ContentType: text/xml;charset=ISO-8859-1
2017-08-07 12:33:47,566 DEBUG [http-nio-8080-exec-8] [Translator.java:144] 1 Response Buffersize: 8192
2017-08-07 12:33:47,567 INFO [http-nio-8080-exec-8] [Translator.java:148] 1 Finished request handling.

This is the logs in WNS:

2017-08-07 12:33:47,535 ERROR [http-nio-8080-exec-9] [WNSRequestHandler.java:800] org.n52.wns.WNSServiceException: <ExceptionReport language="en" version="1.0.0" xmlns="http://www.opengis.net/ows">
  <Exception exceptionCode="InvalidRequest" locator="">
    <ExceptionText>Your request was invalid. Examine locator-element for more details.</ExceptionText>
  </Exception>
</ExceptionReport>
org.n52.wns.WNSServiceException: <ExceptionReport language="en" version="1.0.0" xmlns="http://www.opengis.net/ows">
  <Exception exceptionCode="InvalidRequest" locator="">
    <ExceptionText>Your request was invalid. Examine locator-element for more details.</ExceptionText>
  </Exception>
</ExceptionReport>
        at org.n52.wns.WNSRequestHandler.createInvalidRequestException(WNSRequestHandler.java:815) ~[classes/:na]
        at org.n52.wns.WNSRequestHandler.handlePostRequest(WNSRequestHandler.java:661) ~[classes/:na]
        at org.n52.wns.WNS.doPost(WNS.java:224) [classes/:na]
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:661) [servlet-api.jar:na]
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:742) [servlet-api.jar:na]
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:231) [catalina.jar:8.5.16]
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) [catalina.jar:8.5.16]
        at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52) [tomcat-websocket.jar:8.5.16]
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) [catalina.jar:8.5.16]
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) [catalina.jar:8.5.16]
        at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:198) [catalina.jar:8.5.16]
        at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96) [catalina.jar:8.5.16]
        at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:478) [catalina.jar:8.5.16]
        at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:140) [catalina.jar:8.5.16]
        at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:80) [catalina.jar:8.5.16]
        at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:624) [catalina.jar:8.5.16]
        at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:87) [catalina.jar:8.5.16]
        at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:342) [catalina.jar:8.5.16]
        at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:799) [tomcat-coyote.jar:8.5.16]
        at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66) [tomcat-coyote.jar:8.5.16]
        at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:868) [tomcat-coyote.jar:8.5.16]
        at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1455) [tomcat-coyote.jar:8.5.16]
        at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49) [tomcat-coyote.jar:8.5.16]
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [na:1.8.0_144]
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [na:1.8.0_144]
        at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) [tomcat-util.jar:8.5.16]
        at java.lang.Thread.run(Thread.java:748) [na:1.8.0_144]
2017-08-07 12:33:47,537 DEBUG [http-nio-8080-exec-9] [WNSUtil.java:110] Trying to send response
2017-08-07 12:33:47,545 DEBUG [http-nio-8080-exec-9] [WNSUtil.java:135] Successfully send response
2017-08-07 12:53:02,833 INFO [Thread-29] [WNSDatabaseThread.java:128] No messages stored, so no checking is needed