on 04-16-2004 8:57 PM
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.
Hi,
I assume you configured some authentication in the security section of the ws-deployment descriptor.
So there are two possible answers:
1) Configure authentication from your web service client. This can either be accomplished by coding a username/password in your WebDypro application (call setUsername, setPassword on the model) or using an HTTP Destination. See
2) Configure the web service without authentication in the ws deployment descriptor.
Best Regards,
Martijn de Boer
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
81 | |
10 | |
10 | |
9 | |
7 | |
6 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.