REST Webservices security

I am trying to set up the REST Webservices module, but I seem to be running into issues with security and authentication. I can get sessions from the client side properly, but I cannot call any methods on components.
*/atg/rest/security/restSecurityConfiguration.xml*
<programlisting>
  <rest-security>
    <default-acl value="EVERYONE:read,write,execute"/>
      <resource component="/path/to/component/TestComponent" secure="false" requiresSessionConfirmation="false">
        <method name="getTestComponentName" secure="false">
          <acl value="EVERYONE:read,write,execute" />
        </method>
      </resource>
  </rest-security>
</programlisting>
TestComponent.java
public class TestComponent {
  public String getTestComponentName() {
    return this.getClass().getCanonicalName();
}I have turned on the DEBUG level logging in ACC for the RestSecurityProcessor and this is what I see in my logs when I try to access my TestComponent (which is just testing to see if I have access to methods):
INFO  [RestSecurityProcessor] DEBUG Received POST request for
INFO  [RestSecurityProcessor] DEBUG Resource container is valid component. Returning true.
INFO  [RestSecurityProcessor] DEBUG handlePostRequest: Handling component /path/to/component/TestComponent
INFO  [RestSecurityProcessor] DEBUG getParentSecurityConfiguration: Looking for wild card ComponentSecurityConfiguration for component /path/to/component/TestComponent
INFO  [RestSecurityProcessor] DEBUG getParentSecurityConfiguration: Looking for default ComponentSecurityConfiguration
INFO  [RestSecurityProcessor] DEBUG handlePostRequest: Can't find ComponentSecurityConfiguration for component /path/to/component/TestComponent
ERROR [RestSecurityServlet] Error code: 401
Access to the requested resource is not allowed: /path/to/component/TestComponent
atg.rest.RestException: Access to the requested resource is not allowed: /path/to/component/TestComponent
     at atg.rest.processor.RestSecurityProcessor.handlePostRequest(RestSecurityProcessor.java:315)
     at atg.rest.processor.RestSecurityProcessor.doRESTPost(RestSecurityProcessor.java:208)
     at atg.rest.servlet.RestPipelineServlet.serviceRESTRequest(RestPipelineServlet.java:406)
*snip*Edited by: Gommy on Apr 8, 2013 6:19 AM - Fix typo in package path

After finding a default restSecurityConfiguration.xml inside of REST/config.jar:/atg/rest/security/, I located a .dtd ( http://www.atg.com/dtds/rest/restSecurity_1.0.dtd ) to figure out what exactly ATG was expecting for a configuration.
1. Turns out the <programlisting> tag isn't expected (error in the documentation for our version of ATG, apparently), <rest-security> is the top-level element for this configuration file. This was causing the file to not be parsed at all.
2. requiresSessionConfirmation does not exist on the resource element.
The TestComponent and its properties were correct. Just the restSecurityConfiguration.xml was incorrect due to very poor documentation, no full example to see what a correct file should look like, and lack of obvious schemas (i.e., no schemas or links to schemas are provided in any documentation) to validate against.

Similar Messages

  • Call secure RestFul WebService with basic authorization via https

    Hi,
    is there a way to call a secure RestFul WebService with basic authorization via https from APEX?
    Database: Oracle 11g XE
    APEX: 4.2.1
    I have a solution by calling the WebService from Java which was called from the database via scheduled job (execute).
    As my hosting partner does not support Java I am looking for another option.
    Regards
    Markus

    Hi,
    I think its not possible, in this link you can find in more detail why.
    Its related with the use of wallets to acess https requests.
    http://www.apexninjas.com/blog/2011/06/https-access-with-utl_http-on-oracle-xe-has-anyone-managed-to-do-this/
    Edit: Because you are using Oracle XE
    Edited by: carlos.pereira on Jan 23, 2013 6:15 PM

  • Error while bringing up ATG REST Webservice

    Hi,
    I am trying to bring a REST Webservice using ATG 9.3 version.I am getting the below errors in the startup of the instance.I have added "REST" module in the Manifest file and am able to see the entry " C:\ATG\ATG9.3\REST\config\config.jar" in CONFIGPATH(Please let me know if there are other ways to find if the service has come up properly).I am trying to connect to the server using JAVA based REST Client as given below.Also,i have placed the jar files in the CLASSPATH of the module.I am hoping that the webservice have not come up properly because of these startup errors.Please help me out to resolve this issue.
    STARTUP EXCEPTION SEEN IN SERVER
    ========================
    2012-06-25 06:20:36,815 INFO [STDOUT] Unable to create class atg.rest.servlet.HeadRestServlet for configuration /atg/dynamo/servlet/dafpipeline/HeadRestServlet java.lang.ClassNotFoundException: No ClassLoaders found for: atg.rest.servlet.HeadRestServlet
    2012-06-25 06:21:56,325 INFO [nucleusNamespace.atg.userprofiling.sso.PassportAuthorityService] Starting passport authority service
    2012-06-25 06:21:56,460 INFO [STDOUT] **** Error
    2012-06-25 06:21:56,460 INFO [STDOUT]      
    2012-06-25 06:21:56,460 INFO [STDOUT] Mon Jun 25 06:21:56 EDT 2012
    2012-06-25 06:21:56,460 INFO [STDOUT]      
    2012-06-25 06:21:56,460 INFO [STDOUT] 1340619716460
    2012-06-25 06:21:56,460 INFO [STDOUT]      
    2012-06-25 06:21:56,460 INFO [STDOUT] /
    2012-06-25 06:21:56,460 INFO [STDOUT]      
    2012-06-25 06:21:56,460 INFO [STDOUT] Unable to set configured property "/atg/dynamo/servlet/Initial.initialServices" atg.nucleus.ConfigurationException: Unable to resolve component /atg/dynamo/servlet/dafpipeline/HeadRestServlet
    2012-06-25 06:22:06,528 INFO [STDOUT] Unable to create class atg.rest.RestConfiguration for configuration /atg/rest/Configuration java.lang.ClassNotFoundException: No ClassLoaders found for: atg.rest.RestConfiguration
    2012-06-25 06:22:06,528 INFO [STDOUT] **** Error
    2012-06-25 06:22:06,528 INFO [STDOUT]      
    2012-06-25 06:22:06,528 INFO [STDOUT] Mon Jun 25 06:22:06 EDT 2012
    2012-06-25 06:22:06,528 INFO [STDOUT]      
    2012-06-25 06:22:06,528 INFO [STDOUT] 1340619726528
    2012-06-25 06:22:06,528 INFO [STDOUT]      
    2012-06-25 06:22:06,528 INFO [STDOUT] /
    2012-06-25 06:22:06,528 INFO [STDOUT]      
    2012-06-25 06:22:06,528 INFO [STDOUT] Unable to set configured property "/atg/rest/Initial.initialServices" atg.nucleus.ConfigurationException: Unable to resolve component /atg/rest/Configuration
    CLASSPATH ENTRY
    ============
    <classpathentry exported="true" kind="var" path="C:/ATG/ATG9.3/REST/lib/atg-rest-1.0.jar"/>
         <classpathentry exported="true" kind="var" path="C:/ATG/ATG9.3/REST/lib/commons-fileupload-1.2.1.jar"/>
         <classpathentry exported="true" kind="var" path="C:/ATG/ATG9.3/REST/lib/commons-io-1.4.jar"/>
         <classpathentry exported="true" kind="var" path="C:/ATG/ATG9.3/REST/lib/dom4j-1.6.1.jar"/>
         <classpathentry exported="true" kind="var" path="C:/ATG/ATG9.3/REST/lib/log4j-1.2.15.jar"/>
         <classpathentry exported="true" kind="var" path="C:/ATG/ATG9.3/REST/client-lib/java/atg-rest-client-1.0.jar"/>
    REST CLIENT:
    ========
    import java.util.HashMap;
    import java.util.Map;
    import atg.rest.client.RestClientException;
    import atg.rest.client.RestComponentHelper;
    import atg.rest.client.RestResult;
    import atg.rest.client.RestSession;
    public class RestClient {
    RestSession mSession;
    protected void execute() throws RestClientException {
         System.out.println("inside execute");
         mSession = RestSession.createSession("localhost", 8080, "<USERNAME>", "<PASSWORD>");
         mSession.setUseHttpsForLogin(false);
         try {
         mSession.login();
         System.out.println("Login Successful");
         catch (Throwable t) {
         System.out.println(t);
         finally {
         try {
         mSession.logout();
         System.out.println("Logout Successful");
         catch (RestClientException e) {
         System.out.println(e);
    * @param args
    public static void main(String[] args) {
         System.out.println("inside main");
         // TODO Auto-generated method stub
         RestClient testATGRest = new RestClient();
         try {
         testATGRest.execute();
         catch (Throwable t) {
         System.out.println(t);
    REST CLIENT ERROR SEEN:
    =================
    atg.rest.client.RestClientException: java.io.IOException: Not Found http://localhost:8080/rest/bean/atg/userprofiling/ProfileServices/loginUser
    atg.rest.client.RestClientException: This session is not logged in and cannot be logged out

    I am trying to expose a method using REST Webservice and access the method using the browser.I have followed the steps specified in the thread:
    http://ecomwriter.com/2012/03/19/building-restful-web-services-using-atg/ .Have added a component called ProfileRESTWebservice and have defined a method “getLoginInfo” in the class file. The following entry is placed in the restSecurityConfiguration.xml
    <resource component="/atg/userprofiling/ProfileRESTWebservice" secure="true">
    <method name="getLoginInfo" secure="false"></method>
    </resource>
    But, I am receiving the following exception when trying to access the method using http://localhost:8080/rest/bean/atg/userprofiling/ProfileRESTWebservice/getLoginInfo
    10:07:33,147 ERROR [BeanServlet] Error code: 400
    atg.beans.PropertyNotFoundException: Can't find property named: getLoginInfo in class: com.vs.commerce.profile.ProfileRESTWebservice
    Can't find property named: getLoginInfo in class: com.vs.commerce.profile.ProfileRESTWebservice
    atg.rest.RestException: atg.beans.PropertyNotFoundException: Can't find property named: getLoginInfo in class: com.vs.commerce.profile.ProfileRESTWebservice
    at atg.rest.output.RestOutputCustomizerImpl.outputBeanProperty(RestOutputCustomizerImpl.java:616)
    at atg.rest.processor.BeanProcessor.doRESTGet(BeanProcessor.java:157)
    at atg.rest.servlet.RestPipelineServlet.serviceRESTRequest(RestPipelineServlet.java:394)
    at atg.rest.servlet.RestPipelineServlet.service(RestPipelineServlet.java:237)
    at atg.servlet.pipeline.PipelineableServletImpl.passRequest(PipelineableServletImpl.java:135)
    at atg.servlet.pipeline.PipelineableServletImpl.service(PipelineableServletImpl.java:298)
    at atg.rest.servlet.RestPipelineServlet.service(RestPipelineServlet.java:241)
    Can you pl help me out on this?

  • Making a REST webservice call. Error code: 401 Access to the requested resource is not allowed

    Hi All,
    I’m having a hard time figuring out how to make Rest WebService calls.
    I tried executing this directly through browser and I get an error.
    http:localhost:8080/rest/bean/atg/userprofiling/ProfileServices/loginUser?arg1=[email protected]&arg2=Password
    13:18:20,613 ERROR [RestSecurityServlet] Error code: 401
    Access to the requested resource is not allowed: /atg/userprofiling/ProfileServices
    atg.rest.RestException: Access to the requested resource is not allowed: /atg/userprofiling/ProfileServices
    at atg.rest.processor.RestSecurityProcessor.checkAccess(RestSecurityProcessor.java:546)
    at atg.rest.processor.RestSecurityProcessor.handleGetRequest(RestSecurityProcessor.java:313)
    at atg.rest.processor.RestSecurityProcessor.doRESTGet(RestSecurityProcessor.java:199)
    at atg.rest.servlet.RestPipelineServlet.serviceRESTRequest(RestPipelineServlet.java:417)
    at atg.rest.servlet.RestPipelineServlet.service(RestPipelineServlet.java:260)
    at atg.servlet.pipeline.PipelineableServletImpl.passRequest(PipelineableServletImpl.java:157)
    at atg.servlet.pipeline.PipelineableServletImpl.service(PipelineableServletImpl.java:320)
    at atg.rest.servlet.RestPipelineServlet.service(RestPipelineServlet.java:264)
    at atg.rest.servlet.HeadRestServlet.service(HeadRestServlet.java:130)
    at atg.servlet.pipeline.PipelineableServletImpl.service(PipelineableServletImpl.java:267)
    From the documentation I understand that I need to create a session, is the session only necessary to access secured components since this
    particular method “ProfileServices.loginUser “ has been declared as not secure in restSecurityConfiguration.xml
    Also, are there two different ways in which I can log in
    1.       Using RestSession.createSession providing the username and password.
    2.       Or using ProfileServices.loginUser or ProfileFormHandler
      Can someone please clarify

    If you are invoking the REST web-service from a Java client then you can create a RestSession object using the createSession method. But in your case you seem to be invoking it with a HTTP request which by default would be treated as a GET request by ATG's REST implementation. Therefore being a GET, it would try to fetch a property "loginUser" from /atg/userprofiling/ProfileServices component (based on your URL) which would always fail.
    To invoke loginUser() method of ProfileServices with your passed argument you need to tell ATG's REST system to treat your incoming request not as GET but as a POST request which you can do using  atg-rest-http-method control parameter in your request like this
    http:localhost:8080/rest/bean/atg/userprofiling/ProfileServices/loginUser?arg1=[email protected]&arg2=Password&atg-rest-http-method=POST
    It should work this way provided your restSecurityConfiguration.xml is proper.

  • Getting error response while trying to access REST webservice through Powerbuilder

    Hi Team,
    I am trying to access a rest webservice through powerbuilder 12.5(.net).The rest webservice is secured through basic authentication.I am passing the userid and password through powerbuilder to acess the service,But its returning an error .But while i am trying to accss the same REST webservice through SOAPUI, i am able to get the response.
    Please find the below line of code which i have written in powerbuilder.
    p_testcleint2 lp_rest
    string ls_string
    lp_rest=create p_testcleint2
    PBWebHttp.WebClientCredential lsCredential             //configure credentials
    lsCredential = create PBWebHttp.WebClientCredential
    lsCredential.AccessAuthentication = PBWebHttp.AuthenticationMode.Basic!
    lsCredential.Password='Pa$$word1!'
    lsCredential.Username='admin'
    lp_rest.restConnectionObject.ClientCredential = lsCredential  //add credentials to connection
    try
       lp_rest.PostMessage()
    catch (System.Exception ee)
      messagebox("Failure",string(ee.Message))
    end try
    Error i am getting as below :
    The remote server returned an error:(401) unauthorized.
    Can you please let me know why this error is coming or do i need to any extra paramert in the lsCredential to handle this.
    Thanks in advance.
    Regards
    Subrat

    Hi Chris,
    Thanks for the reply.
    Yes i checked -in fiddler, the basic authentication request is not generating in the fiddler.
    In the same Rest service if i turned off the basic authentication then call is happening in Powerbuilder and its displaying in fiddler also.
    Regards
    Subrat

  • Getting OutOfMemoryError with REST webservice

    Hi,
    I need some help with my configuration regarding
    the listener (version 2.0.1.64.14.25 as stand alone with Application Express 4.2.1.00.08):
    I consume (via $.ajax(...)) a REST-Webservice for request a clob value.
    Configuration of my Ressource Handler:
    method: GET
    Requires Secure Access: No
    source type: "Query one Row"
    Pagination Size: 1
    Source: select id, col3 from csvloader where id = :ID
    This works as excepted until I want to load a value that is bigger then 65 kb.
    In my cmd box, where the listener is stated, I noticed the following error:
    22.03.2013 14:18:49 oracle.dbtools.rt.web.WebErrorResponse internalError
    SCHWERWIEGEND: Java heap space
    java.lang.OutOfMemoryError: Java heap space
    ("SCHWERWIEGEND" means "fatal" in german)
    In order to avoid this error, I tried to increase the heap space:
    java -Xms500m -Xmx1024m -jar apex.war
    -> no change, still getting OutOfMemoryError (HTTP 500 Errorcode)
    Any suggestions, hints?
    Thanks for your help!
    Michael

    Hi!
    I'm still working on this topic. I updated the listener to the newest version 2.0.2.133.14.47
    but this is not a solution for my problem.
    Steps I've done:
    - raised JVM-Memory: GlassFish -> JVM configuration -> JVM options: add/set "-Xmx1024m" and "-XX:MaxPermSize=256m"
    - raise "-Xmx1024m" to "-Xmx1224m" -> glassfish doesn-'t start
    Maybe I have a problem with my os: I use windows XP (32bit) in a virtual machine. Seems that JVM don't get enough
    memory. On the other hand, I just want to get about 65 - 72,5 KB from a blob-field to my browser....
    Any suggestions for me?
    Thanks a lot!
    Michael

  • BO 4.1 WEBI Metadata extraction using Java Restful Webservice

    Hi
    We are building an application using the Restful webservice and are trying to extract the metadata from the webi report.
    Whether there is any URL to retrieve Query filter in web Intelligence Report.
    Please help.
    Regards,
    Kavitha S

    Assuming this is a BEX query, you may want to check p. 296 in the following; SAP Web Intelligence RESTful web service SDK User Guide, SAP BusinessObjects Business Intelligence platform 4.1
    - Ludek
    Senior Support Engineer AGS Product Support, Global Support Center Canada
    Follow us on Twitter

  • Url service data control - problem while  POSTing to a restful webservice

    Hi,
    I am trying to call a restful webservice to add a new employee .I have created the url service data control. The service method consumes XML.
    When i am creating the url service datacontrol I selected the http method as POST and giving the servicepath and servicename as the source. After providing the xsd's path and all , when I test the url connection, I am getting the following error message:
    URL Test: Received Error: Method Not Allowed
    This might be because the clicking of the test url button is sending the get request, but the actual method is POST.
    Now under the data controls navigator, If i view the newly created data control, i could see the loadData(Object) method which i assume is for retrieving the data from the service. But since i have mentioned the method as POST, why such a method is created? Also if its there, can I use the same for insert and update? I have used this loadData (Object) method to create a button which calls the webservice upon click. Under the data control property inspector, i changed the supportsupdate attribute's value to true. But when i am trying to save the employee from the jspx page, I am getting the following message in the integrated weblogic's log
    Couldn't get access to the data source. Cause Unsupported Media Type exception in rest service
    And on the server side I am getting the following error message:
    No message body reader has been found for request class Employee, ContentType application/octet-stream.
    I think the request is not going as XML. But while creating the datacontrol i have specified the xsd document for the iput xml request. Does ADF automatically creates the XML from the input parametres? If it does not, then what could be done to achieve that? The default actionListener of the submit button is #{bindings.loadData.execute}. Do i have to override it to send the XML request? Or have I missed anything in trying to achieve what i intend?
    I had refered this link for reference :
    http://docs.oracle.com/cd/E18941_01/tutorials/jdtut_11r2_53/jdtut_11r2_53.html
    Rampal
    Edited by: user12011868 on Jan 22, 2012 10:03 PM

    Hi Frank,
    I had specified the HTTP method as POST as well as PUT. But the same error is appearing in the both the cases.
    URL Test: Received Error: Method Not Allowed
    And when I am clicking on the 'Test URL Connection' , I can't see any option of selecting the HTTP method. This option only appears in the step 2 of creating the URL service data control where we mention the URL endpoint and the source.
    What could be the reason for the error.
    Rampal

  • XML payload in RESTful webservice

    Hi all,
    Can anyone please suggest on how to call the RESTful webservice (which is used by our client) by passing an XML payload from a PL SQL stored procedure? It is for the authentication purpose. And the username and password has to be passed as the XML payload to the RESTful webservice . Please help, it's a bit urgent.
    Thanks in advance
    Geethu
    Edited by: 982489 on Mar 22, 2013 3:02 AM

    Hi all,
    Can anyone please suggest on how to call the RESTful webservice (which is used by our client) by passing an XML payload from a PL SQL stored procedure? It is for the authentication purpose. And the username and password has to be passed as the XML payload to the RESTful webservice . Please help, it's a bit urgent.
    Thanks in advance
    Geethu
    Edited by: 982489 on Mar 22, 2013 3:02 AM

  • How to set username and password before redirecting to a RESTful webservice

    I am a .Net developer who has developed a webservice used by my ColdFusion colleagues. They are using ColdFusion 9 but I'm not sure if they have incorporated any of the newer features of ColdFusion in their apps. Here is a snippet of how they have been invoking the webmethods:
    <cfscript>
                         ws = CreateObject("webservice", "#qTrim.webServiceName#");
                         ws.setUsername("#qTrim.trimAcct#");
                         ws.setPassword("#qTrim.trimpwd#");
                         wsString=ws.UploadFileCF("#qTrim.webserviceurl#","#objBinaryData#", "#qFiles.Filename#", "Document", "#MetaData#");
                </cfscript>
    As I understand things, the .setUsername and .setPassword correspond to the Windows credentials the CF Admin set when the URL of the .Net webservice was "registered" and given its "name" (for the CreateObject statement above). I have 4 webmethods that are all invoked in this manner and this SOAP protocol works adequately for us. Please note that this ColdFusion web app authenticates anonymous remote internet users by prompting for a username and password and compares them to an application database (i.e. Microsoft calls this "forms authentication"). Because only a few Windows domain accounts are authorized to call this .Net webservice, the above code always uses the same username/password constants and it all works.
    My question involves the newest webmethod added to the .Net webservice. It requires that callers must invoke it as a RESTful service which means it must be invoked by its URL. Here is a snippet of C# code that invokes it from an ASP.NET webclient:
                string r = txtRecordNumber.Text;
                string baseurl = "http://localhost/sdkTrimFileServiceASMX/FileService.asmx/DownloadFileCF?";
                StringBuilder url = new StringBuilder(baseurl);
                url.Append("trimURL="); url.Append(txtFakeURLParm.Text);
                url.Append("&");
                url.Append("TrimRecordNumber="); url.Append(txtRecordNumber.Text);
                Response.Redirect(url.ToString());
    I assume a ColdFusion script could easily build a full URL as above with appended querystring parameters and redirect. Is there some way for the CF code redirecting to a RESTful webservice (by way of its URL) to set the Username and Password to this Windows account mentioned above? When the DownloadFileCF webmethod is hit it must be with the credentials of this special Windows domain account. Can that be set by ColdFusion someway to mimic the result of the SOAP technique (the first snippet above).
    I hope my question is clear and someone can help me make suggestions to my ColdFusion colleagues. Thanks.

    Can you clarify what you mean by "establish a different Windows identity"?  Usually passing identity to a web site or service means adding something to the request's HTTP headers.  This could be a cookie in the case of .NET forms authentication or the "Authorization" header in the case of basic authentication.
    The SOAP web service invocation code you posted does use basic authentication, according to the CF docs "ColdFusion inserts the user name/password string in the authorization request header as a base64 binary encoded string, with a colon separating the user name and password. This method of passing the user name/password is compatible with the HTTP basic authentication mechanism used by web servers."
    http://help.adobe.com/en_US/ColdFusion/9.0/Developing/WSc3ff6d0ea77859461172e0811cbec13a13 -7fe0.html
    If you need to mimic the SOAP techinque you should have basic authentication enabled for your REST service endpoints.
    If your authentication method is different then CF developers will need to add the appropriate HTTP headers to their service calls.  Note that calling a REST service from CF would probably be accomplished using the CFHTTP tag if the service is designed to be consumed by the CF server.

  • Invalid request when calling REST-webservice with UTL_HTTP.

    Hello,
    When i try to send some data to a REST-webservice i get as response "INVALID REQUEST"
    I Think it is about the request-body that seems to be no UTF-8.
    I tried to set the characterset with utl_http.set_body_charset(t_http_req, 'UTF-8').
    But when i read the characterset with utl_http.get_body_charset(t_charset);, is still get "ISO-8859-1"
    I am using: Oracle Database 10g Express Edition Release 10.2.0.1.0 - Product
    Some help would realy be appreciated because i am out of options trying to get the code working..
    ======MY CODE==========
    create or replace procedure ipm40_send_bekendmaking(p_bdmg_id in number)
    as
    r_bekendmaking ipm40_bekendmakingen%rowtype;
    r_gemeente ipm40_gemeenten%rowtype;
    l_url httpuritype;
    t_http_req utl_http.req;
    t_http_resp utl_http.resp;
    t_request_body varchar2(32767);
    t_respond varchar2(32767);
    -- t_teller integer := 1;
    -- t_output varchar2(2000);
    t_start number := 1;
    t_body_lengte number;
    t_chunkdata varchar2(4000);
    t_tijd_1 varchar2(256);
    t_tijd_2 varchar2(256);
    t_timeout integer;
    t_length number;
    t_charset varchar2(256);
    begin
    select *
    into r_bekendmaking
    from ipm40_bekendmakingen
    where id = p_bdmg_id;
    select *
    into r_gemeente
    from ipm40_gemeenten
    where gmte_code = r_bekendmaking.gmte_code;
    l_url := httpuritype.createuri('http://zwolle.stadsbeheer.com:82/apex/ipm40bekendmaking?p_bdmg_id='||r_bekendmaking.id);
    t_request_body := l_url.getClob();
    /* request that exceptions are raised for error Status Codes */
    --Utl_Http.Set_Response_Error_Check ( enable => true );
    /* allow testing for exceptions like Utl_Http.Http_Server_Error */
    --Utl_Http.Set_Detailed_Excp_Support ( enable => true );
    utl_http.set_transfer_timeout(300);
    t_http_req:= utl_http.begin_request( r_gemeente.url_webservice_bekendmakingen
    , 'POST'
    , 'HTTP/1.1');
    utl_http.set_body_charset(t_http_req, 'UTF-8');
    utl_http.get_body_charset(t_charset);
    utl_http.set_authentication(t_http_req,r_gemeente.user_webservice_bekendmakingen,r_gemeente.pw_webservice_bekendmakingen);
    t_length := length(t_request_body);
    utl_http.set_header(t_http_req, 'Content-Type', 'application/xml charset=UTF-8');
    utl_http.set_header(t_http_req, 'Content-Length', t_length);
    utl_http.set_header(t_http_req, 'Transfer-Encoding', 'chunked' ); --
    t_body_lengte := dbms_lob.getlength(t_request_body);
    loop
    t_chunkdata := dbms_lob.substr(t_request_body, 2000, t_start);
    utl_http.write_text ( t_http_req, t_chunkdata );
    t_start := t_start + 2000;
    if t_start > t_body_lengte
    then
    exit;
    end if;
    end loop;
    t_http_resp:= utl_http.get_response(t_http_req);
    utl_http.read_text(t_http_resp, t_respond);
    utl_http.end_response(t_http_resp);
    if instr(t_respond,'Successfully document processed') != 0
    then
    update ipm40_bekendmakingen
    set ind_status = 'S'
    , datum_verzonden = sysdate
    , response = t_respond
    where id = r_bekendmaking.id;
    else
    update ipm40_bekendmakingen
    set ind_status = 'F'
    , datum_verzonden = null
    , response = t_respond
    where id = r_bekendmaking.id ;
    end if;
    commit;
    exception
    when others
    then
    t_tijd_2 := to_char(sysdate,'HH24:MI:SS');
    t_respond := substr(sqlerrm,1,2000);
    update ipm40_bekendmakingen
    set ind_status = 'F'
    , datum_verzonden = null
    , response = t_respond
    where id = r_bekendmaking.id ;
    commit;
    end;
    ===THE RESPOND=============
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
    <HTML><HEAD><META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
    <TITLE>ERROR: The requested URL could not be retrieved</TITLE>
    <STYLE type="text/css"><!--BODY{background-color:#ffffff;font-family:verdana,sans-serif}PRE{font-family:sans-serif}--></STYLE>
    </HEAD><BODY>
    <H1>ERROR</H1>
    <H2>The requested URL could not be retrieved</H2>
    <HR noshade size="1px">
    <P>
    While trying to process the request:
    <PRE>
    POST /pushxml/pushxml-bm HTTP/1.0
    Authorization: Basic Ymtfc21hcnRob2xkaW5nOllyZXMzdlFR
    Content-Type: application/xml charset=UTF-8
    Content-Length: 2096
    Transfer-Encoding: chunked
    Connection: close
    </PRE>
    <P>
    The following error was encountered:
    <UL>
    <LI>
    <STRONG>
    Invalid Request
    </STRONG>
    </UL>
    <P>
    Some aspect of the HTTP Request is invalid. Possible problems:
    <UL>
    <LI>Missing or unknown request method
    <LI>Missing URL
    <LI>Missing HTTP Identifier (HTTP/1.0)
    <LI>Request is too large
    <LI>Content-Length missing for POST or PUT requests
    <LI>Illegal character in hostname; underscores are not allowed
    </UL>
    <P>Your cache administrator is [email protected].
    <BR clear="all">
    <HR noshade size="1px">
    <ADDRESS>
    Generated Fri, 12 Aug 2011 17:33:24 GMT by asd2cc001.asp4all.nl (squid)
    </ADDRESS>
    </BODY></HTML>

    Always check the access_log and error_log files of the Apache web server in such a case. This will identify whether the error comes from Apache itself, mod_plsql, the Apex run-time engine, or the Oracle database.
    I see that you're creating a HTTP/1.1 in PL/SQL - however, the web server response indicates a HTTP/1.0 call was received. Unusual. And could be part of the problem.

  • Restful webservice with basic authentication

    Hi, i am running the following:
    Oracle: 11.2....
    ApexListener: 2.....
    Glassfish: 3.0...
    Apex: 4.2.1
    I have successfully established some restful webservices. Now i want to add a basic authentication to them against an APEX Authentication Scheme which is used in one of my APEX Applications. I cannot find any documentation related to Glassfish or ApexListener or APEX to do that.
    Or are the RESTful Service Privileges which belong to APEX User Goups intent to do a basic authentication ?
    Thanks for your help !
    -- Klaus

    OK got it solved by my self.
    Solution:
    Define a RESTFUL (POST, PLSQL) Service with the following HEADER parameters:
    authorization          authorization     IN     STRING
    X-APEX-STATUS-CODE     status          OUT     INTEGER
    As per RFC 1945, the Authorization header value should contain the username:password
    as encoded (base64) string. That is what the RESTclient send (over https)
    In the PLSQL i decode :authorization and validate it against APEX Authentication Scheme.
    The result of the validation drives the response header (:status) in PLSQL with 200 (ok) or 401 (Not Authorized)
    -- Klaus

  • Restful WebService + Jercy + Tomcat

    All,
      I am doing Hello World example for restfull webservice. I have fallowed the http://www.vogella.com/articles/REST/article.html. It is not showing any error or exception in any logs.
    But I could not get the expected the result.
    Please help me in this regard
    Regards
    vijay

    Hi Vijay,
    I'm in the impression, that you are started learning Restful Webservices.
    If yes here is the best solution, hope this helps you.
    I too tried that link given by you, but I didn't find jar for "com.sun.jersey.api.client" package, any how here you can find very clear and simple example.
    Jersey hello world example

  • Restful webservice Internal Server Error PUT POST DELETE

    Hi ,
    When I make a RESTful webservice on the Oracle Cloud with a PUT,POST or DELETE method, the test results is always the same error: "500 - Internal Server Error".
    The GET method causes no problems and gives me the value in JSON format.
    Can anyone help me because I can't find an Oracle example with one of these methods?

    Java Cloud Service does support RESTful WebServices based on JAX-RS 1.1 specification & Jersey 1.9 implementation.
    Please follow the documentation for http://docs.oracle.com/cd/E23943_01/web.1111/e13734/rest.htm#CHDCGFCH (Section Using the Jersey JAX-RS Reference Implementation)
    The required Jersey 1.9 shared library is pre-deployed in all the Java Cloud Service instances , you only need to add the reference of this shared lib in your weblogic.xml.
    The following example shows how to update the weblogic.xml file to use the Jersey JAX-RS RI Version 1.9.
    <library-ref>
    <library-name>jax-rs</library-name>
    <specification-version>1.1</specification-version>
    <implementation-version>1.9</implementation-version>
    <exact-match>false</exact-match>
    </library-ref>

  • Restful Webservice and German Umlaut

    Hello,
    i'm trying to setup a restful webservice using Apex 4.2 and Apex Listener 2, but i have problems regarding german unlaute in the json response.
    To see if its a configuration error on my side, i did setup an exmaple on apex.oracle.com and there i get the same results.
    I added a now row to the table emp, with just the ename as 'öäü'.
    Please see the example at http://apex.oracle.com/pls/apex/dwtest/getEmp/
    The result looks like this:
    {"next":{"$ref":"http://apex.oracle.com/pls/apex/dwtest/getEmp/?page=1"},"items":[{"ename":"öäü"}]}It should look like this:
    {"next":{"$ref":"http://apex.oracle.com/pls/apex/dwtest/getEmp/?page=1"},"items":[{"ename":"öäü"}]}The interesting fact is that i sometimes get the desired output, but its net reproducible to me. As browser i tested Firefox, Chrome, IE9 and Opera.
    I wonder if i configured something wrong in my browsers or in apex.
    If you would like to take a look at the webservide use these credentials:
    Workspace: dwtest
    Username: testuser
    Password: forum
    Thanks for help in advance.
    Regards,
    Dirk

    Do you think this could be related to the problem described here? {thread:id=2519567}?
    Howard

Maybe you are looking for

  • How do I get Reader to open hyperlinks with Google Chrome

    I'm using Adobe Reader X Version 10.1.3 on Windows 7 to open a PDF I've downloaded to my hard drive.  The document opens fine and it has hyperlinks to sites on the internet.  When I click one of these links, it opens Microsoft Internet Explorer to na

  • Inconsistent in SAP PRD 300 Server

    Previously, there is a group of InfoSet in PRD300 under Global Query Area, somehow the group of infoset is missing and only displayed certain infoset which is not belong to Global Query Area. In DEV 100 & QAS 200 still have these group of infoset und

  • Too many resources error

    When I tried to open my iPad a message flashed on the screen which said something about "too many resources".  I didn't have time to read the entire message before the machine shut down.  I haven't been able to open it since.  I assume I need to dele

  • Unlock Iphone 4s

    How can I use here in the Philippines, my newly bought Iphone 4s from Japan?

  • How does "HTML font size"  work ?

    I spent a long time fighting with the <html> <Font. face=serif size=xxx> Originally I tried to set the size to 24, 20, 18 or -1, or -2. This gave strange results. Either my letter size was much higher than I was expecting, or very small when using ne