cancel
Showing results for 
Search instead for 
Did you mean: 

What happened to my web service?

Former Member
0 Kudos

hi,

After I run a Web Dynpro application,it shows a error as follows:

"java.lang.NullPointerException

at com.sap.tc.webdynpro.model.webservice.gci.WSTypedModelClass.getAttributeValueAsInt(WSTypedModelClass.java:163)"

As in web service test, the web service runs well.But here,it can not run.I don't know what happened to my web service.Would you please give me a help?Thank you!

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Daniel,

Just check whether u r passing all mandatory values or not to webservice?? u can use this code for trace

public void traceWSInvocation( com.sap.tc.webdynpro.model.webservice.gci.WSTypedModelClassExecutable requestModel, java.lang.Exception ex )

{

//@@begin traceWSInvocation()

logger.traceThrowableT(

Severity.ERROR,

wdComponentAPI.getApplication().getDeployableObjectPart().getName(),

ex);

//if (logger.beDebug()) {

logger.fatalT(requestModel.wdGetRequestLog());

logger.fatalT(requestModel.wdGetResponseLog());

logger.fatalT(requestModel.associatedModelClassInfo().getModelInfo().toString());

logger.fatalT(requestModel.toString());

//}

//@@end

}

in ur execute webservice method take ur request model & make it log enabled like this

reqModel.wdSetInvocationLogEnabled(true);

in ur catch block of ur execute method, call the traceWSInvocation(request model,exception) & check the server log. send the trace from server log.

regards

Sumit

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi,

1:This Exception will be caused if you pass null values to the webservice

First surround the statements in try.. catch blocks and trace your application by printing values that you pass to Webservice in try block.. by giving

wdComponentAPI.getMessageManager.reportSuccess("Valu1= "+<Value1>);

try{

statement1;

statement2; etc..

}catch(Exception e)

{

wdComponentAPI.getMessageManager.reportException("Exception while testing "+e,false);

return;

}

2:This Exception can also be caused because of not initialization takes place in wdDoInit() method

in wdDoinit() method put these

<Request_testData> obj=new <Request_testData>();

wdContext.node<Request Node>().bind(obj);

Regards

LakshmiNarayana