cancel
Showing results for 
Search instead for 
Did you mean: 

WebService Error

Former Member
0 Kudos

Hi All,

I am trying to invoke a webservice through webdynpro. I created a model and gave the url of wsdl. I am not using any logical destinations. When i ping the WSDL, it is working fine. I give a numeric value as input and gives displays the same value as response.

Component controller init

try

{

Value model = new Value();

Request_Data req = new Request_Data(model);

Data dat = new Data(model);

dat.setValue(2);

req.setData(dat);

wdContext.nodeRequest_Data().bind(req);

}

catch(Exception e1)

{

wdComponentAPI.getMessageManager().reportSuccess("Error comp"+e1.toString());

}

-


public void executeXacute( )

{

//@@begin executeXacute()

try

{

wdContext.currentRequest_DataElement().modelObject().execute();

wdContext.nodeResponse().invalidate();

}

catch(Exception e)

{

IWDMessageManager manager=null;

manager.reportException(e.getMessage(),true);

}

View

try

{

wdThis.wdGetMytest_compController().executeXacute();

}

catch(Exception e)

{

wdComponentAPI.getMessageManager().reportSuccess("Error view"+e.toString());

}

But it is throwing Error

"Error viewjava.lang.NullPointerException".

What could be the Problem? Why null pointer Exception happens? Can anyone help me out in this?

Thanx and Regards,

Divya

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

The error is in the catch block of executeXacute() method.

IWDMessageManager manager=null;

manager.reportException(e.getMessage(),true);

Here manager is null and you are trying to call reportException() method. That is why it is raising null pointer exception.

Regards,

VJR.

Former Member
0 Kudos

Hi VJR,

Thanx for the reply. The null pointer Exception is becoz of that.

Now i am getting the Error

"Error in excecuteException on execution of web service with WSDL URL 'http://skvekd00:50500/value/Config1?wsdl' with operation 'data' in interface 'valueVi_Document' ".

node Data is a model node.

How can i resolve this Error?

Thanx and Regards,

Divya

Edited by: Divya V on Dec 10, 2008 11:13 AM

Former Member
0 Kudos

Hi Divya,

Print the exeception cause (ex.getCause()) to get more details.

Regards,

VJR.

Former Member
0 Kudos

Hi,

I am getting the following Error now.I am not using anuthentication in webservice. It is set to false.

Error in excecutejava.rmi.RemoteException: Invalid Response Code: (401) Unauthorized. The requested URL was:"http://skvekd00:50500/value/Config1?style=document"; nested exception is: com.sap.engine.services.webservices.jaxrpc.exceptions.InvalidResponseCodeException: Invalid Response Code: (401) Unauthorized. The requested URL was:"http://ssvepd00:50000/value/Config1?style=document"

Thanx and Regards,

Divya

Former Member
0 Kudos

Hi Divya,

The webservice which you are executing requires username and password.

If you are using Adaptive webservice model then pass the username and password like below.

wdContext.currentXXXXElement().modelObject().setInvokerProperty(javax.xml.rpc.Stub.USERNAME_PROPERTY,"username");

wdContext.currentXXXXElement().modelObject().setInvokerProperty(javax.xml.rpc.Stub.PASSWORD_PROPERTY,"password");

Regards

VJR.

Former Member
0 Kudos

HI VJR,

Thanx a lot...my problem is solved. I gave username and password.

But could you please explain me why this authentication of username and password is required.

Already i have deployed the web service in server and i am giving the password for deployment in server know. Then why should the user name and password be provided?

Thanx and Regards,

Divya

Former Member
0 Kudos

Hi Divya,

The webservice which you are using is secured one. Which means, only authenticated persons can use this webservice by providing the valid credentials.

The password which you have given while deployment was SDM password. And the password which you are supplying in webdynpro application is for authenticating the webservice.

Hope it is clear.

Thanks & Regards,

VJR.

Former Member
0 Kudos

Hi VJR,

Thanx for the reply. But how is that The webservice which used is a secured one?

In Webservice - properties "Features". i gave Authentication - "No Authentication". Could you please tell me how The webservice used is a secured one?

Thanx and Regards,

Divya

Former Member
0 Kudos

Hi Divya,

Did you create webservice using NWDS? If so while creating the webservice, what is the value you have selected for Default Configuration Type? If it is "Basic Auth SOAP", it requires username and password to execute the webservice. If it is "Simple SOAP" no authentication required.

Regards,

VJR.

Former Member
0 Kudos

Hi VJR,

Thanx Got it. Yah i am using Basic Auth SOAP, where authentication is required.

Thanx.

Regards,

Divya

Answers (1)

Answers (1)

lokesh_kamana
Active Contributor
0 Kudos

Hi,

Can you tell me the node hirerchy which you are having in the context.

So that it can help you?

Thanks & Regards,

Lokesh

Former Member
0 Kudos

Hi Lokesh,

-Context

- Node - Request Data

- Node - Data

Attribute - Value (Input)

- Node - Response

- Node - DataResponse

Attribute - Response (Output)

Main node is request data. Under that 2 subnodes data and response.

Inside Data 1 attribute called value. Inside Response, a subnode called "DataResponse" and a attribute called as response.

This is the node hierarchy.

Thanx and Regards,

Divya

Edited by: Divya V on Dec 10, 2008 10:38 AM

Edited by: Divya V on Dec 10, 2008 10:38 AM

Edited by: Divya V on Dec 10, 2008 10:38 AM

Former Member
0 Kudos

Hi,

Is the node:data is value node or model node?

Regards,

Goriga