Magento2 supports two formats of the messages for REST APIs: json and xml. Let's take json as an example: the api call for the service you created will looks like this:
curl -X POST "http://magento.url/rest/V1/vakri/update" -H "Content-Type: application/json" -d '{"xml": "<OrderEventNotification Id="E201602261456522075"> .. "}'
As you see here, you should have field, "xml", which corresponds to input parameter name of the method.
For XML it might be a bit more tricky, I would assume something like
curl -X POST "http://magento.url/rest/V1/vakri/update" -H "Content-Type: application/xml" -d '<xml>"<OrderEventNotification Id="E201602261456522075"> .. "</xml>'
In any case, there will be a problem if xml code contains characters which can break the request json/xml structure. One way to overcome that is to obfuscate xml string with some encoding, let's say base64, or escape all dangerous characters. In API service implementation you would need to do reverse operation.
Another, and much better way, is to actually create the Data Object, which represents the data from the XML file. Instead of sending raw XML string, you'll just use possibilities of Web API framework to serialize/deserialize data.
namespace Ezprints\Valkyrie\Model\Api\Data;
interface OrderEventNotificationInterface
{
/**
* @return string
*/
public function getId();
/**
* @return string
*/
public function getOrderId();
/**
* @return string
*/
public function getEZPReferenceNumber();
/**
* @return string
*/
public function getAcceptedDateTime();
}
namespace Ezprints\Valkyrie\Model\Api;
interface ValkyrieStatusUpdateInterface
{
/**
* Parse the notification XML and handle accordingly
*
* @api
* @param Data\OrderEventNotificationInterface $orderNotification
* @return Data\OrderEventNotificationResponseInterface
*/
public function processVaklyrieStatusUpdate(Data\OrderEventNotificationInterface $orderNotification);
}
API call will looks like:
curl -X POST "http://magento.url/rest/V1/vakri/update" -H "Content-Type: application/xml" -d '<id>E201602261456522075</id><order_id> 000000024</order_id><e_z_p_reference_number>0-01-7899-201602242228-0027-3808</e_z_p_reference_number><accepted_date_time>2016-02-26T21:27:55<accepted_date_time>'
Best Answer
Creating a CMS widget (and using it as a widget instance) would be the nicest way in my opinion. You can then use it as an inline widget, or widget instance.
Another way is to create the block and template, and use custom XML layout updates to add the block to the desired entity (category, product or CMS page).
If you don't know how to do any of that, read http://alanstorm.com/new_book_no_frills_magento_layout