I think I need to reword my question. Basically I have a webservice with operation TrygetByKeyTenant, the respnse of this has two message parts defined in wsdl as:
<wsdl:message name="TryGetByKeyTenantResponse"> <wsdl:part name="orderKey" type="na:OrderKey" /> <wsdl:part name="entity" type="ys:TenantValue" /> </wsdl:message> As the name specify this will return the TenantValue if one is there with the given key else the second part i.e (<wsdl:part name="entity" ....) is going tobe null. so the client expect <s5:entity xsi:nil="1" xmlns:s5="http://www.syndesis.com/ys/intf" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/> But the generated ADB Java class for TryGetByKeyTenantResponse throws exception in serialise method if entity is null. I have just modified this to return the xsi:nul="true" instead of throwing null it works fine. can some one let me know how to get around this. Is there any option to specify nil=true for the message parts? Regards, Krishna krishna.arani wrote: > > Hi, > The last message was not getting posted to mailing list so I again posting > again. sorry If it causes any problem. > In my rpc/literal style webservice, I have a <wsdl:message> element with > multiple parts in it. One of the part can be nullable. The problem is the > generated ADB from wsdl2java throws an exception if the part is null while > serialising to xml. > > <wsdl:message name="TryGetByKeyTenantResponse"> > <wsdl:part name="orderKey" type="na:OrderKey" /> > <wsdl:part name="entity" type="ys:TenantValue" /> > </wsdl:message> > > here the "entity" can be null. so it is expected that the soap response to > have > > <s5:entity xsi:nil="1" xmlns:s5="http://www.syndesis.com/ys/intf" > > xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/> > > But the generated ADB class throws an exception if entity is null. > > If have moved these two element parts under another type and use that as > part it works by defining nillable="true" for the second element. But I > dont want to do this or change the message structure as other parties will > have to chage too. This was working fine with axis1. > > any advice on how to go with this issue. > Thanks in advance. > > -Krishna Arani > -- View this message in context: http://www.nabble.com/problem-with-AXis2-Wsdl2java-ADB-Code-generator-tp23175797p23212701.html Sent from the Axis - User mailing list archive at Nabble.com.