Basic auth with RESTful WEb service and Web Service reference

Hi, All,
We have made much progress on getting an application working wtih RESTful web services but now are trying to figure out how to lock down a RESTful Web service while making it available for a particular application.
We are using one of the sample 'emp' table web services that come with Apex 4.2 and are trying to apply Basic Auth to the WEb Service via Weblogic filter defined in the web.xml file. That works fine. I now get challenged when I try to go to :
https://wlogic.edu/apex/bnr/ace/hr/empinfo/
And when I authenticate to that challenge I am able to get the data. (we are usiing LDAP authentication at the Weblogic level)
However, I am not sure how to get same basic authentication to work with the Web Service reference in my application. I see the error message in the application when I try to call that Web Service:
401--Unauthorized<
And I see:
"The request requires user authentication. The response MUST include a WWW-Authenticate header field (section 14.46) containing a challenge applicable to the requested resource. The client MAY repeat the request with a suitable Authorization header field (section 14.8). If the request already included Authorization credentials"
How do I provide the credentials in the Web REference or do I provide credentials in the Application?
Web service works fine if I remove the RESTful web service basic auth from the Web.xml file.
Should we NOT use Weblogic basic auth and instead use basic auth from Workspace RESTful web service definition. If so, how do we implement THAT basic auth in the Web Service definition and in the Web SErvice Reference on the application?
Thanks,
Pat

