web services - Java 6 | SOAP Webservice generating without embedding it inside some parameter -
i trying integrate legacy application in have defined message format data structure.
now use java 6 publish our web service via following code:
endpoint.publish(urlstring, new notificationlistener());
my notificationlistener service contains 1 method , definition follows:
@webservice public class notificationlistener { @webmethod(action="notifystatus111") @webresult(name="notificationresponse") public notificationresponse notifystatus1(@webparam(name="notification") notification notification) { return new notificationresponse(); }
and using wsgen command generate stubs webservice via following ant command:
<project default="wsgen"> <target name="wsgen" > <exec executable="wsgen"> <arg line="-cp ./bin -keep -s ./src -d ./bin com.xyz.listener.notificationlistener"/> </exec> </target> </project>
now problem generated stubs wsdl creates wrapper method name on input , output objects.
for example, definition of generated id follows:
@xmlrootelement(name = "notifystatus1") @xmlaccessortype(xmlaccesstype.field) @xmltype(name = "notifystatus1") public class notifystatus1 { @xmlelement(name = "notification", namespace = "") private com.xyz.listener.notifications.notification notification; }
in notification object embedded inside notifystatus1 stub.
however legacy application doesn't expect same, instead expects notification object direct root element.
so way can define notifcation root instead of wrapping inside same wrapper , publish definition accordingly.
any points highly appreciated.
thanks quick feedback time , pointers. have tried way have suggested not generating stubs classes via wsgen command , published webservice directly.
even output same, have validated via generated wsdl. following snippet of generated wsdl:
<porttype name="notificationlistener"> <operation name="notifystatus1"> <input message="tns:notifystatus1"/> <output message="tns:notifystatus1response"/> </operation> </porttype>
Comments
Post a Comment