cancel
Showing results for 
Search instead for 
Did you mean: 

Web service not returning data

Former Member
0 Kudos

Hi

i am running the web service which is returning 3 internal tables but its not returning the values in web dynpro but when i checked it with web service navigator its returning the rows

I am invalidating the nodes that is not the problem so can any one tell me where could be the problem

Thanks

Ninad

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi

Try This

IPrivate<ViewName>.IEvent_Get_ListElement loginElement = wdContext.currentEvent_Get_ListElement();

loginElement.setUsername("userId");

loginElement.setPassword("passWord");

try{

wdContext.currentEvent_Get_ListElement().modelObject().execute();

wdContext.nodeReceiver().invalidate();

} catch(Exception ce) {

wdContext.currentLoginElement().setError("login error"+ce.getMessage());

}

int rec_size = wdContext.nodeReceiver().size();

wdContext.currentContextElement().setTEST(rec_size+"");

Kind Regards

Mukesh

Former Member
0 Kudos

Hi Mukesh

I am writing this code in default componet controller not in a iView so when i give component controler name insted of view name it works on that line but don't work on next line where we set username/pass it don't have those methods.

And one more thing is by same procedure i have mentioned i am executing 3 more web services and they are running very fine just this is not returning the values.

Thanks

Ninad

Former Member
0 Kudos

Hi,

Please check the following ways:

1. Through Web service Navigator - working fine.

2. Check the input parameter binding.

3. Before binding input parameter print into screen.

4. After executing webservice check 3 internal table size.

Can you give the webservice(WSDL file path) name and input parameter?.

Kind Regards,

S.Saravanan.

Former Member
0 Kudos

Hi Saravanan

I have done all those things but still its not working

1. its running from web service Navigator

2. inputs are proper i am seting inpurs programaticaly not a user input

3. printed it on screen its proper

4. After executing webservice size of the internal tables is 0 but in web service navigator it runs well with same parameters and returns the result as per requirement.

bellow is the code i am using

wdContext.currentGetList_ParametersElement().setZuser(logonID);
		


wdContext.currentEvent_Get_ListElement().modelObject()._setUser("uname");
wdContext.currentEvent_Get_ListElement().modelObject()._setPassword("pass");

wdContext.currentEvent_Get_ListElement().modelObject().execute();

wdContext.nodeGetList_Response().invalidate();
wdContext.nodeGetList_Result().invalidate();
wdContext.nodeDoctype().invalidate();
wdContext.nodeReceiver().invalidate();
wdContext.nodeSender().invalidate();


int rec_size = wdContext.nodeReceiver().size();
wdContext.currentContextElement().setTEST(rec_size+"");

so what could be the problem?

Thanks

Ninad

Former Member
0 Kudos

Hi,

I think better you have to reimport the webservice. otherwise Can you give the webservice(WSDL file path) name and input parameter?.

Kind Regards,

S.Saravanan.

Former Member
0 Kudos

Hi,

After model import component controller structure like:

Request_WEBTESTRLCViDocument_getRole

--Respone

--Result

--Key (output)

--Value(output)

-- Empid(input)

Component Controller name=Testwebservice

Input name =Empid

output=Key and Value.

Step 1:

Put the following line into DoInit() method

wdContext.nodeRequest_WEBTESTRLCViDocument_getRole().bind(new Request_WEBTESTRLCViDocument_getRole());

Step 2:

Create one method and put the following line:

IPrivateTestwebservice.IRequest_WEBTESTRLCViDocument_getRoleElement request_WEBTESTRLCViDocument_getRoleElement = wdContext.currentRequest_WEBTESTRLCViDocument_getRoleElement();

String empid="60000011";

request_WEBTESTRLCViDocument_getRoleElement.setEmployeeId(empid);

try{

Request_WEBTESTRLCViDocument_getRole obj=wdContext.currentRequest_WEBTESTRLCViDocument_getRoleElement().modelObject();

obj.execute();

wdContext.nodeResponse().invalidate();

}catch(Exception e){}

IPrivateTestwebservice.IResultNode modelnode=wdContext.nodeResult();

for(int x=0;x<modelnode.size();x++){

IPrivateTestwebservice.IResultElement modelElement=modelnode.getResultElementAt(x);

wdComponentAPI.getMessageManager().reportSuccess(modelElement.getKey()+modelElement.getValue());

}

Before execute set username and password.

Kind Regards,

S.Saravanan.

Former Member
0 Kudos

Hi Sarvanan,

I had already done step 1 and now tried to do step 2 but at first line after IPrivateDTCComp i don't found the node to get the instance.

I tried the code mukesh has submitted and tried to execute the webservice in iView only but its not done i don't found the method setUsername or pass i have a method setAttribute and tried to set username as first parameter and password as another but it's also not working it gives unknown attribute username

So can any one help me out in this regards

Thanks

Ninad

Former Member
0 Kudos

Hi,

Before execute Webservice please use the following code:

obj._setUser("username");

obj._setPassword("password");

obj.execute();

Have set username and password for other web service(Previously imported)?. If you don't found _serUser() and -setPassword() methid that should be version problem. I am using 2.0.15, it contains those methids.

Kind Regards,

S.Saravanan.

Former Member
0 Kudos

Hi Saravanan

This is also not working I set the username and password but still its not returning the records

Thanks

Ninad

Former Member
0 Kudos

Hi

I got one clue about the problem but not getting how to solve it i am getting null pointer exception when i am setting the input parameter for the web service

there is only one input parameter which i have hard coded for time beaing but that statement gives null pointer exception bellow is the line by which throws the exception

wdContext.currentGetList_ParametersElement().setZuser("uname");

can any one tell me why null pointer exception is comming

Thanks

Ninad