Skip to Content
author's profile photo Former Member
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 a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

2 Answers

  • author's profile photo Former Member
    Former Member
    Posted on 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 a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on 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 a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.