When doing a post to a rest service is it possible to send multiple records in json
Hi I'm trying to develop my first web service and I'm not sure I'm in the correct place. I'm using Oracle application express 4.2.2. on oracle 11g. I followed this example Creating and Using RESTful Web Service in Application Express 4.2 and used java as the client to connect to the web service. I change my employee record to have forename,surname, address1. This is working fine for me. However I need to be able to post complex multiple records to the web service in one call to the web service.
e.g. in the example it sends
{"forename","john":"surname","smith":"address1":"first address line"}
What I would like to send is something like this.
"employees" : [{"forename":"john","surname":"smith","address1":"first address line"},{"forename":"Dave","surname":"Jones","address1":"first address line"}]
Is this possible.
Thanks
Anthony
hi:
you can edit the URI template like below
promotionlist/{accnt_price_id},{addr_row_id}
then you can post multi parameters to Web Service.
Similar Messages
-
I'm not able to send emails with mail.ru. Receiving is not a problem. Creating a mail is also not a problem and the mail will be stored at mail.ru as still to be send, only problem is its not possible to send. I noticed the buttons for sending change colour when used but they don't perform. What it is?
Don't know what changed, but all of a sudden able to send emails by mail.ru ...... sorry for bothering.
-
Web service - is it possible to send a file consuming a web service ?
Hello expert,
I need to send a file via web service. I think that i have to expose my web service, but my question is:
is it possible send or receive a file only consuming one or more web service ?
tks.yes, but transforming the file in a internal table.
-
Restful service returning components
Is there any way, or indeed am I doing something wrong when creating my components, to get components to generate json consistently. The json I'm returning will have the first letter capitalized and the rest lower case when returning the component from the restful service however all capitalized when calling the compoent remotely.
Some demo components as below:
User.cfc
component {
property type="numeric" name="userid";
property type="string" name="username";
Users.cfc
component output="false" restPath="/users"
remote User function getByPK(required numeric id restArgSource="Path") output="false" httpMethod="GET" restPath="{id}"
user = new user();
user.userid = 1;
user.username = "Chicken";
return user;
Output:
/rest/users/1.json
{"Username":"Chicken","Userid":1.0}
/rest/users/1.xml
<COMPONENT ID="1" NAME="User">
<PROPERTY NAME="USERNAME" TYPE="STRING">Chicken</PROPERTY>
<PROPERTY NAME="USERID" TYPE="STRING">1</PROPERTY>
</COMPONENT>
/Users.cfc?method=getByPK&id=1&returnFormat=json
{"USERNAME":"Chicken","USERID":1}
Is this simply a quirk I have to put up with?Hello Jereme,
I've a similar requirement and trying to perform HTTP GET thorugh PI 7.31 HTTP Java adapter, My target URL looks like
https://abc.com/api?filterFields=<FilterFields><FilterField><Id>26</Id><Value>1/1/2013,12/31/2013</Value></FilterField></FilterFields>
I've configured my HTTP receiver adapter (Java) as below
Addressing mode - URL address
Target Host - https:abc.com
Target port: 8080
Path - /api
Where should I mention the query path - ?filterFields=<FilterFields><FilterField><Id>26</Id><Value>1/1/2013,12/31/2013</Value></FilterField></FilterFields>
Actually values inside the tag Value is dynamic and will be populated in message mapping,
What should be the value of Main Payload Parameter Name in the adapter?
Thanks in advance for your help. -
How to return multiple record with Oracle Native Web Service?
Dear all,
I would like to know that the oracle native web service can be able to return multiple records to client or not?
I successfully developed the oracle native web service for returning single record but the next challenge is to develop web service in order to return multiple record (like Employees data base on each department)
Thank and Regards,
ZenoniI successfully developed the oracle native web service for returning single record but the next challenge is to develop web service in order to return multiple record (like Employees data base on each department)You could return a list (multiple values/records) in XML format (using XMLType or CLOB), or CSV, or JSON, or whatever.
function get_employees (p_department_id in number) return clob
as
begin
return 'your_xml_string_here';
end get_employees;It would be up to the client (the caller of the web service) to extract the values from whatever format you decide upon, of course.
- Morten
http://ora-00001.blogspot.com -
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 PMHi 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 -
APEX post restful service inserts null value
Oracle APEX 4.2.5
Oracle Rest Data Service 2.0.7
Apache Tomcat 7
Oracle database 11.2.0.4
Oracle APEX PUT web service inserts null value into column. This is either a bug or the documentation does not properly cover how to correctly set PUT restful services.
GET web services works fine.
I have granted the role of apex_rest_public_user to both apex_public_user and the schema owner.
The payload is a small xml document, but even a text document will yield the same result.
I am using the Oracle REST Data Service 2.0.5
Web service code:
RESTful Service Module: software_details/
URI Template: xml_parser
Method: POST
Source Type: PL/SQL
MIME: Types Allowed: application/xml
Requires Secure Access: NO
Source :
begin
insert into clob_test (x)
values (blob_to_clob(:body)); ## according to some online post, :body is where APEX places any data being transferred through a web service. I have yet to find any official ##documentation on it.
commit:
end;
##Blob_to_clob function code
CREATE OR REPLACE FUNCTION blob_to_clob (blob_in IN BLOB)
RETURN CLOB
AS
v_clob CLOB;
v_varchar VARCHAR2(32767);
v_start PLS_INTEGER := 1;
v_buffer PLS_INTEGER := 32767;
BEGIN
DBMS_LOB.CREATETEMPORARY(v_clob, TRUE);
FOR i IN 1..CEIL(DBMS_LOB.GETLENGTH(blob_in) / v_buffer)
LOOP
v_varchar := UTL_RAW.CAST_TO_VARCHAR2(DBMS_LOB.SUBSTR(blob_in, v_buffer, v_start));
DBMS_LOB.WRITEAPPEND(v_clob, LENGTH(v_varchar), v_varchar);
v_start := v_start + v_buffer;
END LOOP;
RETURN v_clob;
END blob_to_clob;
#Table code
create table clob_test(
x clob));
Thank you,I am experiencing the same issue.
I implemented the 'chunked file loading' example from Kris Rice's blog at Kris' blog: August 2013 in y workspace at the Oracle hosted APEX site and everything works fine.
However, I get a null value for 'data' when I implement the same example at my work site.
Work Site config is
Apache Tomcat 7
Oracle REST Data Services version : 2.0.6.27.18.06
Application Express 4.2.2.00.11
Oracle RDBMS 11.2.0.3
I am NOT using SSL at my work site. However this does not seem to affect a POST with form values.
Varad. -
Getting "Origin is not allowed" When Trying to Invoke RESTful Service from Another Domain
I am having problems trying to invoke my RESTful web service from a different domain. I'm well aware of the normal restrictions of cross-site / cross-domain scripting but in Oracle documentation it says that all origins are allowed by default when creating a RESTful service without using authentication.
I have created a very simple service and am trying to invoke it using jQuery.Ajax calls from a different domain and I am getting XMLHttpRequest cannot load http://address_to_my_web_service. Origin http://calling_from_address is not allowed by Access-Control-Allow-Origin.
I understand that using JSONP instead of JSON is actually the best practice around cross-site scripting but it appears as though APEX does not support JSONP because with JSONP, there are URI parameters added to the base request (callback).
I am stuck and would greatly appreciate any help.
I'm starting to wonder if this could be a bug because Oracle documentation says all origins should be allowed when using a service that does not require authentication. I also tried to force the origin to be allowed by typing it in and also using the wildcard '*' and it still did not work.
Thanks,
Mark Williamson
EDIT: It is now working after adding a URI prefix to my web service module.The SSL handshake works differently to a browser as it is making the connections automatically.
The browser asks every time if you want to trust an expired certificate, and it also recommends not to. Its impractical to manually check every service call to say do you trust the certificate so the functionality doesn't exist. I doubt any integration product does this. Therefore there isn't a option to ignore the certificate if it has expired.
This makes sence as the certificate is untrustworthy. The whole idea around SSL is trusting the site you are communicating with, all parties need to be trusted. This stops hackers from replicating their site and intercepting data.
If the administrator of the remote site is not willing to renew the certificate, are they really interested in SSL. I suggest they expose a non SSL service.
cheers
James -
Error when calling simple restful service from SOA 11G
Hi'
I have a URL for simple restful service
http://xxxxx:857/swift/v2/EMPIDChanges/{bookmarkDate}
GET method
I am able to invoke this from IE and This URL is also accessible in UNIX server where SOA server is deployed.
http://xxxxx:857/swift/v2/EMPIDChanges/2012-11-28%2005:57:49
I am using HTTP Binding adapter,
This is what goes in the composite.xml
<reference name="ff" ui:wsdlLocation="ff.wsdl">
<interface.wsdl interface="http://xmlns.oracle.com/pcbpel/adapter/http/AssetID/Test_AssetID_VL/ff#wsdl.interface(Request_Response_ptt)"/>
<binding.ws port="http://xmlns.oracle.com/pcbpel/adapter/http/AssetID/Test_AssetID_VL/ff#wsdl.endpoint(ff/Request_Response_pt)"
location="ff.wsdl" supports="http">
<property name="http.verb" type="xs:string" many="false">GET</property>
<property name="endpointURI" type="xs:string" many="false">http://xxxxx:857/swift/v2/EMPIDChanges/{bookmarkDate}</property>
<property name="http.payload" type="xs:string" many="false">url-encoded</property>
<property name="oracle.webservices.auth.username" type="xs:string" many="false" override="may">Test1</property>
<property name="oracle.webservices.auth.password" type="xs:string" many="false" override="may">Test1</property>
</binding.ws>
however I am getting error
<remoteFault xmlns="http://schemas.oracle.com/bpel/extension">
-<part name="summary">
<summary>oracle.fabric.common.FabricInvocationException: Unable to access the following endpoint(s): REPLACE_WITH_ACTUAL_URL</summary>
</part>
-<part name="detail">
<detail>Unable to access the following endpoint(s): REPLACE_WITH_ACTUAL_URL</detail>
</part>
-<part name="code">
<code>null</code>
</reference>
Please advice,
Thanks,
YatanWS Binding: exception durign SOAP invocation: java.util.NoSuchElementException
Looks like the error is in the data sent to or expected from the service in your composite. Check that audit logs and composite flow to make sure your soap message when using soapui matches what you are working with in soa suite. -
How to POST the data though Rest services though composite object.
I am new to REST services.
I need to write REST Serivices to post(Update) the data using Composite object.
I created the structure to pass the composite object from jquery to the REST services.
How can i handle that composite object in REST Services URITemplate and interface methods.
can i have sample code to handle the composite object in REST Services?
Thanks in advance.Did you check this post?
http://sharepoint.stackexchange.com/questions/25222/posting-json-to-a-rest-wcf-endpoint-in-sharepoint-using-cksdev
--Cheers -
How to call rest service with POST Http method in SMP2.3 HWC?
Hi Experts,
I am doing a sample for Rest Service in smp.
http://192.168.1.119:8086/Test/services/Products
I am calling the above service in the smp it is pulling the data from the service with GET Http Method.
Now i want to call this service for login functionality.
http://192.168.1.119:8086/Test/services/auth?uname=:uname&pass=:pass
here :uname &:pass values are argument values for the uname & pass.
the output of the service is
http://192.168.1.119:8086/Test/services/auth?uname=sravanya.k&pass=sravanya
<?xml version="1.0" encoding="UTF-8"?>
<details>
<responsecode>200</responsecode>
<profile>
<firstname>sravanya</firstname>
<lastname>k</lastname>
<email>[email protected]</email>
<chart_type>North</chart_type>
<location>MACHILIPATNAM</location>
<language>English</language>
</profile>
</details>
How can i do this?
Thanks & Regards,
Sravanya KCreate a uriTemplate like this
/auth?uname={uname}&pass={pass}
use GET method only.
generate the personalization keys. -
[OSB] - Calling REST Service - POST action
Hi,
I have a requirement to invoke a REST full service to pass on the processed XML message. I know OSB supports both calls via Proxy and Business services. I have tested it with HTTP and it works. However, my server side REST service is to be invoked/called over HTTPS.
Request you to please let me know what I need to look for while implementing this requirement. Any help in this case will be appreciated. Thanks.
Regards.Please refer - for Post implementation
http://blogs.oracle.com/jeffdavies/entry/restful_services_with_oracle_s_1 -
RESTful service with POST, GET, PUT and DELETE
I'm implementing a RESTful service, but mod_plsql only gives me GET, POST and HEAD commands.
However, if I try to use the PUT command, the response is:
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<HTML><HEAD>
<TITLE>501 Method Not Implemented</TITLE>
</HEAD><BODY>
<H1>Method Not Implemented</H1>
PUT to *** not supported.<P>
mod_plsql: request method not supported<P>
<HR>
<ADDRESS>Oracle-Application-Server-10g/10.1.3.1.0 Oracle-HTTP-Server Server at *** Port 80</ADDRESS>
</BODY></HTML>Is it possible to add support for PUT and DELETE in mod_plsql?
I've search all packages and code, but I haven't found anything that specifies the valid HTTP commands or the source for generating the above error message.AIR supports all the specified HTTP methods, but there seems to be a bug in the HTTPService class. Instead you should use URLLoader and URLRequest. If you change to that you won't even need to use the Method Override header.
Read more here : http://spy6.blogspot.com/2009/06/adobe-air-put-delete-head-http-methods.html . -
OSB: When does invokation from http Business Service result into an error
Hi,
I want to know when does invokation from http Business Service in OSB result into an error.
I have a http based business service which is calling an external service on http url.
I want to know when this business service is invoke/tested, what are the cases in which the invokation will result into an error.
What does OSB read to cause the invokation an error.
I am aware that it reads the http-response-code. If its not 200 or 0, it will result into an error.
Want to validate this understanding and also want to know what are the other case that will cause this happen. Is it by any way dependent on body content?
Please help. Please share any good links for the topics related to this.
TIA.
Regards,
AshishHi,
Some info here...
http://svgonugu.wordpress.com/2011/06/15/fault-handling-in-osb/
Cheers,
Vlad -
I'm trying to place a phone call and when I do the 3G icon goes away and the phone just says connecting but never does. I have almost full service and only have had my new iPhone 5 for two days. Can anyone help because I can't call Sprint at the moment???
Settings > General > Reset > Reset Network Settings
Maybe you are looking for
-
I am trying to download Firefox on my laptop which runs Vista. I am getting the following error message: Your Firefox profile can't be loaded, it may be missing or innaccessible." Please help.
-
External Drive attached to Time Capsule failing to work consistently
This problem has been occurring since we started using an external drive attached to our Time Capsule as a backup destination for Time Machine over a year ago: Everything will be fine for a few days or weeks, but at some point backups stop working. T
-
Content disappears in landscape mode on ipad
Hi there, I am having trouble with one of my pages disappearing in Safari on the iPad. Here is the page: http://www.sbceoportal.org/ets/app_files/trucking_ipad.html In portrait mode it looks fine, but in landscape mode the only part that remains visi
-
Hi SAPians, We are a bunch of SAP trainees, and have recently completed a corporate training as a final year project. We need to prepare documentation, report and presentation for project completion and degree. we have all the screen shots, theory ex
-
I knew I shouldn't have done this .... blinking cursor
So my Windows install asked me to insert an older version of Windows to verify my license (I was installing the XP upgrade) and I couldn't eject the CD to put the other one in. I rebooted and finally figured out how to hard eject it. Now when I reboo