What I mean is diid you try to use the PL/SQL package for APEX webservice. Here is an example I use (modified and shortened, just to show how much better this is than to use it from the application).
CREATE OR REPLACE PACKAGE webservice_pkg
IS
   PROCEDURE create_webservice (
      p_id            IN       NUMBER,
      p_message       OUT      VARCHAR2,
      p_workspace     IN       VARCHAR2 DEFAULT 'MY_WORKSPACE',
      p_app_id        IN       NUMBER DEFAULT v ('APP_ID'),
      p_app_session   IN       VARCHAR2 DEFAULT v ('SESSION'),
      p_app_user      IN       VARCHAR2 DEFAULT v ('APP_USER')
END webservice_pkg;
CREATE OR REPLACE PACKAGE BODY webservice_pkg
IS
   PROCEDURE set_credentials (
      p_workspace     IN   VARCHAR2,
      p_app_id        IN   NUMBER,
      p_app_session   IN   VARCHAR2,
      p_app_user      IN   VARCHAR2
   IS
      v_workspace_id   NUMBER;
   BEGIN
      SELECT workspace_id
        INTO v_workspace_id
        FROM apex_workspaces
       WHERE workspace = p_workspace;
      apex_util.set_security_group_id (v_workspace_id);
      apex_application.g_flow_id := p_app_id;
      apex_application.g_instance := p_app_session;
      apex_application.g_user := p_app_user;
   END set_credentials;
   PROCEDURE create_webservice (
      p_id            IN       NUMBER,
      p_message       OUT      VARCHAR2,
      p_workspace     IN       VARCHAR2 DEFAULT 'MY_WORKSPACE',
      p_app_id        IN       NUMBER DEFAULT v ('APP_ID'),
      p_app_session   IN       VARCHAR2 DEFAULT v ('SESSION'),
      p_app_user      IN       VARCHAR2 DEFAULT v ('APP_USER')
   IS
      v_envelope          VARCHAR2 (32000);
      v_server            VARCHAR2 (400);
      v_url               VARCHAR2 (4000);
      v_result_url        VARCHAR2 (1000);
      v_collection_name   VARCHAR2 (40)    := 'PDF_CARD';
      v_message           VARCHAR2 (4000);
      v_xmltype001        XMLTYPE;
   BEGIN
      v_url := v_server || '.myserver.net/services/VisitCardCreator?wsdl';
      FOR c IN (SELECT *
                  FROM DUAL)
      LOOP
         v_envelope :=
               '<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" '
            || 'xmlns:bran="http://www.myaddress.com">'
            || CHR (10)
            || '<soapenv:Header/><soapenv:Body>'
            || CHR (10)
            || '<parameter:'
            || 'some_value'
            || '>'
            || CHR (10)
            || '<bran:templateID>'
            || p_id
            || '</bran:templateID>'
            || '</soapenv:Body>'
            || CHR (10)
            || '</soapenv:Envelope>';
      END LOOP;
      set_credentials (p_workspace, p_app_id, p_app_session, p_app_user);
      BEGIN
         apex_web_service.make_request
                                     (p_url                  => v_url,
                                      p_collection_name      => v_collection_name,
                                      p_envelope             => v_envelope
         p_message := 'Some message.';
      EXCEPTION
         WHEN OTHERS
         THEN
            v_message :=
                  v_message
               || '</br>'
               || 'Error running Webservice Request. '
               || SQLERRM;
      END;
      BEGIN
         SELECT    v_result_url
                || EXTRACTVALUE (VALUE (t),
                                 '/*/' || 'Return',
                                 'xmlns="http://www.myaddress.com"'
                xmltype001
           INTO v_result_url,
                v_xmltype001
           FROM wwv_flow_collections c,
                TABLE
                    (XMLSEQUENCE (EXTRACT (c.xmltype001,
                                           '//' || 'Response',
                                           'xmlns="http://www.myaddress.com"'
                    ) t
          WHERE c.collection_name = v_collection_name;
      EXCEPTION
         WHEN OTHERS
         THEN
            v_message := v_message || '</br>' || 'Error reading Collection.';
      END;
   EXCEPTION
      WHEN OTHERS
      THEN
         p_message := v_message || '</br>' || SQLERRM;
   END create_webservice;
END webservice_pkg;
/If you use it this way, you will find out what the problem is much faster.
Denes Kubicek
http://deneskubicek.blogspot.com/
http://www.apress.com/9781430235125
http://apex.oracle.com/pls/apex/f?p=31517:1
http://www.amazon.de/Oracle-APEX-XE-Praxis/dp/3826655494
-------------------------------------------------------------------

Similar Messages

  • Diff b/w Web service and window service

    What is the difference between web service and window service, whether the both are same or not, Give some explain about that each one and give some examples also.

    An XML Web service is a component that implements program
    logic and provides functionality for diseparate
    applications. These applications use standard protocols,
    such as HTTP, XML, and SOAP, to access the functionality.
    XML Web services use XML-based messaging to send and
    receive data, which enables heterogeneous applications to
    interoperate with each other. You can use XML Web services
    to integrate applications that are written in different
    programming languages and deployed on different platforms.
    In addition, you can deploy XML Web services within an
    intranet as well as on the Internet. While the Internet
    brings users closer to organizations, XML Web services
    allow organizations to integrate their applications.
    A Windows service starts much before any user logs in to
    the system (if it has been setup to start at boot up
    process). A Windows service can also be setup in such a way
    that it requires a user to start it manually ? the ultimate
    customization!
    Windows services run as background processes. These
    applications do not have a user interface, which makes them
    ideal for tasks that do not require any user interaction.
    You can install a Windows service on any server or computer
    that is running Windows 2000, Windows XP, or Windows NT.
    You can also specify a Windows service to run in the
    security context of a specific user account that is
    different from the logged on user account or the default
    computer account. For example, you can create a Windows
    service to monitor performance counter data and react to
    threshold values in a database.

  • Error when opening workspace, web analysis and shared services

    Hi All,
    We installed hyperion 11.1.2, Essbase on a AIX server, with reports etc on a windows 2008 server. when logging onto workspace, web analysis and shared services i get the following error message:
    Error 404--Not Found
    From RFC 2068 Hypertext Transfer Protocol -- HTTP/1.1:
    10.4.5 404 Not Found
    The server has not found anything matching the Request-URI. No indication is given of whether the condition is temporary or permanent.
    If the server does not wish to make this information available to the client, the status code 403 (Forbidden) can be used instead. The 410 (Gone) status code SHOULD be used if the server knows, through some internally configurable mechanism, that an old resource is permanently unavailable and has no forwarding address.
    If we re-start the server it sometimes work, but in the morining we have the same issue, can anyone help.
    Thanks
    Dylan

    Hi,
    Restart the services. Issue with Oracle Http server. If you restart foundation and other services I can bring workspace up.
    Thanks
    Radhika

  • Custom Portal Services and Web services

    Can you please tell me what exactly are "custom portal services" and "web services" with a business like/ real life example?
    How do you go about developing deploying and utilizing these services in Portal?
    Thanks.

    Hi navin,
    Thanks for the par file.
    Duly awarded points.
    I need your help again.
    I wish to use the method
    public String getWelcomeString(String name)
    in my own portal application to test usage of portal services.
    So I uploaded your par file on my server.
    Then I added the api and core jar files which came along with your par in my project as external jar files.
    I imported com.wickes.WickesService.*;
    Next, to use the service I coded:
    IPortalRuntimeResources rs =
    PortalRuntime.getRuntimeResources();
         IWickesService ws = (IWickesService) rs.getService(IWickesService.KEY);
    But now I am stuck and I dont know how to proceed.
    Please help.

  • Entity Services and Web Dynpro

    Hi,
    I want to implement a Web Dynpro with relation to a database (Entity Service and Application Services modeled with NWDS).
    I used the following tutorial
    , but when I want to add a "Used model", the selection list is empty and so its not possible to do that.
    Why is it empty, I implemented exactly after the tutorial?
    <a href="https://www.sdn.sap.comhttp://www.sdn.sap.comhttp://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/8b7059da-0c01-0010-e09c-9ecabaf58864">Example Tutorial (Page 16)</a>
    I really need help for that, because I want to implement a Info Callable Object, which shows Entries from the tables. The table should be filled within the actions, and so I need a relation to entity level.
    Thanks in advance
    Steve

    Hi Steve,
    In order to search the SDN forums effectively I suggest to:
    - Select 'Forums' (top menu bar)
    - Select topic of interest (in this case 'SAP NetWeaver > Developing Composites with CAF')
    - Enter your search keywords not in the upper left but in the upper middle search box 'Forum Search'
    This way the search is more likely to meet your expectations.
    Regards,
    Axel

  • My envy 110 works but the web services and eprint services give "connection error". what to do?

    My family use  Macs and Apple Deskbook and a BT Homehub network. The HP troubleshooting instructions do not always match what is on computer screen. The menu paths that HP gives sometimes do not exist.
    The Envy 110 printer was working fine but it often could not be found by the computers so I followed HP instructions to set a Static IP Address on the Printer. But now the Web Service and ePrint Service give a "connection error".    Any suggestions? I am annoyed that HP don't give a phone number to help.

    When you set that static IP on the printer, make sure of 2 things:
    1. The IP address is outside the DHCP range of the router.
    2. Use an external DNS, like Google DNS: 8.8.8.8 and 8.8.4.4
    Say thanks by clicking "Kudos" "thumbs up" in the post that helped you.
    I am employed by HP

  • Diference Between Web Intelligence and Web Intelligence Rich Client?

    Hey Guys,
    Do you know the difference between Web Intelligence and Web Intelligence Rich Client?
    I was asked about that but i couldnt help. And i need to make a decision about a Web Intelligence training. I need to decide using one or another.
    Thanks
    Vegas

    Hi Vegas,
    The Webintelligence Rich Client (WRC) has all the features of the thin webintelligence client. But WRC makes use of the client processor and memory to do all post query processing while Infoview Webi sends every request to the server for processing.
    Thus you won't find any difference between the time taken to retrieve data from the database between these two clients. But there would be huge difference in performance while doing further analysis, formatting  with the data. Also you will not need connectivity to the network to do analysis and formatting using the WRC client.
    WRC client will help you to just retrieve the data on the fly and let you play around with it while you are traveling with no network connectivity.
    Thanks
    Mohanraj CP
    http://blog,mohanraj.org

  • Reports Web Cartridge and Web CGI

    How Reports Web Cartridge and Web CGI
    converts url into pdf and html output.

    <BLOCKQUOTE><font size="1" face="Verdana, Arial">quote:</font><HR>Originally posted by [email protected]:
    It is my understanding that neither of the above is used by Oracle Forms with the run_product statement for WEB applications. Can anyone tell me if either of the above is used by Oracle Forms with the statement run_report_object?
    I'm asking because I want to know that if I use the run_report_object built-in (WEB environment)which replaces run_product
    (Client/Server environment), will it be able to display the parameter form as run_product currently does in the Client/Server environment. I am talking about Oracle forms calling Oracle reports.
    <HR></BLOCKQUOTE>
    Did you ever get an answer to your problem. I having trouble with bringing forms over from client server to web, I can't get a parameter form to run. I've been told to use paramform=html in the URL but where is it? Where do I place this statement?
    null

  • Basic Auth with WebView

    Hello everyone,
    we have integrated some JavaFX components within a swing application recently. One of the components that we have decided to add is a WebView component that should access an html page with the account settings of the logged in user.
    However, this page has restricted access with HTTP Basic Auth type of authorization and for this reason the WebView gets the 401 HTTP error.
    Is it possible to perform the HTTP Basic Auth programmatically (by setting username and password) with the WebView?
    Thanks in advance for your help,
    LM

    I have solved by using java.net.Authenticator

  • How to make the web part and web part zone smaller?

    Hello Community
        On WS2012 running SharePoint 2013 Server when you edit a page
    the web part zone is big and when you add the web part the web part 
    is big also.
        So the question is how to you make web parts and web part zone
    smaller?
        Thank you
        Shabeaut

    Hi,
    According to your description, my understanding is that you want to make the web part zone and web part smaller.
    When you edit a page, you could change the height and width of the web part in Edit Web Part -> Appearance by typing in the Height and Width field. The size of the web part zone changes with the web part.
    Best Regards,
    Dean Wang
    TechNet Community Support
    Please remember to mark the replies as answers if they help, and unmark the answers if they provide no help. If you have feedback for TechNet Support, contact
    [email protected]

  • What is difference between Web Console and Web SAPConsole

    Hello,
    What is the difference between Web Console and Web SAPConsole.
    Thanks,
    Milind M.

    Hello Milind,
    I am not sure that there is any difference between Web console and Web SAP Console.
    But of course, there is a lot difference between SAP Console and SAP Webconsole.
    Using SAP console you can use mobile data entery with Character support where as with the help of SAP webconsole you can use web supported mobile data entry in which you can use touch screen device.
    Hope this helps.
    Regards
    Arif Mansuri

  • LDAP Services and Shared services not starting

    Our foundation services are based in a Win server
    We had a problem with the server and it required to be restarted, by now the front end Hyperion services such as Web Analysis are up but Shared services and LDAP services not. We tried to start them manually and even running the exec but it is not working.
    Any help?
    best

    Just to add a few words to John's suggestion, this problem usually occurs when an abnormal shutdown takes place on shared services server. The backend database engine is a compact db called Berkeley. Fortunately crashes generally affect logs rather than the data. In such cases like yours I simply copy db_recover.exe from below folder
    %Hyperion_Home%\SharedServices\9.3.1\openLDAP\bdb\bin
    to below folder
    D:\Hyperion\SharedServices\9.3.1\openLDAP\var\openldap-data
    and double click on db_recover.exe in this folder. It has fixed my problems so far. However, getting a directory backup of above directory doesn't hurt. So, do this at your own risk after minimizing your risk by taking a backup.
    Cheers,
    Alp

  • Apple Mobile Device service and Ipod Service both necessary?

    Do I need both Apple Mobile Device service and Ipod Service running on my Windows XP machine in order to use an iPod Touch Gen4?  I have to restart both of these services to get iTunes 11.0.4.4 to recognize it.  I wonder if they conflict with one another.

    Both need to be running.
    Try:
    Removing and Reinstalling iTunes, QuickTime, and other software components for Windows XP

  • RMI Service and FR Service abrupt shutdown

    Hi guys,
    I got problem with my BI 931 services, and it's weird since the behavior is randomly happen.
    The FR Server services and RMI services sometimes abrupt shut down, this is development server so the users are minimal (some cases no one using it at all).
    The architecture is like below (all of them are VMWares)
    1 essbase 931 server
    1 HBI Services server + SQL Server 2000
    1 HBI UIServices server
    It can't be network problem because DB and the services is under the same machine.
    Through the logs and found some errors but I think below err desc has the highest possibilities;
    Mon, 22 Sep 2008 13:55:10.0000000 [BRACKISH:9548] (IT_ATLI2_IOP:105) W - ATLI2 Failure occurred on connection to 10.10.11.109.3005: WSARecv() failed in TCPConnectionImpl::dispatch_failed() with: An existing connection was forcibly closed by the remote host.
    < Started by Process Monitor's I/O thead - Type-->BIID(0) >
    Wed, 08 Oct 2008 12:21:46.0000000 [BRACKISH:11748] (IT_ATLI2_IP:101) W - ATLI2 failure receiving data with minor_code 0 occurred in TCPConnectionImpl::dispatch_failed()
    < Started by Process Monitor's I/O thead - Type-->BIID(0) >
    Anybody can help or give me clue? Quite desperate here.
    Thanks
    Daniel -

    Anyone??

  • If i  bring mac in for service and the service is expred what do they charge me to look and give me an estimate

    if i  bring mac in for service and the service is expred what do they charge me to look and give me an estimate

    There is no charge for diagnosis.

Maybe you are looking for

  • Why is the file browser unable to sort by date added (Safari, Mail, etc)?

    When I use the file browser (e.g. when I browse for a file to attach to an email or browse for a file to upload through a form) and try to sort by date added, it doesn't work. I can see the column for "date added" and it displays the correct date. I

  • Internet keeps quitting on me.....?????

    Just about every other day my Macbook loses connection to the internet. I'm pretty sure its not the computer. I have a Motorola Cable modem and a Netgear wireless G router. If I unplug them both and let them reset, everything works fine again. The Mo

  • Sync New Music Libr

    Hi, I created a new music library located in a directory in a partitition that is not on the system disk (for space opportunity), when i tried to sync with my Zen Micro the only Music Library in the menu is the default one. Why I can't see the new on

  • Issue with To_number when we submit Shipping report from Document set

    Hi All We have a report in Shipping responsibility which works fine when we submit from Standard Request form, when we submit through Document set we are getting error as Invalid Number for to_number conversion in formula columns which is ok from sql

  • Photoshop scripting question

    HI I am new to this whole scripting for photoshop and hope someone could help me along. What i am looking for is to either create an Adobe Photoshop script, or with flash builder build an photoshop extension that does the following. On a server i hav