Skip to Content
0
Former Member
Apr 16, 2004 at 07:57 PM

unable to access web service from webdynpro.

20 Views

Hi All:

I have created a stateless session bean and from this I am calling a function module.

I converted this into a webservice. when I run the webservice from SAP NetWeaver Developer Studio

(http://localhost:50000/custwebservice/Config) and click on test button It promots me to enter userId and password.

Q1> Every time I run webservice I have to enter "Administartor" and "sap" as userId and password.How do I provide userId and password so that the webservice doesn't prompt me to enter userid and password.

From WebDynpro I am consuming the webservice.

This is what I am doing in my WebDynpro.

public void onActionEnter(com.sap.tc.webdynpro.progmodel.api.IWDCustomEvent wdEvent )

{

//@@begin onActionEnter(ServerEvent)

try{

wdContext.currentSoldToElement().modelObject().setCustNo("0000101925");

wdContext.currentSoldToElement().modelObject().execute();

wdContext.nodeResponse().invalidate();

wdThis.wdGetSampleComponentController().wdGetContext().currentContextElement().setDetails(wdContext.currentSoldToElement().modelObject().getResponse().getResult());

}catch(Exception ex){

com.sap.tc.webdynpro.progmodel.controller.MessageManager msgMgr = (com.sap.tc.webdynpro.progmodel.controller.MessageManager) wdThis.wdGetAPI().getComponent().getMessageManager();

msgMgr.setReportSingle(true);

wdThis.wdGetSampleComponentController().wdGetContext().currentContextElement().setDetails(ex.getLocalizedMessage());

}

}

When I run this WebDynpro Application and click on Enter button I get

"Service call exception;nested exception is;java.lang.Exception Transport Error! Response code (401) unauthorized"

Any suggestions

Thanks in advance.