RESTful Web Services example

Does anyone know of a simple publicly available Restful web service that I can play around with calling from my Apex workspace as a consumer? Something nice and simple (in the spirit of "hello world") such as web service calculator, stock quote, etc..
Also, I was wondering if there is some kind of ability in APEX to import a WADL document, and then APEX can magically create the requests for you?
Thanks in advance!

I was able to resolve the problem -- in the latest version of the RESTful web service that I created, I had left out the creation of the Header Parameter bind variable. Once I did that everything works fine!! I was able to test in the application and got the record of an individual student.
Thanks,
PM

Similar Messages

  • Hello REST web service example deployment fails when using EJB

    I was able to successfully deploy the hello REST web service example. But when I attempted to lookup an EJB via the following code I get an error message.
    try {
    ic = new InitialContext();
    DirectoryBean db = (DirectoryBean)ic.lookup("java:comp/env/ejb/DirectoryBean");
    } catch (NamingException ex) {
    ex.printStackTrace();
    Here is the error message in the NetBeans console window:
    Deploying application in domain failed; Error loading deployment descriptors for module [hello] -- com.sun.enterprise.deployment.annotation.context.WebBundleContext cannot be cast to com.sun.enterprise.deployment.annotation.context.EjbContextat com.sun.enterprise.deployment.annotation.AnnotationInfo@15f1fa0
    D:\java\Sun\swdp-tutorial-1.0\examples\rest\hello\nbproject\build-impl.xml:450: Deployment error:

    I think the problem may be that the SimpleServlet example uses an apt feature to generate a web.xml which will replace any web.xml you already have in the project (and lose any references etc you might have in it). To work around this problem first copy the necessary lines from the web.xml in the generates .war file - they should look something like this:
    <servlet>
    <servlet-name>RESTBeans Application</servlet-name>
    <servlet-class>com.sun.ws.rest.impl.container.servlet.ServletAdaptor</servlet-class>
    <init-param>
    <param-name>resourcebean</param-name>
    <param-value>com.sun.ws.rest.samples.servlet.resources.RESTBeansResources</param-value>
    </init-param>
    <load-on-startup>1</load-on-startup>
    </servlet>
    <servlet-mapping>
    <servlet-name>RESTBeans Application</servlet-name>
    <url-pattern>/restbean/*</url-pattern>
    </servlet-mapping>
    Add these to your project web.xml, replacing any lines that look similar (the web.xml in the sample project has these lines that you'll need to replace:
    <servlet>
    <servlet-name>ServletAdaptor</servlet-name>
    <servlet-class>com.sun.ws.rest.impl.servlet.ServletAdaptor</servlet-class>
    <init-param>
    <param-name>resources</param-name>
    <param-value>test1</param-value>
    </init-param>
    </servlet>
    <servlet-mapping>
    <!-- this is a comment -->
    <servlet-name>ServletAdaptor</servlet-name>
    <url-pattern>/*</url-pattern>
    </servlet-mapping>
    Now you need to turn off automatic web.xml generation by adding <option key="noservlet"/> to the apt task option in build.xml (look for the apt child of the -pre-compile task in build.xml).
    Clean and rebuild and make sure that the web.xml in the generated .war file now matches the project web.xml file.
    Marc.

  • 401 Unauthorized Error When calling a SharePoint REST web service from SharePoint 2013 Workflow

    We have our Workflow Manger installed on the same server as our SharePoint 2013 WFE development environment. When creating a SharePoint 2013 Workflow all Calls to a SharePoint 2013 REST web service results in a 401 Unauthorized error.
    As an example I created a simple workflow that should return a JSON result. The REST Url returns the results in the browser without error.
    Set Variable:webServiceUrl to https://<hostnamedsitecollection>/_vti_bin/client.svc/web/lists/getbytitle('ISR%20Approvers')/Items?$select=Title&$filter=Title%20eq%20%27General%27
    then Build{...} Dictionary (Output to Variable:requestHeaders)
    then Call [%Variable:webServiceUrl%] HTTP web service with request (ResponseContent to Variable:responseContent |ResponseHeaders to responseHeaders | ResponseStatusCode to Variable:responseCode)
    The RequestHeader is set to the requestHeaders variable though the web service call properties
    then Log Variable:responseCode to the workflow history list
    After manually running the workflow in SharePoint on a list item in the ISR Approvers list it Logs "Unauthorized" in the Workflow History Log. It does this with every SharePoint REST web service call that I have tried through the workflow.
    It doesn't have anything to do with the Workflow Manger being installed on the same machine as the SharePoint WFE does it?
    Thank You for any insight

    Hi,
    According to your post, my understanding is that you had 401 Unauthorized Error when calling a SharePoint REST web service from SharePoint 2013 Workflow.
    Please make sure you use the ‘Call HTTP Web Service’ correctly.
    You can enter the URL into the brower to check whether it is correctly.
    You need to
    create the Request header requestHeaders
    using a Dictionary:
    Accept : application/json;odata=verbose
    Content-Type : application/json;odata=verbose
    To associate the
    requestHeaders variable, select the Call action
    property, set the RequestHeaders property to
    requestHeaders.
    Please refer to the following articles:
    Working with Web Services in SharePoint 2013 Workflows using SharePoint Designer 2013
    Calling the SharePoint 2013 Rest API from a SharePoint Designer
    Workflow
    In addtion, you need to make sure you install the workflow manager correctly.
    More information:
    Install and configure workflow for SharePoint Server 2013
    Known Issues in Workflow Manager 1.0
    Troubleshooting Workflow Manager 1.0 Management and Execution
    Best Regards,
    Linda Li
    Linda Li
    TechNet Community Support

  • Calling a restful web service from a script task

    Hi.  I'm weak in c# but am looking to accomplish this...
    I want to call a RESTful web service from an ssis script task.  I don't want to create a web service so I'm hoping there is some publicly available one I can practice with before our web team provides me with the service I'll eventually use.  Can
    the community provide an example?  I wish I had more but my knowledge is very limited except for using ssis in more sql centric apps.  It would be great if I could exercise both a get and put verb but I understand i'll be lucky if I can even get
    a get to work. 
    Here is an example of a get I found on the web but I don't know if its a viable candidate for me to practice with from my package...
    using System;
    using System.IO;
    using System.Net;
    using System.Text;
    // Create the web request
    HttpWebRequest request = WebRequest.Create("http://developer.yahoo.com/") as HttpWebRequest;
    // Get response
    using (HttpWebResponse response = request.GetResponse() as HttpWebResponse)
    // Get the response stream
    StreamReader reader = new StreamReader(response.GetResponseStream());
    // Console application output
    Console.WriteLine(reader.ReadToEnd());
    and in the same article an example of a put ...
    // We use the HttpUtility class from the System.Web namespace
    using System.Web;
    Uri address = new Uri("http://api.search.yahoo.com/ContentAnalysisService/V1/termExtraction");
    // Create the web request
    HttpWebRequest request = WebRequest.Create(address) as HttpWebRequest;
    // Set type to POST
    request.Method = "POST";
    request.ContentType = "application/x-www-form-urlencoded";
    // Create the data we want to send
    string appId = "YahooDemo";
    string context = "Italian sculptors and painters of the renaissance"
    + "favored the Virgin Mary for inspiration";
    string query = "madonna";
    StringBuilder data = new StringBuilder();
    data.Append("appid=" + HttpUtility.UrlEncode(appId));
    data.Append("&context=" + HttpUtility.UrlEncode(context));
    data.Append("&query=" + HttpUtility.UrlEncode(query));
    // Create a byte array of the data we want to send
    byte[] byteData = UTF8Encoding.UTF8.GetBytes(data.ToString());
    // Set the content length in the request headers
    request.ContentLength = byteData.Length;
    // Write data
    using (Stream postStream = request.GetRequestStream())
    postStream.Write(byteData, 0, byteData.Length);
    // Get response
    using (HttpWebResponse response = request.GetResponse() as HttpWebResponse)
    // Get the response stream
    StreamReader reader = new StreamReader(response.GetResponseStream());
    // Console application output
    Console.WriteLine(reader.ReadToEnd());
     

    Hi
    db042190,
    These kinds of operations are commonly found outside the SSIS section of the forum, you just need to "borrow" the code and wrap into the Script Task. And based on what you see you are on the right tracks.
    One thing you need to be aware of: in production such RESTfull call usually lead to a fiasco for the machine residing in some kind of DMZ or Firewall rules prohibiting these methods or you need a proxy account to run the package and you face unbeggable admins
    who resist to relaxing security.
    My suggestion is to go the easy route: write the app up as a console, standalone app - it will be easier to debug and there will be complete examples of them in abundance on the web.
    Arthur
    MyBlog
    Twitter

  • Consuming RESTful web service in Apex app

    Hi,
    I have created a RESTful Web service through an Apex application (4.0) and published as a public web service. Can someone point me to an example of how to then consume that service in another Apex app? The output is straightforward XML that I can retrieve just by pointing the browser to the URL of the service created, but when I go to create the REST Web Reference for the receiving application, I am not sure what to put for the Response Xpath or Response Namespace. The service is meant to just return report records that were created in the REStful Web service with no input required.
    The service XML looks like this:
    <ROWSET>
    <ROW>
    <PROJ_ID>132</PROJ_ID>
    <PSL_NETID>xxxxxxxx</PSL_NETID>
    <PROJECT_TITLE>11g- Oracle Upgrade to RAC 11g</PROJECT_TITLE>
    <CUSTOMER>OIT</CUSTOMER>
    <DIVISION>EIS</DIVISION>
    </ROW>
    <ROW>
    <PROJ_ID>132</PROJ_ID>
    <PSL_NETID>xxxxxx</PSL_NETID>
    <PROJECT_TITLE>11g- Oracle Upgrade to RAC 11g</PROJECT_TITLE>
    <CUSTOMER>OIT</CUSTOMER>
    <DIVISION>CSS</DIVISION>
    Any help would be appreciated.
    Thanks,
    Pat
    Edited by: patfmnd on Dec 7, 2012 3:04 AM

    Hi,
    I have made progress in this. I created the RESTful report service in an Apex 4.1 application. (previous attempt was with 4.0 version of Apex)
    I then created a separate application and created a RESTful web service reference that I tested and it was successful in bringing up XML. However in Apex 4.1, when I create a report following the Wizard for creating a report based on that Web service reference I get the error: ORA-31013: Invalid XPATH expression Which I don't know how to get past. The Xpath provided in the Web service reference test gave output below and brought back a result. There was no where during the Report creation to provide an Xpath. Am I missing something or is 4.1 not quite Web service ready??
    This is what I get from the test of the Web service reference in the Apex App from which I want to create a report: (I see in this XML the data I was expecting from the test of the RESTful web service but it looks like the output I get from the Web service test is more like the Report xml itself.)
    <!DOCTYPE html> <html lang="en" xmlns="http://www.w3.org/1999/xhtml" xmlns:htmldb="http://htmldb.oracle.com" xmlns:apex="http://apex.oracle.com"> <head> <title>Author</title>
    <!--[if IE]><link rel="stylesheet" href="/i/css/apex_ie_4_1.css" type="text/css" /><![endif]--> <script type="text/javascript">
    //<![CDATA[
    var apex_img_dir = "/i/", htmldb_Img_Dir = apex_img_dir;
    //]]>
    </script>
    <script src="/i/javascript/apex_4_1.min.js" type="text/javascript">
    </script>
    <script type="text/javascript">
    //<![CDATA[
    apex.security.framebreaker("D");
    //]]>
    </script>
    <!--[if IE]><link rel="stylesheet" href="/i/themes/theme_2/css/theme_4_0_ie.css" type="text/css" /><![endif]--><!--[if IE 6]><link rel="stylesheet" href="/i/themes/theme_2/css/theme_4_0_ie6.css" type="text/css" /><![endif]--><!--[if IE 7]><link rel="stylesheet" href="/i/themes/theme_2/css/theme_4_0_ie7.css" type="text/css" /><![endif]--><!--[if lte IE 6]><div id="outdated-browser">You are using an outdated web browser. For a list of supported browsers, please reference the Oracle Application Express Installation Guide.</div><![endif]-->
    <form action="wwv_flow.accept" method="post" name="wwv_flow" id="wwvFlowForm"><input type="hidden" name="p_flow_id" value="140" id="pFlowId" /><input type="hidden" name="p_flow_step_id" value="1" id="pFlowStepId" /><input type="hidden" name="p_instance" value="6146802068150520" id="pInstance" /><input type="hidden" name="p_page_submission_id" value="1940235134399423" id="pPageSubmissionId" /><input type="hidden" name="p_request" value="" id="pRequest" />
    <div id="header">
    <div id="app-logo"><a href="f?p=140:1:0"></a></div>
    <div id="navbar">
    <div class="navbar-entry">Logout</div>
    </div>
    </div>
    <div id="tabs">
    <div class="frame">
    <div class="bg">
    <div class="tab-holder">
    <div class="first-current">
    <div><span>Author</span></div>
    </div>
    </div>
    </div>
    </div>
    </div>
    <div id="topbar">
    <div class="breadcrumb-region" id="R170908223330421512">
    <div>
    <div id="breadcrumbs">
    <ul class="breadcrumb-list">
    <li class="current">Author</li>
    </ul>
    </div>
    </div>
    </div>
    </div>
    <div id="messages"></div>
    <div id="body">
    <table class="tbl-body" cellspacing="0" cellpadding="0" border="0" summary="">
    <tbody>
    <tr>
    <td class="tbl-main" width="100%">
    <div class="rounded-corner-region" id="books">
    <div class="rc-blue-top">
    <div class="rc-blue-top-r">
    <div class="rc-title">AUTHOR</div>
    <div class="rc-buttons"><button value="Reset" class="button-gray" type="button" id="B170907622885421490"><span>Reset</span></button></div>
    </div>
    </div>
    <div class="rc-body">
    <div class="rc-body-r">
    <div class="rc-content-main">
    <table id="apex_layout_170907030238421484" border="0" class="formlayout" summary="" role="presentation" datatable="0">
    <tr>
    <td align="right"><label for="P1_REPORT_SEARCH" tabindex="999"><a class="optional-w-help" href="javascript:popupFieldHelp('170907422375421487','6146802068150520')" tabindex="999">Search</a></label></td>
    <td colspan="1" rowspan="1" align="left"><input type="hidden" name="p_arg_names" value="170907422375421487" /><input type="text" id="P1_REPORT_SEARCH" name="p_t01" value="" size="30" maxlength="2000" class="text_field" /></td>
    <td align="right"><label for="P1_ROWS" tabindex="999"><a class="optional-w-help" href="javascript:popupFieldHelp('170907508375421490','6146802068150520')" tabindex="999">Display</a></label></td>
    <td colspan="1" rowspan="1" align="left"><input type="hidden" name="p_arg_names" value="170907508375421490" /><select name="p_t02" id="P1_ROWS" size="1" class="selectlist">
    <option value="10">10</option>
    <option value="15" selected="selected">15</option>
    <option value="20">20</option>
    <option value="30">30</option>
    <option value="50">50</option>
    <option value="100">100</option>
    <option value="200">200</option>
    <option value="500">500</option>
    <option value="1000">1000</option>
    <option value="5000">5000</option>
    </select></td>
    <td align="left"></td>
    <td colspan="1" rowspan="1" align="left"><button value="Go" class="button-gray" type="button" id="P1_GO"><span>Go</span></button></td>
    </tr>
    </table>
    <div id="report_170907030238421484_catch">
    <table cellpadding="0" border="0" cellspacing="0" summary="" id="report_books">
    <tr>
    <td></td>
    </tr>
    <tr>
    <td>
    <table cellpadding="0" border="0" cellspacing="0" summary="" class="report-standard">
    <tr>
    <th id="AUTHORID" class="header">
    <div class="rpt-sort">Authorid<img align="absmiddle" src="/i/arrow_up_gray_dark.gif" width="13" height="12" alt="Sort by this column" /></div>
    </th>
    <th id="LNAME" class="header">
    <div class="rpt-sort">Lname</div>
    </th>
    <th id="FNAME" class="header">
    <div class="rpt-sort">Fname</div>
    </th>
    </tr>
    <tr class="highlight-row">
    <td headers="AUTHORID" class="data">A100</td>
    <td headers="LNAME" class="data">AUSTIN</td>
    <td headers="FNAME" class="data">JAMES</td>
    </tr>
    <tr class="highlight-row">
    <td headers="AUTHORID" class="data">A105</td>
    <td headers="LNAME" class="data">ADAMS</td>
    <td headers="FNAME" class="data">JUAN</td>
    </tr>
    <tr class="highlight-row">
    <td headers="AUTHORID" class="data">B100</td>
    <td headers="LNAME" class="data">BAKER</td>
    <td headers="FNAME" class="data">JACK</td>
    </tr>
    <tr class="highlight-row">
    <td headers="AUTHORID" class="data">F100</td>
    <td headers="LNAME" class="data">FIELDS</td>
    <td headers="FNAME" class="data">OSCAR</td>
    </tr>
    <tr class="highlight-row">
    <td headers="AUTHORID" class="data">J100</td>
    <td headers="LNAME" class="data">JONES</td>
    <td headers="FNAME" class="data">JANICE</td>
    </tr>
    <tr class="highlight-row">
    <td headers="AUTHORID" class="data">K100</td>
    <td headers="LNAME" class="data">KZOCHSKY</td>
    <td headers="FNAME" class="data">TAMARA</td>
    </tr>
    <tr class="highlight-row">
    <td headers="AUTHORID" class="data">M100</td>
    <td headers="LNAME" class="data">MARTINEZ</td>
    <td headers="FNAME" class="data">SHEILA</td>
    </tr>
    <tr class="highlight-row">
    <td headers="AUTHORID" class="data">P100</td>
    <td headers="LNAME" class="data">PORTER</td>
    <td headers="FNAME" cla
    Edited by: patfmnd on Dec 12, 2012 5:59 PM
    Edited by: patfmnd on Dec 12, 2012 6:07 PM

  • How to build complex object to be sent to a RESTful web service?

    Hi,
    I'm working with RESTful web services on J2EE 1.6.
    I create the database, generate the entities and generate the web services.
    I must implement Javascript clients and I don't want to use any open source for that.
    I have a simple example that works just fine. For the database :
    CREATE TABLE Shopper(
    shopperId MEDIUMINT AUTO_INCREMENT PRIMARY KEY,
    firstName VARCHAR(40),
    lastName VARCHAR(40),
    phone VARCHAR(40),
    email VARCHAR(50) NOT NULL,
    receiveEmailNotification ENUM('Y', 'N'),
    index(email)
    I create this xml information with javascript :
    *<shopper>*
    *<email>c</email>*
    *<firstName>c</firstName>*
    *<lastName>c</lastName>*
    *<phone>c</phone>*
    *<receiveEmailNotification>Y</receiveEmailNotification>*
    *</shopper>*
    and it is saved in the database. I have a more complex application with relationships between entites. For this database :
    CREATE TABLE Shopper(
    shopperId MEDIUMINT AUTO_INCREMENT PRIMARY KEY,
    firstName VARCHAR(40),
    lastName VARCHAR(40),
    phone VARCHAR(40),
    email VARCHAR(50) NOT NULL,
    receiveEmailNotification ENUM('Y', 'N'),
    index(email)
    CREATE TABLE Address(
    addressId MEDIUMINT AUTO_INCREMENT PRIMARY KEY,
    street VARCHAR(60),
    streetNo VARCHAR(20),
    postalCode VARCHAR(30),
    city VARCHAR(40),
    country VARCHAR(40),
    otherInfo TEXT,
    shopperId MEDIUMINT NOT NULL,
    foreign key (shopperId) REFERENCES  shopper(shopperId) ON DELETE CASCADE,
    index(shopperId)
    I was expecting that xml information sent from the browser should be:
    *<address>*
    *<city>c</city>*
    *<country>c</country>*
    *<otherInfo>c</otherInfo>*
    *<postalCode>c</postalCode>*
    *<street>c</street>*
    *<streetNo>c</streetNo>*
    *<shopper>*
    *<email>c</email>*
    *<firstName>c</firstName>*
    *<lastName>c</lastName>*
    *<phone>c</phone>*
    *<receiveEmailNotification>Y</receiveEmailNotification>*
    *</shopper>*
    *</address>*
    but I keep on getting errors.
    I want to send one XML structure that will be stored in two tables according to the foreign key relation.
    Does the RESTful web services code generated by Netbeans or Eclipse support this?
    Is my XML structure not built correctly?

    Kevin,
    My object base class is Abstract and class I am using in Flex 3 is class inheriting abstract class. But when calling webservice Flex creating soap message of base class and I am getting error in .Net web services that "Can not create instance of Abstract class".
    Below is the soap message difference calling same WCF method from .Net and Flex. For example Constraint is the base class and JobConstraint is the class which inherit Constraint class. But flex send message forming only Constraint while .Net soap is specifying i:type="JobConstraint".
    Part of soap message Calling from .Net 

    Constraints>< 
    Constraint i:type="JobConstraint"><Position 
    >true</Position>< 
    Rank>2</Rank>< 
    Requirement>true</Requirement></ 
    Constraint></ 
    Constraints> 
    Part of Soap message calling from Flex 3
    <ns0:Constraints>
    <ns0:Constraint>
    <ns0:Position>true</ns0:Position>
    <ns0:Rank>2</ns0:Rank>
    <ns0:Requirement>true</ns0:Requirement>
    </ns0:Constraint>
    </ns0:Constraints>

  • Exposing a report as RESTful web service - Parameters

    Hi,
    I am creating a RESTful web service by exposing an apex report. It just works fine and it renders the data. However I want to have parameters and values in the web service URL so that the data can be filtered based on the parameter values?
    For example:
    http://127.0.0.1:8080/apex/apex_rest.getReport?app=100&page=15&reportid=rest_example renders correctly for the report query
    select * from (
    select
    "CUSTOMER_ID",
    "CUST_FIRST_NAME",
    "CUST_LAST_NAME",
    "CUST_STREET_ADDRESS1",
    "CUST_STREET_ADDRESS2",
    "CUST_CITY",
    "CUST_STATE",
    "CUST_POSTAL_CODE",
    "PHONE_NUMBER1",
    "PHONE_NUMBER2",
    "CREDIT_LIMIT",
    "CUST_EMAIL"
    from #OWNER#.DEMO_CUSTOMERS )
    where (
    instr(upper("CUST_FIRST_NAME"),upper(nvl(:P15_REPORT_SEARCH,"CUST_FIRST_NAME"))) > 0  or
    instr(upper("CUST_LAST_NAME"),upper(nvl(:P15_REPORT_SEARCH,"CUST_LAST_NAME"))) > 0
    )But I want to filter the result for a particular customer id by getting a value in the URL like this.
    http://127.0.0.1:8080/apex/apex_rest.getReport?app=100&page=15&reportid=rest_example&P15_CUSTOMER_ID=6 and to use the value received thro the URL in the report query
    select * from (
    select
    "CUSTOMER_ID",
    "CUST_FIRST_NAME",
    "CUST_LAST_NAME",
    "CUST_STREET_ADDRESS1",
    "CUST_STREET_ADDRESS2",
    "CUST_CITY",
    "CUST_STATE",
    "CUST_POSTAL_CODE",
    "PHONE_NUMBER1",
    "PHONE_NUMBER2",
    "CREDIT_LIMIT",
    "CUST_EMAIL"
    from #OWNER#.DEMO_CUSTOMERS
    where customer_id = :P15_CUSTOMER_ID)
    where (
    instr(upper("CUST_FIRST_NAME"),upper(nvl(:P15_REPORT_SEARCH,"CUST_FIRST_NAME"))) > 0  or
    instr(upper("CUST_LAST_NAME"),upper(nvl(:P15_REPORT_SEARCH,"CUST_LAST_NAME"))) > 0
    )Is it possible to have it working in this way?
    I am currently testing this in apex 4.2 and Oracle 11g XE. My development environment will be Apex 4.1 and Oracle 11g.
    Thanks in Advance.
    Regards,
    Natarajan
    Edited by: Nattu on Dec 18, 2012 2:09 AM

    It does accept values for the parameters but does not accept value names in the URL.
    The previous thread Restful web service passing character parameters helped me to get it working.
    Thanks.

  • REST web service set up

    Hello,
    Need help setting up an xpath for a rest web service
    response path:  //m:properties
    REST output parameters
    name:  project   path: /d:WO_PREFIX
    When I try to create a Form and Report I get an error using the defaults:
    ORA-20001: Unable to create form on table. ORA-00907: missing right parenthesis
    What would be the correct setup for this to work????
    Here is an example of my response
    <?xml version="1.0" encoding="utf-8"?>
    <feed xml:base="http://xxx.xx.com/EF/odata" xmlns="http://www.w3.org/2005/Atom" xmlns:d="http://schemas.microsoft.com/ado/2007/08/dataservices" xmlns:m="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata" xmlns:georss="http://www.georss.org/georss" xmlns:gml="http://www.opengis.net/gml">
      <id>http://schemas.datacontract.org/2004/07/</id>
      <title />
      <updated>2013-08-28T17:51:58Z</updated>
      <link rel="self" href="http://xxx.xx.com/EF/odata/PROJECTS" />
      <entry>
        <id>http://xxx.xxx.com/EF/odata/PROJECTS('ZZZ')</id>
        <category term="WOSApi.Models.PROJECT" scheme="http://schemas.microsoft.com/ado/2007/08/dataservices/scheme" />
        <link rel="edit" href="http://xxx.xx.com/EF/odata/PROJECTS('ZZZ')" />
        <link rel="self" href="http://xxx.xx.com/EF/odata/PROJECTS('ZZZ')" />
        <title />
        <updated>2013-08-28T17:51:58Z</updated>
        <author>
          <name />
        </author>
        <content type="application/xml">
          <m:properties>
            <d:WO_PREFIX>ZZZ</d:WO_PREFIX>
          </m:properties>
        </content>
      </entry>
    </feed>

    Use Xmlspy or some editor to modify or edit the WSDL as per need.
    elementFormDefault="qualified"
    This means that all the elements in the XML document must have namespace variable prefixed with them.
    elementFromDefault="unqualified"
    This means that not all the elements in the XML document requires namespace variable prefixed with them. Only the root element has to be prefixed with namespace variable.

  • JSP page communicating with a MySQL db throw a Glassfih RESTful web service

    Hello;
    I am en newbie in servlet/JSP stuffs, and as I said in the subject, i'm looking for the best way to make my JSP pages communicate with my db. My application already consists in a RESTful web service that, just for the record, communicates with a JavaFX Client.
    (>What i'm looking for is to write datas in my database through this JavaFX client, and it seems like this can only works by passing through a intermediate scripting language like JSP).
    To get back on my issue, I don't really know about JSP. I read many tutorials but it still seems confusing to me. Can somebody show me, by a detailed example, how I can do that ? (Preferably by using jsp beans like "usebean", that i find very useful).
    Thanks a lot.

    don't make your JSP 'communicate' with a database. These tasks are for servlets and specific business logic classes which you can use in your servlets.
    To connect to a database, use the JDBC API. Plenty of tutorials about that around the net.
    I don't really know about JSPYeah well, you already identified your problem then. The solution is very simple: learn. To be able to learn, get a good resource, such as a book and not some vague tutorials that you find on the net. For example, I always recommend this free online book:
    [core servlets 2nd edition|http://pdf.coreservlets.com]

  • Can we use REST web service as Data source in SSRS? !!!!NOT SOAP!!!!

    Hello,
    We have requirement to use the REST web service as the Data source of SSRS.  Tried with XML as Data Source, but unfortunately I could not succeed because the query expects SOAPAction which is not available in REST Service.
    Do we have any option to use REST Service, if so please provide some basic example, so that I can try out some options.
    If not, do we have any alternate solutions to handle these situations?
    Thanks!
    Vinay

    Hi Vinay.
    After looking on it for some time, I am afraid currently there is no document to talk on how to use the REST web service as a data source.
    You can use the link
    http://technet.microsoft.com/en-US/library/aa964129(v=SQL.90).aspx for a renference.
    From a support perspective currently this is really beyond what we can do here in the forums. If you cannot determine your answer here or on your own, consider opening a
    support case with us. Visit this link to see the various support options that are available to better meet your needs:  http://support.microsoft.com/default.aspx?id=fh;en-us;offerprophone 
    Thanks,

  • Problem getting RESTful web service reference working with header value

    Hi,
    I posted this on Apex Listener forum but since I am not sure problem is with my Application RESTful web service reference or a Listener issue, I am posting here as well:
    I am on Apex 4.2.2 and Listener 2.1 and the listener is on WEblogic.
    I succeeded to get a RESTful web service working in an application with no header to obtain a full set of data. The data set is very large, so I am now just trying to set up a web service to get a set of data based on a student ID.
    I followed the examples shown in the RESTful web service module of SQL Workshop and set up a handler of this type:
    https://ourweblogicserver/apex/bnr/ace/students/course_grades/{stid}
    The test for this handler succeeded both for JSON output and CSV output in the Workshop test environment.
    However, when I try it from a Web Service Reference that I created for my application following what looked like the same approach used on the example video, I get NO data back. If I put a 'stid' directly into a URL of a web browser and do the basic authentication I get the data!!
    This is what I have for the Web service reference:
    https://ourweblogicserver/apex/bnr/ace/students/course_grades/{stid}
    Basic auth set to Yes -- and this is working -- I am able to authenticate
    HTTP method Get
    output format Text
    no response Xpath
    no response namespace
    defaults for new record and parameter delimiter
    NO REST input parameters
    Output set for all the fields in the data set queried (same set of data as in my rest service which does not have any http header)
    REST HTTP Header : Name stid
    I there something I am missing. I am not sure how to troubleshoot this further.
    I also tried exactly following the example shown on the Oracle Video for RESTFul web services at
    http://www.youtube.com/watch?v=gkCvd6P8_OU
    and I can't get the 2nd example to work either-- where the header has the bind variable parameter.
    Pat

    I was able to resolve the problem -- in the latest version of the RESTful web service that I created, I had left out the creation of the Header Parameter bind variable. Once I did that everything works fine!! I was able to test in the application and got the record of an individual student.
    Thanks,
    PM

  • How to update the Query of an existing WEBI document's dataprovider, through the RESTful Web service SDK.

    Hi,
    I am trying to update the Query of an existing WEBI document's dataprovider, through the RESTful Web service SDK.
    For this, first i will get the Dataprovider information,
    Example:
    URI: http://localhost:6405/biprws/raylight/v1/documents/11111/dataproviders/DP0
    Expected result;
    <dataprovider>
         <id>DP0</id>
         <name>Query 1</name>
         <dataSourceId>1234</dataSourceId>
         <updated>2014-04-18T11:55:21.000-08:00</updated>
         <duration>1</duration>
         <isPartial>false</isPartial>
         <rowCount>113</rowCount>
         <flowCount>11</flowCount>
         <dictionary>
              <expression qualification="Dimension" dataType="String">
                   <id>DP0.DO1</id>
                    <name>EmpID</name>
                   <description>Employee ID.</description>
                    <dataSourceObjectId>DS0.DO1</dataSourceObjectId>
              </expression>
              <expression qualification="Dimension" dataType="String">
                   <id>DP0.DO2</id>
                   <name>EmpName</name>
                   <description>Employee Name.</description>
                   <dataSourceObjectId>DS0.DO2</dataSourceObjectId>
              </expression>
         </dictionary>
         <query>SELECT Employee.EmpID, Employee.EmpName FROM Employee</query>
    </dataprovider>
    Then Changing the above dataprovider's Query to some thing like below,
    <query>SELECT Employee.EmpID, Employee.EmpName FROM Employee where Upper(Employee.EmpName)='RAJ'</query>
    Please let me know the RESTful Call required to do this.
    Thanks in advance.
    Thanks,
    Mahendra.

    FYI, the output of this call returns something like:
    <?xml version="1.0" encoding="UTF-8"?> 
    <queryplan>
        <union>
            <fullOuterJoin>
                <statement index="1">SELECT 'FY' || to_char(SALES.invoice_date,'yy'), count( distinct SALES.inv_id) FROM SALES GROUP BY 'FY' || to_char(SALES.invoice_date,'yy')</statement>
                <statement index="2">SELECT 'FY' || to_char(SALES.invoice_date,'yy'), sum(INVOICE_LINE.nb_guests) FROM SALES, INVOICE_LINE, SERVICE_LINE, SERVICE WHERE ( SALES.INV_ID=INVOICE_LINE.INV_ID ) AND ( INVOICE_LINE.SERVICE_ID=SERVICE.SERVICE_ID ) AND ( SERVICE.SL_ID=SERVICE_LINE.SL_ID ) AND ( SERVICE_LINE.service_line = 'Accommodation' ) GROUP BY 'FY' || to_char(SALES.invoice_date,'yy')</statement>
            </fullOuterJoin>
            <fullOuterJoin>
                <statement index="3">SELECT 'FY' || to_char(SALES.invoice_date,'yy'), count( distinct SALES.inv_id) FROM SALES GROUP BY 'FY' || to_char(SALES.invoice_date,'yy')</statement>
                <statement index="4">SELECT 'FY' || to_char(SALES.invoice_date,'yy'), sum(INVOICE_LINE.days * INVOICE_LINE.nb_guests * SERVICE.price) FROM SALES, INVOICE_LINE, SERVICE WHERE ( SALES.INV_ID=INVOICE_LINE.INV_ID ) AND ( INVOICE_LINE.SERVICE_ID=SERVICE.SERVICE_ID ) GROUP BY 'FY' || to_char(SALES.invoice_date,'yy')</statement>
            </fullOuterJoin>
        </union>
    </queryplan>

  • 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
    -------------------------------------------------------------------

  • Creating RESTful Web Service for BLOB retrieval

    Hi,
    Just got RESTful web services working in Apex 4.2.1 with new Listener 2.1.
    I have now been asked to create a RESTful web service by which photos in BLOB column can be retrieved upon providing the ID for that photo. Can this be done using the Creating RESTful Service Module of Apex 4.2.1? Looking at the Apex 4.2 documentation, I would assume this can be done, but has anyone used this with BLOB data?
    Thanks,
    Pat

    Hi Pat,
    Yes this can be done using RESTful Services - you just need to ensure the query used is in the required format. To obtain a BLOB for a given ID, you would need create a Resource template and handler with the following settings:
    Resource Template Settings:
    URI template: emppic/{id}
    Resource Handler Settings:
    Source query: select mimetype, product_image from demo_product_info where product_id = :id..where the format of the SQL query is SELECT 'content_type', blob_column FROM . . ., as mentioned in Rick Greenwald's Cloud White paper "RESTful Web Services for the Oracle Database Cloud", under the "SQL Source Type" section (see www.oracle.com/technetwork/database/database-cloud/public/restful-wp-1844130.pdf ):
    where 'content_type' is a string passed to the browser to be used to identify the incoming data, and the column to identify the source of the data being sent back. This data is sent back untouched by the Oracle Database Cloud Service. The Media Resource Source Type is typically used for media objects, such as images, where the data will be directly handled by the recipient making the call.The MIMETYPE column in the sample query above holds the necessary setting for the 'content_type' i.e. 'image/jpeg'. The value of ID is then passed in as a parameter when calling the service e.g. emppic/1234. The item level help text would be more helpful if it included additional information, and this is something we intend on addressing in a future release.
    I hope this example helps.
    Regards,
    Hilary

  • Problem with RESTful web service with header value

    Hi,
    I am on Apex 4.2.2 and Listener 2.1 and the listener is on WEblogic.
    I succeeded to get a RESTful web service working in an application with no header to obtain a full set of data. The data set is very large, so I am now just trying to set up a web service to get a set of data based on a student ID.
    I followed the examples shown in the RESTful web service module of SQL Workshop and set up a handler of this type:
    https://ourweblogicserver/apex/bnr/ace/students/course_grades/{stid}
    The test for this handler succeeded both for JSON output and CSV output in the Workshop test environment.
    However, when I try it from a Web Service Reference that I created for my application following what looked like the same approach used on the example video, I get NO data back. If I put a 'stid' directly into a URL of a web browser and do the basic authentication I get the data!!
    This is what I have for the Web service reference:
    https://ourweblogicserver/apex/bnr/ace/students/course_grades/{stid}
    Basic auth set to Yes -- and this is working -- I am able to authenticate
    HTTP method Get
    output format Text
    no response Xpath
    no response namespace
    defaults for new record and parameter delimiter
    NO REST input parameters
    Output set for all the fields in the data set queried (same set of data as in my rest service which does not have any http header)
    REST HTTP Header : Name stid
    I there something I am missing. I am not sure how to troubleshoot this further.
    Pat

    Hi,
    I have posted a simple application with the RESTful reference:
    http://apex.oracle.com/pls/apex/f?p=13758
    I can give you full privileges on this so you can look at the WEB service reference. Shall I send to you separately for login user?
    It is using the RESTful service: http://apex.oracle.com/pls/apex/nd_pat_miller/demo/employee/{deptno}
    This RESTful service tests fine when I test from within the RESTful web service module of the Workspace.
    I based this on the Video demo tutorial for RESTful web service that Oracle published for 4.2 release. The video seemed to exclude the {deptno} in the URL but when I try that, it doesn't work either.
    This is the error I am getting when I run this on my Apex environment: (it, of course, will not run the web service in the apex.oracle.com environment)
    class="statusMessage">Bad Request</span>                                         
    </h3>                                         
    </div>                                         
    </div>                                         
    <div id="xWhiteContentContainer" class="xContentWide">                                         
    <div class="xWhiteContent">                                         
    <div class="errorPage">                                         
    <p>                                         
    <ul class="reasons"><li class="badRequestReason"><span class="target" style="display:none;">uri</span><span class="reason">Request path contains unbound parameters: deptno</span></li>                                    
    </ul>Thanks,
    Pat
    Edited by: patfmnd on May 8, 2013 3:33 AM

Maybe you are looking for

  • Need help with gunshot effect in FCP

    New to FCP and am trying to add a gunshot effect to a short film. Doesn't have to look top notch...just looking for something simple. I added a muzzle blast for the shooter from detonationfilms.com, which worked great. When i overlayed the muzzle bla

  • Unable to install Camera RAW 8.5 update

    Hi... I'm trying to update my Photoshop CC camera raw to the latest version 8.5. Every time I install the ACR 8.5 update. It is stated as successful. But when I open a raw file, I can see that it is still 8.0. I have tried uninstalling everything, ie

  • Error in internet explorer

    when i try to see vedio on yahoo it given an error to installed flash player even after installing it gives the same error

  • Problems printing (not exporting) a JPEG at high res on Windows 7 64bit?

    I have searched for similar problems but could not find in the forums.  When I try to print a JPG from the Print module in LR 3.6 (and tried it also with 3.5), it does not always recognize the resolution settings.   Most of the time (and I can't see

  • Cell phone

    how do I download pictures from my cell phone?