Skip to Content
author's profile photo
Former Member

Error calling Webservice with SSO

Hello everybody,

I have WAS 6.40 SP13 installed. I have NWDS sp12.

I have imported Car rental tutorial which includes Authentication and authorization code. This tutorial has implemented SSO also between Webdynpro and Web service using SAP logon ticket.

I deployed this application on my server. This application works properly with SSO.

Now, i have created one webdynpro application and created Web service model for the same web service used in above project. I have specified same HTTP destination in code as specified in above tutprial project.

But when i am running my webdynpro application it is giving me Unauthorized error. Means, SSO between Webdynpro and web service not completed.

What could be the problem behind this?

Regards,

Bhavik

Add comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

2 Answers

  • author's profile photo
    Former Member
    Oct 04, 2005 at 03:44 PM

    Hi,

    I think the problem is that ths SSO header is not added to security protocol when calling the web service. You can try this to add the ticket before calling the ws:

    serviceImpl service = WebServiceModel.getServiceImpl();

    yourServiceViDocument logicalPort = (yourServiceViDocument) service.getLogicalPort("Config1Port_Document" , yourServiceViDocument.class );

    BaseGeneratedStub stubForLogicalPort = (BaseGeneratedStub) logicalPort ;

    SecurityProtocol securityProtocol = (SecurityProtocol) stubForLogicalPort._getGlobalProtocols().getProtocol("SecurityProtocol");

    securityProtocol.addHeader("Cookie","MYSAPSSO2="getSSOTicket()";");

    private String getSSOTicket() {

    IWDMessageManager msgMgr = wdThis.wdGetAPI().getComponent().getMessageManager();

    try {

    HttpServletRequest req = TaskBinder.getCurrentTask().getWebContextAdapter().getHttpServletRequest();

    if (req != null)

    return SSOSession.getSSOTicket(req);

    else

    return"";

    } catch (Exception e) {

    msgMgr.reportException(e.getLocalizedMessage(), true);

    return "";

    }

    }

    Add comment
    10|10000 characters needed characters exceeded

  • author's profile photo
    Former Member
    Oct 05, 2005 at 03:54 AM

    Hi,

    I need not to include SSO ticket explicitly. This thing will be done by HTTP Destination.

    I have resolved this problem. I missed one reference to this HTTP destination. I have added and now its working fine.

    Regards,

    Bhavik

    Add comment
    10|10000 characters needed characters exceeded