The CoapServer Connector can be used in Mule applications to implement CoAP servers. When the Connector is installed into Anypoint Studio, a CoAP Server can be configured by dragging CoAP elements into the flow, or by editing the xml content of the Mule configuration file directly. The CoAP server configuration is composed of a global coap-server configuration element that defines the CoAP interface, coap-server listeners that form the entry point of requests into the Mule flow and further messageprocessors in the flow that process the request.
To use the CoAP Server, its namespace and schemaLocation need to be specified in every mule-config file with CoAP Server elements:
<mule xmlns="http://www.mulesoft.org/schema/mule/core" xmlns:coap-server="http://www.mulesoft.org/schema/mule/coap-server" xsi:schemaLocation= "http://www.mulesoft.org/schema/mule/core http://www.mulesoft.org/schema/mule/core/current/mule.xsd http://www.mulesoft.org/schema/mule/coap-server http://www.teslanet.nl/schema/mule/coap-server/current/mule-coap-server.xsd > ... </mule>
When CoAP Server elements are dragged from Studio's components panel into the Mule flow the namespace and schemaLocation is added automatically.
To configure the CoAP Server Connector see the section called “Server Configuration”
To receive CoAP Requests see the section called “Listen messagesource”
To notify observing CoAP clients see the section called “Resource changed messageprocessor”
To dynamically add resources see the section called “Add resource messageprocessor”
To dynamically remove resources see the section called “Remove resource messageprocessor”
For an overview of available CoAP response codes see the section called “Response codes”
For an overview of available message properties see the section called “Message Properties”