Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

XMLBeans get_store() method returns null

I am developing a Axis2 based WebServices with XMLBeans binding. I have generated the code by using WSDL2Java generator and tried testing it with sample values set in the request.

In one of the setter methods (auto-generated code) I found the below code. The method get_store() returns a null value and hence I get a NullPointerException.

target = (org.apache.xmlbeans.SimpleValue)
    get_store().find_element_user(TRANSACTIONTYPE$0, 0);

I tried Google to find the solution and found similar issue with no solution specified.

Is there any work around for this issue?? Kindly help me

like image 230
R K Avatar asked Feb 17 '26 12:02

R K


1 Answers

This issue got resolved!!

I was actually trying to instantiate a response object in a normal Java way and hence i got the above mentioned exception while running my WebServices.

Wrong way - ResponseType responseType = new ResponseType();

Correct way - ResponseType responseType = ResponseType.Factory.newInstance();

like image 155
R K Avatar answered Feb 19 '26 02:02

R K



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!