jboss-fuse / wsdl2rest

A tool allowing quick migration from existing JAX-WS services to REST
Apache License 2.0
25 stars 22 forks source link

POST rest dsl should be used when it comes to complex Java Object #96

Open ffang opened 4 years ago

ffang commented 4 years ago

With this WSDL , the wsdl2rest will generate camel-context.xml like

<get id="id-01f5d714-8b84-4af4-9358-e608a345ccbb" uri="/request/{arg0}"
            type="com/wdata.ibm.WeatherRequest"
            outType="com/wdata.ibm.WeatherResponse"
            >
            <to uri="direct:weatherRequest"/>
          </get>

However, the type WeatherRequest isn't primitive JAVA object and can't be the arg in uri, we should generate POST instead in this case like

<post id="id-140a15b5-e0f0-498b-9592-9efd399f17bf" uri="/request/"
            type="com.ibm.wdata.WeatherRequest"
            outType="com.ibm.wdata.WeatherResponse"
            consumes="application/json"
            >
            <to uri="direct:weatherRequest"/>
          </post>