Forum Stats

  • 3,769,223 Users
  • 2,252,930 Discussions
  • 7,874,951 Comments

Discussions

Error:401 in WSDL while adding as a service

Hi,

i am getting error while adding one wsdl file as a service in jdev.

The Error is 401 http error.

My WSDL is password protected.

where i need to add its credential?

pastedImage_2.png

Tagged:
Marcin Izdebski

Answers

  • Marcin Izdebski
    Marcin Izdebski Member Posts: 273
    edited Feb 19, 2018 4:16AM

    401 error while calling secured WSDL from JDeveloper (Doc ID 2072105.1)

    APPLIES TO:

    Oracle SOA Suite - Version 11.1.1.6.0 and later
    Information in this document applies to any platform.

    SYMPTOMS

    On JDev 11.1.1.6.0 or 11.1.1.7.0 version


    When attempting to create a partnerlink to a wsdl which is protected by a username and password, the partnerlink is not created and the following error occurs:

    Error while reading wsdl file
    https://testserver.us.oracle.com/SO/IntegrationServices/ScheduleService.svc?
    wsdl.Exception:
    WSDLException: faultCode=OTHER_ERROR: Failed to read WSDL from
    https://testserver.us.oracle.com/SO/IntegrationServices/ScheduleService.svc?
    wsdl: HTTP connection error is 401

    CAUSE

    Bug 21804943

    According to this Bug, WSDL basic authentication is not supported for design time

    SOLUTION

    As a workaround please use -J-Dsoa.enable.wsdl.authentication=true to start JDeveloper and copy the wsdl and its references to the project

    Steps

    ==========

    1. 1. Use the windows explorer to navigate to the folder where JDev is located
      For example :

      C:\Oracle\JDev11117\jdeveloper

      2. Navigate to jdev bin
      For example:

      C:\Oracle\JDev11117\jdeveloper\jdev\bin

      3. select the bin folder on the right panel, right click and select "CMD Prompt Here as Administrator"
      In the command prompt window enter:

      jdev.exe -J-Dsoa.enable.wsdl.authentication=true

      Example:
      C:\Oracle\JDev11117\jdeveloper\jdev\bin>jdev.exe -J-Dsoa.enable.wsdl.authentication=true


    2. 4. Once JDeveloper launches
      On the component palette, select "web service" component and drag and drop it to the "External References" section
      The "Create Web Service" wizard will shown
    3. 5. On the WSDL URL enter the secured wsdl
      hit tab key on your keyboard
      JDeveloper will ask you for username and password of the secured wsdl, enter the credentials

      6. Mark the checkbox "copy wsdl and its dependent artifacts into the project"

      Click OK
      On the Localize Files, keep the default copy options
      Click OK
  • Ankit kalanoria
    Ankit kalanoria Member Posts: 107
    edited Mar 2, 2018 4:41AM

    Here is what i usually do for such situations:

    1) Enter url of your wsdl in  browser and download the content (In your browser - enter credential as it will ask in popup). So basically we will localize WSDL and XSD file either within project or in MDS.

    2) Convert WSDL to abstract WSDL and create partner link for it.

    3) In Composite.xml, modify location and binding for reference of partner link with actual data.

    3) Attach appropriate username token policy to partner link so that at runtime, authorization will happen while invoking the service.

    Hope this helps.

    Regards,

    Ankit K

    Marcin Izdebski
This discussion has been closed.