Oracle Web service Date Returnes Null in Java Code but Not in SOAP UI -
i trying call web service far know implemented oracle. need date web service. here part of code generated web service client in netbeans:
@webmethod(operationname = "lastenabled", action = "lastenabled") @webresult(name = "lastenabledoutput", targetnamespace = "something",partname = "parameters") public lastenabledoutput lastenabled( @webparam(name = "sdate-lastenabledinput", targetnamespace = "something", partname = "parameters") sdatelastenabledinput parameters);
and code lastenabledoutput:
@xmlaccessortype(xmlaccesstype.field) @xmltype(name = "", proporder = { "_return" }) @xmlrootelement(name = "lastenabledoutput") public class lastenabledoutput { @xmlelement(name = "return", required = true) @xmlschematype(name = "date") protected xmlgregoriancalendar _return; public xmlgregoriancalendar getreturn() { return _return; } public void setreturn(xmlgregoriancalendar value) { this._return = value; } }
and how call web service:
lastenabledoutput output = webservice.lastenabled(input); xmlgregoriancalendar xmlgregoriancalendar = output.getreturn(); gregoriancalendar calendar = xmlgregoriancalendar.togregoriancalendar(); date date = calendar.gettime();
webservice.lastenabled(input)
returns lastenabledoutput
object value of output.getreturn()
in code above null. however, in soap ui, tested webservice , returns valid answer: request:
<soapenv:envelope xmlns:soapenv="a url" xmlns:pkg="a url"> <soapenv:header/> <soapenv:body> <pkg:sdate-lastenabledinput> <pkg:telno-varchar2-in>some phone number</pkg:telno-varchar2-in> <pkg:serviceid-number-in>10</pkg:serviceid-number-in> <pkg:enable-boolean-in>true</pkg:enable-boolean-in> </pkg:sdate-lastenabledinput> </soapenv:body> </soapenv:envelope>
response:
<soap:envelope xmlns:soap="a url"> <soap:body> <lastenabledoutput xmlns="a url"> <return>07-jul-15</return> </lastenabledoutput> </soap:body> </soap:envelope>
it may helpful there other methods in web service other return types work correctly same way called method. how can solve problem?
Comments
Post a Comment