Skip to Content
author's profile photo Former Member
Former Member

Webservice Exception

Hi All,

I've developed an application which uses a webservice as a model. The webservice has some security features (Authentication through roles).When I access the webservice through webdynpro, I'm getting webservice call exception :

Exception Service call exception; nested exception is: com.sap.engine.services.webservices.jaxrpc.exceptions.InvalidResponseCodeException: Invalid Response Code: (401) Unauthorized. The requested URL was:"http://tempwas:50000/CreditCheck/Auth?style=document"

Can anybody know how to access authenticated webservice/

Any kind of help will be appreciated.

Abhinav Sharma

Add comment
10|10000 characters needed characters exceeded

6 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Jul 24, 2006 at 10:24 AM

    Hai ,

    try to give security params here

    wdContext.currentRequestXXXX().setCC();

    before executimg the model object.

    other wise try to give user name and password in model Http Proxy.

    regards,

    Add comment
    10|10000 characters needed characters exceeded

  • Posted on Jul 24, 2006 at 10:32 AM

    Hi Naga,

    I didn't find any security parameter with the currentRequestXXX Element.

    and for the second option that you've mentioned, could you please elaborate on it.

    Thanks & Regards

    Abhinav

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member

      Hi,

      Check if tc/sec/wssec/service is included in the list of service references. If not then insert it as

      follows:

      1. Select the project, open the context menu and choose Properties.

      2. In the left pane, select Web Dynpro References; in the right pane, choose the Service References tab page.

      3. Choose Add. The Create new reference dialog appears.

      4. Enter tc/sec/wssec/service as the service name for the WS Security service and choose OK.

      Regards,

      Satyajit.

  • Posted on Jul 24, 2006 at 11:06 AM

    hi Satyajit,

    I followed the steps outlined but got the following exception while deploying the application on J2EE :

    Finished with warnings: development component 'DP_SecurityTest'/'local'/'LOKAL'/'0.2006.07.24.16.33.58':

    Caught exception during application startup from SAP J2EE Engine's deploy service:

    java.rmi.RemoteException: Error occurred while starting application local/DP_SecurityTest and wait. Reason: Clusterwide exception: server ID 9758250:com.sap.engine.services.deploy.container.DeploymentException: Clusterwide exception: Failed to prepare application ''local/DP_SecurityTest'' for startup. Reason=Clusterwide exception: Failed to start dependent service ''tc/sec/wssec/service '' of application ''local/DP_SecurityTest''. Status of dependent component: STATUS_MISSING. Hint: Is the component deployed correctly on the engine?

    at com.sap.engine.services.webdynpro.WebDynproContainer.prepareStart(WebDynproContainer.java:1421)

    at com.sap.engine.services.deploy.server.application.StartTransaction.prepareCommon(StartTransaction.java:239)

    at com.sap.engine.services.deploy.server.application.StartTransaction.prepare(StartTransaction.java:187)

    at com.sap.engine.services.deploy.server.application.ApplicationTransaction.makeAllPhasesOnOneServer(ApplicationTransaction.java:301)

    at com.sap.engine.services.deploy.server.application.ParallelAdapter.makeAllPhasesImpl(ParallelAdapter.java:327)

    at com.sap.engine.services.deploy.server.application.ParallelAdapter.runInTheSameThread(ParallelAdapter.java:111)

    at com.sap.engine.services.deploy.server.application.ParallelAdapter.makeAllPhasesAndWait(ParallelAdapter.java:230)

    at com.sap.engine.services.deploy.server.DeployServiceImpl.startApplicationAndWait(DeployServiceImpl.java:4700)

    at com.sap.engine.services.deploy.server.DeployServiceImpl.startApplicationAndWait(DeployServiceImpl.java:4605)

    at com.sap.engine.services.deploy.server.DeployServiceImpl.startApplicationAndWait(DeployServiceImpl.java:4578)

    at com.sap.engine.services.deploy.server.DeployServiceImplp4_Skel.dispatch(DeployServiceImplp4_Skel.java:1163)

    at com.sap.engine.services.rmi_p4.DispatchImpl._runInternal(DispatchImpl.java:304)

    at com.sap.engine.services.rmi_p4.DispatchImpl._run(DispatchImpl.java:193)

    at com.sap.engine.services.rmi_p4.server.P4SessionProcessor.request(P4SessionProcessor.java:122)

    at com.sap.engine.core.service630.context.cluster.session.ApplicationSessionMessageListener.process(ApplicationSessionMessageListener.java:33)

    at com.sap.engine.core.cluster.impl6.session.MessageRunner.run(MessageRunner.java:41)

    at com.sap.engine.core.thread.impl3.ActionObject.run(ActionObject.java:37)

    at java.security.AccessController.doPrivileged(Native Method)

    at com.sap.engine.core.thread.impl3.SingleThread.execute(SingleThread.java:100)

    at com.sap.engine.core.thread.impl3.SingleThread.run(SingleThread.java:170)

    (message ID: com.sap.sdm.serverext.servertype.inqmy.extern.EngineApplOnlineDeployerImpl.performAction(DeploymentActionTypes).REMEXC)

    Deployment exception : Got problems during deployment

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member

      Hi,

      What if you ignore this warning and run your application? It looks like a <i>"harmless"</i> warning message.

      Regards,

      Satyajit.

  • author's profile photo Former Member
    Former Member
    Posted on Jul 31, 2006 at 03:31 PM

    Try with: tcsecwssec~service

    Don't use: tc/sec/wssec/service

    This worked for me.

    Add comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jul 31, 2006 at 04:05 PM

    Hi;

    Try calling the methods:

    wdContext.currentRequestXXXX()._setUser()

    and

    wdContext.currentRequestXXXX()._setPassword

    before you call the execute() method. I was having the same problem this morning and that solved it...

    Cheers,

    John

    Add comment
    10|10000 characters needed characters exceeded

  • Posted on Aug 02, 2006 at 04:25 AM

    Hi John...

    that's really solved my problem. and suitable points rewarded. But I have to enter pwd in my coding which is not secure. i want to use ldap password in my program but don't know how to get LDAP password.

    Can u help me in sorting out this matter? Any help would be appreciated.

    Thanks & Regards.

    Abhina Sharma

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member

      Hi Abhinav;

      The text below may solve your problem; this is how we are doing it by creating an HTTP destination in Visual Administrator and setting the user ID and password there, which is especially helpful for change management so we can have different passwords in DEV, QAS, and PRD.

      I must give my most sincere apologies to whomever wrote this text initially. I would have sent you to the thread that this came from, but I can not find it (I only have this text):

      What you need to do is:

      <i>1. Create one HTTP destination in visual administrator at services-> Destinations. Provide HTTP url of the your web service and the security options.

      2. Specify this HTTP destination in the code before executing web service model.

      Write following code for that:

      wdContext.current<node name>Element().modelobject()._setHTTPDestination(<Specify HTTP destination name>);

      Then execute your web service model.

      Now, whenever you want to change the server on which your web service is running, make change in the HTTP Destination in visual administrator.</i>

      Cheers,

      -John