How to publish a webservice for order - orderline situation

4
I want to publish a webservice so a third party can update the order status of an order in our Mxportal. Requirements are: The status of the order can be changed The status of an order line of an order can be changed Orderlines can be 'delivered' seperately. 5 of 10 products in 1 orderline can be delivered (1 orderline contains 1 product, but varies in quantity). So if the entire order is delivered, the order status should be changed via the WSDL in delivered. If one orderline cannot be delivered, the status should be changed via the WSDL in 'in progress' and the delaying orderline must be updated with the status not delivered, (and if the orderline is delivered partially, the quantity that is delivered must be updated). How to define this recursive element in my WSDL? The WSDL should be something like this: <order> <OrderID>10004</OrderID> <OrderStatus>partial delivered</OrderStatus> <Forwarder>DHL</Forwarder> <trackingnumber>GZ654567898765</trackingnumber> <arrayofOrderlines> <Orderline> <linenumber>2</linenumber> <Deliveredquantity>4</Deliveredquantity> </Orderline> <Orderline> <linenumber>6</linenumber> <Deliveredquantity>0</Deliveredquantity> </Orderline> </arrayofOrderlines> </order> It is not possible to set an object as input parameter in my published webservice right?
asked
1 answers
6

I'll start with your last question. You are right that in Mendix 2.4, you cannot use objects as parameters for your web service microflows. This functionality will be added in Mendix 2.5.

Until that time, you could consider splitting up your web service operation (published microflow) in two separate operations: one for updating an order, and one for updating an order line.

The UpdateOrder operation would get parameters such as OrderID, OrderStatus, Forwarder etc. This microflow would update only fields of the order.

The UpdateOrderLine operation would get the OrderID and linenumber as parameters to identifiy which order line in which order is meant, as well as parameters for updating the order line (DeliveredQuantity). This microflow would update the fields of the order line, and could also check whether all lines of the order are now delivered and update the order status accordingly.

Another option to circumvent the object-as-parameter problem is to offer a web service operation called, e.g., 'UpdateOrder' that takes an order ID as a parameter, and that calls a web service on the third party system to retrieve the updated information for that order ID.

answered