cancel
Showing results for 
Search instead for 
Did you mean: 

Cannot get the attribute value in response node of Adaptive Webservice model

0 Kudos

Hi,

I am using an adaptive webservice model (PI interface exposed as WSDL file). The scenario is very simple and I have explained below.

1. set the login ID as input to the PI interface.

2. PI interface collect some information from the R/3 system for the user ID sent from Webdynpro for Java using proxy class.

3. This information has to be read by Webdynpro for Java.

What I did?

I set the User ID to the model class and executed the model. When I check in PI queue, the User ID is sent and the information required also has been retrived by PI interface. but When I read the same attribute in portal, it returns null value. Is there any special way to invoke the response from Webservice model. I pasted my code below.

*************************************************************************************

IPrivateBatch_Approve_RejectView.IContextElement ele = null;

          IPrivateBatch_Approve_RejectView.IDETAILS_respElement element = null;

try {

                    MO_Get_SysCode model = new MO_Get_SysCode();

                    Request_MIOS_0085_USER_AUTHENTICATE reqAuth = new Request_MIOS_0085_USER_AUTHENTICATE(model);

                      DT_0085_USER_AUTHENTICATE dtAuth = new DT_0085_USER_AUTHENTICATE(model);

                      DETAILS details = new DETAILS(model);

                      details.setUSERID(Logon_ID);

                      dtAuth.setDETAILS(details);

                      reqAuth.setMT_0085_USER_AUTHENTICATE(dtAuth);

                      wdContext.nodeRequest_MIOS_0085_USER_AUTHENTICATE().bind(reqAuth);

                      wdContext.currentRequest_MIOS_0085_USER_AUTHENTICATEElement().modelObject().execute();

                      ele.setVa_SysCode(element.SYSCODE);

                      Sys_Code = ele.getVa_SysCode();

                      wdComponentAPI.getMessageManager().reportSuccess(Sys_Code);

              } catch (WDWSModelExecuteException e1) {

                    // TODO Auto-generated catch block

                    e1.printStackTrace();

          }

******************************************************************

Pls help me in this issue.

Thanks,

Mahendran B.

Accepted Solutions (1)

Accepted Solutions (1)

junwu
Active Contributor
0 Kudos

ele.setVa_SysCode(element.SYSCODE);

                      Sys_Code = ele.getVa_SysCode();

what is for? getter just after setter?

0 Kudos

Hi Jun Wu,

va_SysCode is the attribute in the view context. SYSCODE is the attribute from PI. am setting the value from PI interface in the attribute in View context and assigning the context attribute value to the global variable Sys_Code.

Thanks,

Mahendran B.

junwu
Active Contributor
0 Kudos
element = null
element.SYSCODE
do you think it makes any sense?
you have to get the result from the response.
0 Kudos

Hi Jun Wu,

I have already corrected my code and tested it. but still am getting the null pointer exception. I have pasted my code below. pls let me know if there is any mistake. 

********************************************************************

try {

                    MO_Get_SysCode model = new MO_Get_SysCode();

 

                    Request_MIOS_0085_USER_AUTHENTICATE reqAuth = new Request_MIOS_0085_USER_AUTHENTICATE(model);

 

                    DT_0085_USER_AUTHENTICATE dtAuth = new DT_0085_USER_AUTHENTICATE(model);

 

                    DETAILS details = new DETAILS(model);

 

                    details.setUSERID(Logon_ID);

 

                    dtAuth.setDETAILS(details);

 

                    reqAuth.setMT_0085_USER_AUTHENTICATE(dtAuth);

 

                    wdContext.nodeRequest_MIOS_0085_USER_AUTHENTICATE().bind(reqAuth);

 

                    wdContext.nodeResponse_syscode().invalidate();

 

 

 

                    wdContext.currentRequest_MIOS_0085_USER_AUTHENTICATEElement().modelObject().execute();

 

                    wdComponentAPI.getMessageManager().reportSuccess("after executing model");

 

                    Sys_Code = wdContext.nodeDETAILS_syscode().currentDETAILS_syscodeElement().getSYSCODE();

 

                    wdContext.currentContextElement().setVa_SysCode(Sys_Code);

 

          } catch (WDWSModelExecuteException e1) {

                    // TODO Auto-generated catch block

                    e1.printStackTrace();

          }

*******************************************************

Thanks,

Mahendran B.

junwu
Active Contributor
0 Kudos

if possible, generate the code using the wizard, no need to write it manually.

0 Kudos

Hi,

can anyone provide the way or the code on how to retrieve the value from response node after executing the webservice model (Synchronous scenario). In my case after I execute the model, it exits the try block. after the model execution code what ever the code am typing is not executing. It immedietly get out of the try block once the modelobject().execute().

Thanks,

Mahendran B.

junwu
Active Contributor
0 Kudos
as i said, using wizard, ok? can you just follow?
don't write the code you know nothing about.....
0 Kudos

Hi Jun Wu,

The problem why it didnt returns the value is, we did some changes in PI interface and still it refers to old object. So the model execution was not success for synchronous scenario. basically the model execution failed. Also i didnt catch the exception. I saw the error in Logs & traces in portal. Now I have requested basis team to restart the portal. Since am not well versed in WebDynpro for Java, I didnt do a good analysis which deviated the topic. Hope restart will solve the issue. Thanks so far for helping me. I will update this forum once the issue is solved.

Thanks,

Mahendran B.

0 Kudos

Hi Jun Wu,

After restarting, am getting the value. Thanks again for your guidance. Am closing this thread

Thanks,

Mahendran B.

junwu
Active Contributor
0 Kudos

ws mdoel is cached, restart is required if you make change to the ws

Answers (1)

Answers (1)

junwu
Active Contributor
0 Kudos
usually i use wizard to generate everything regarding the model binding and execution.
0 Kudos

Hi Jun Wu,

For me the execution is perfect. I can call the webservice in PI and I can set the value to PI interface attributes. But my problem is only in getting the response attribute values. Is there anything we need to handle specially for getting response value comparing to Adaptive RFC model execution?

Thanks,

Mahendran B.

Former Member
0 Kudos

Hi Mahendran,

Did you try invalidating the Output node before executing the RFC call? If not, please do that and try again.

Regards,

Manoj

0 Kudos

Hi Manoj,

I have 3 levels of node under which I have the attribute to be read in response. Do I need to invalidate all the 3 nodes?

Thanks,

Mahendran B.

Former Member
0 Kudos

Hi Mahendran,

Only invalidating the top-level node must be fine.

Regards,

Manoj

0 Kudos

Manoj,

I have tried invalidating the response node before executing and also after executing the model. But still the value is null. But when I look in SXMB_MONI the SYSCODE has values.

Thanks,

Mahendran B.