A tutorial on sending a post request via Java to a service can be found here. The first example using the HttpURLConnection is recommended as it does not rely on the Apache framework
There is a solid tutorial here on use of a generic AJAX method for sending a get/post request using vanilla JS.
https://data.oceannetworks.ca/sos?service=SOS
https://data.oceannetworks.ca/sos?service=SOS&request=GetCapabilities
<?xml version="1.0" encoding="UTF-8"?> <GetCapabilities xmlns="http://www.opengis.net/sos/1.0" xmlns:ows="http://www.opengis.net/ows/1.1" xmlns:ogc="http://www.opengis.net/ogc" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.opengis.net/sos/1.0 http://schemas.opengis.net/sos/1.0.0/sosGetCapabilities.xsd" service="SOS"> <ows:AcceptVersions> <ows:Version>1.0.0</ows:Version> </ows:AcceptVersions> <ows:Sections> <ows:Section>ServiceIdentification</ows:Section> <ows:Section>ServiceProvider</ows:Section> <ows:Section>OperationsMetadata</ows:Section> <ows:Section>Filter_Capabilities</ows:Section> <ows:Section>Contents</ows:Section> </ows:Sections> </GetCapabilities> |
<?xml version="1.0" encoding="UTF-8"?> <DescribeSensor version="1.0.0" service="SOS" xmlns="http://www.opengis.net/sos/1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.opengis.net/sos/1.0 http://schemas.opengis.net/sos/1.0.0/sosDescribeSensor.xsd" outputFormat="text/xml;subtype="sensorML/1.0.1""> <procedure>urn:ogc:def:platform:BACVP</procedure> </DescribeSensor> |
<?xml version="1.0" encoding="UTF-8"?> <GetObservation xmlns="http://www.opengis.net/sos/1.0" xmlns:ows="http://www.opengis.net/ows/1.1" xmlns:gml="http://www.opengis.net/gml" xmlns:ogc="http://www.opengis.net/ogc" xmlns:om="http://www.opengis.net/om/1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.opengis.net/sos/1.0 http://schemas.opengis.net/sos/1.0.0/sosGetObservation.xsd" service="SOS" version="1.0.0" srsName="urn:ogc:def:crs:EPSG::4326"> <offering>OfferingBACVP</offering> <eventTime> <ogc:TM_During> <ogc:PropertyName>om:samplingTime</ogc:PropertyName> <gml:TimePeriod> <gml:beginPosition>2009-09-15T02:37:30.000Z</gml:beginPosition> <gml:endPosition>2009-09-15T02:37:40.000Z</gml:endPosition> </gml:TimePeriod> </ogc:TM_During> </eventTime> <observedProperty>urn:ogc:def:phenomenon:chlorophyll</observedProperty> <observedProperty>urn:ogc:def:phenomenon:conductivity</observedProperty> <observedProperty>urn:ogc:def:phenomenon:density</observedProperty> <responseFormat>text/xml;subtype="om/1.0.0"</responseFormat> </GetObservation> |