Avoid unnecessary association tags in WSDL of published webservice - Mendix Forum

Avoid unnecessary association tags in WSDL of published webservice

15

This suggestion is requested before in the Idea Forums of 2015 Q3 and Q4 by Ivo Sturm and Samet Kaya, citing the last one here:

When we publish webservices (and we do this a lot), Mendix creates unnecessary tags for associations. These tags are really not needed and especially in larger operations with many associations the xml requests are getting quite large. Calling a Mendix webservice from a middleware solution takes us more time to create all those tags. And this is annoying because the tags are not useful and also not avoidable. We're getting also commentary from third parties about the large structure of our operations in a wsdl. XML is already large and fat when you compare it to other data-interchange formats like JSON and when Mendix adds more tags than needed, integrating with Mendix takes more time.

I really would like it when this behavior could be configurable when publishing a default webservice in Mendix. I don't ask for eliminiation of this default behaviour of Mendix, just a way to disable the unnecessary association tags. I know there are workarounds with custom request handlers and things like that, but this is a feature request for the out-of-the-box webservice publisher in Mendix.

In the example below, I found a couple of unnecessary association tags in such a small request:

  1. Orderline_Order
  2. Orderline_Product
  3. Warehouse_Product

 

<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope
  xmlns:xsd="http://www.w3.org/2001/XMLSchema"
  xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xmlns:tns="http://localhost:8080/ws/">
    <soap:Body>
        <tns:GetOrder>
            <Order>
                <Number>123</Number>
                <Orderline_Order>
                    <Orderline>
                        <Quantity>1234.5677490234375</Quantity>
                        <Total>1234.5677490234375</Total>
                        <Orderline_Product>
                            <Product>
                                <Number>123</Number>
                                <Warehouse_Product>
                                    <Warehouse>
                                        <Name>exampleString</Name>
                                    </Warehouse>
                                </Warehouse_Product>
                            </Product>
                        </Orderline_Product>
                    </Orderline>
                </Orderline_Order>
            </Order>
        </tns:GetOrder>
    </soap:Body>
</soap:Envelope>

 

asked
5 answers

Every project I end up generating XSD files from Mendix one way or another, often to be able to import something afterwards using the same structure. Each time I have to waste time unchecking all these unneeded associations from the mapping, making it impossible to maintain easily. It really is bloated, so would love to see them go.

Created

What do you think of the following solution?

We add the possibility to not generate tags for associations. Your example will look like this:

<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope
  xmlns:xsd="http://www.w3.org/2001/XMLSchema"
  xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xmlns:tns="http://localhost:8080/ws/">
  <soap:Body>
    <tns:GetOrder>
      <Order>
        <Number>123</Number>
        <Orderline>
          <Quantity>1234.5677490234375</Quantity>
          <Total>1234.5677490234375</Total>
          <Product>
            <Number>123</Number>
            <Warehouse>
              <Name>exampleString</Name>
            </Warehouse>
          </Product>
        </Orderline>
      </Order>
    </tns:GetOrder>
  </soap:Body>
</soap:Envelope>

There are a couple of things to consider:

1. When you want to export two associations to the same entity, you will have to give them different exposed names.
2. This option can be switched on or off for each published web service. New web services will have it switched on, but existing web services will have it switched off for backwards compatibility.

Created

Contract first and removal of association tags for xml are currently not on the short term roadmap. The new message definition window does allow you to remove the association tag for json, we plan to extend this functionality to xml some time in the future.

Created

On this subject; a much better solution would be if Mendix would support contract first for published services.

Created

Great idea, would be really useful.

Created