JSON to XML
HI,
I prefer JSON for my PHP bidirectional flex communications,
its fast and I don't need to install anything on the back end.
I do all my post this way really fast and convenient.
Anyway I have an array thats coming from a third party soap
services, yes I know soap should be return as XML but this comes as
a multi-dimensional array. I have no control over this as its third
party. Any way I want to send this back to my swf file as JSON.
Once in my flex app I want to decode the jason back to an
array and then make into an XML suitable for the tree control. Is
there any built in method for this.
Thanks in advance
Dean
Hey, I am sure there are some methods because when you are
using webservices the framework decodes and encodes objects to and
from xml (with the help of the wsdl file), but I think it would be
quite easier and much faster to write your own
object-to-xml-decoder.
cheers
Similar Messages
-
JSON to XML conversion using NXSD
Is there a way to influence the element names in XML when converting from JSON to XML. My problem is the external service is returning JSON with field names like "12345" or "$data", which is valid according to the JSON specification, but cannot be converted to XML as these are not valid XML element names.
Hi Mohan -
As per osb-206-JSONREST demo available on Oracle sample code, this is using a Xquery file to transform a JOSN data to XML based no XSD tags.
Could you please redirect me to some sample code which one is using APIs with OSB code. -
Anychart bar graphs - Can we map colors to customer IDs in JSON/XML dynamically?
Hi,
We are using the Anychart bar graphs to show our customers data. We need to be able to map colors to customer IDs, so that anytime we use a bar chart a customer will aways be the same color.
Example: if one view shows 3 customers (cust ABC is maroon, XYZ is yellow and DXA is blue) and a second view, because of the data, shows 12 customers, that if 2 that are in the first view are also showing they would have the same colors as they did in the first view (cust ABC is still maroon and cust DXA is still blue and if XYZ is not in the second view then Yellow would not be present)
Is there a way to map the colors to the customers in an XREF table then build the JSON or XML dynamically and use that in the graph each time?
I have found the Anychart site and it looks like it is possible but was wondering if anyone has done it? Otherwise it looks like it is going to be to time consuming to read everything I would have to read.
Thank you,
Billthanks for passing this link Stijin,
http://oraclebizint.wordpress.com/2007/09/25/oracle-bi-ee-10133-and-mapviewer-step-by-step-integration-phase1/
http://oraclebizint.wordpress.com/2007/09/26/oracle-bi-ee-10133-and-mapviewer-step-by-step-integration-phase2-phase3/
i already used this, but we need at least full explanation in how to build OBIE presentations layers and its physical and logical datas , and how to write codes using Java scrips and html codes using OBIE presentation on statistics text.
if any of you just can link me link regarding to workshop lab's documentations and files regarding to OBIEE integrated to Mapviewer.
with fully respect and love to you all,
Yusuf Felemban -
Provide XML or json format API
I love Curah!, it's simple and clean service. Wouldn't it be great if it serve curated contents with json or xml format? I want to display my contents via my Windows Store App.
Can you tell us a little more about how you would use a Curah! API? Is the goal to display your own curations in a Windows Store App? If so, would a curator-specific RSS feed meet your needs? Or are you interested in other use cases too?
Sorry for the late reply.
It would be great to have REST interface not only fetching list of articles but also submitting new items. I'm building statistics learning app, so if Curah provides REST interface, I can mix and personalize contents list with
YouTube video link, Wikipedia articles, etc in order to share to my colleagues. -
JAVA Mapping for XML conversion during runtime
Dear SAP JAVA experts,
For quite I have been struggling to keep the JAVA code in place for JSON to XML conversion being a newbie.
Following is the code snippet.
import java.io.InputStream;
import net.sf.json.JSON;
import net.sf.json.JSONSerializer;
import net.sf.json.xml.XMLSerializer;
import org.apache.commons.io.IOUtils;
import com.sap.aii.mapping.api.AbstractTransformation;
import com.sap.aii.mapping.api.StreamTransformationException;
import com.sap.aii.mapping.api.TransformationInput;
import com.sap.aii.mapping.api.TransformationOutput;
import com.sap.aii.utilxi.core.io.IOUtil;
public class RuntimeJSONtoXML extends AbstractTransformation {
public void transform(TransformationInput input, TransformationOutput output)
throws StreamTransformationException {
try
//InputStream is = JSONtoXML.class.getResourceAsStream("JSON.txt");
String strJSON = "";
InputStream inputStream = input.getInputPayload().getInputStream();
inputStream.close();
String jsonData = IOUtils.toString(strJSON);
XMLSerializer serializer = new XMLSerializer();
JSON json = JSONSerializer.toJSON( jsonData );
String xml = serializer.write( json );
//System.out.println(xml);
output.getOutputPayload().getOutputStream().write(strJSON.getBytes());
catch(Exception ie) { }
Caught unaware of 2 queries.
1.I have added the com.sap.aii.utilxi.core.io.IOUtil jar files from the PI server even though its displays error "The com.sap.aii.utilxi can not be resolved". Also I added the XPI libraries in NWDS but nothing moving to solve the issue.
2. I have commented the line of code where I have placed a test file in the path to test it i.e. JSON.text. But when it is deployed as Archived files, then this code has to be replaced.
The Method toString(InputStream) in the type IOUtils is not applicable for the arguments (String)
Regards
Rebecca..1.I have added the com.sap.aii.utilxi.core.io.IOUtil jar files from the PI server even though its displays error "The com.sap.aii.utilxi can not be resolved". Also I added the XPI libraries in NWDS but nothing moving to solve the issue.
Which jar file did you add?
/usr/sap/<<SID>>/DVEBMGS<<SYSNO>>/j2ee/cluster/bin/ext/com.sap.xi.util.misc/lib
jar file name : com.sap.aii.utilxi.core.jar
2. I have commented the line of code where I have placed a test file in the path to test it i.e. JSON.text. But when it is deployed as Archived files, then this code has to be replaced.
The Method toString(InputStream) in the type IOUtils is not applicable for the arguments (String)
To read the input stream you should have
InputStream inputstream = transformationInput.getInputPayload().getInputStream();
Please refer to below blog just to get an idea on working with input stream and output stream.
Dynamic file name for pass-through scenario - Process Integration - SCN Wiki -
Create report based on JSON data
Dear All,
I'm on Oracle APEX 4.1 and Oracle 11g. I'm receiving JSON data in my application and would like to print report based on JSON data without storing it in any table.
Can you please suggest best way to achieve it?
Regards,
ChintanHi,
in 4.1 you can for example use the open source PL/JSON library (http://sourceforge.net/projects/pljson/) to parse JSON.
In APEX 5.0, we currently plan to add a JSON API package that e.g. can be used to convert JSON to XML. Here is an example:
SQL> select col1, col2
2 from xmltable (
3 '/json/row'
4 passing apex_json.parse('[{"col1": 1, "col2": "hello"},{"col1": 2, "col2": "world"}]')
5 columns
6 col1 number path '/row/col1',
7 col2 varchar2(5) path '/row/col2' );
COL1 COL2
1 hello
2 world
At the last OOW, it was also announced that the RDBMS will provide native support. That should be the preferred option in the future.
Regards,
Christian -
Can't figure out how to parse JSON list of lists into a table
JSON returned (from google analytics) has an entry like:
"rows": [
"(none)",
"148"
"email",
"2"
"organic",
"183"
"referral",
"140"
In Power Query the column heading is "List" and each row has "List" which I can drill into. But I need to instead expand this into a table with 4 rows and 2 columns.I thought to transform this JSON into XML Spreadsheet format, but I just did a test and Power Query cannot parse Excel XML Spreadsheet files. Frankly I was surprised that it couldn't read it since it is a native Excel format.
If I were to transform my JSON into a format that Power Query can understand and that allows me to specify data types and ideally also formats, what text file formats should I be considering. XML Spreadsheet is the only text file format I know that
allows you to specify data types. But I have a feeling that I am overlooking some other options.
OData would be great except that Power Query insists on also asking for the metadata in a separate call. It would be great if Power Query could RESTify the OData request by either not making the $metadata request (another argument to the OData function?)
or just continuing on if that HTTP call failed. -
Receiving JSON message in BPEL
Hi All,
We have a requirement in our project to expose a Restful web service which receives messages in JSON format. We tried using HTTP Binding but it accepts only XML message. As a workaround we are now trying to introduce a proxy java service which converts this JSON to XML and pass along the message to our service. we feel that this is a overhead on the server.
Is there any other way to solve this issue?
We are using SOA Suite 11.1.1.4. Any help is highly appreciated.
Thanks in advance,
Kaushik PHi,
Here are some references...
JSON-Lib can do the interface XML - JSON
http://json-lib.sourceforge.net/
Biemond's blog is also always a good reference...
http://biemond.blogspot.com.au/2009/05/osb-rest-service-with-xml-json-output.html
Raja's blog has an example about how to call a REST service using HTTP Binding...
http://rajbpelblog.blogspot.com.au/2010/10/http-binding-in-soa11g.html
Cheers,
Vlad -
OSB Conversion of Soap Service to JSON
Hi All,
I have a SOAP service that returns a list of employees which needs to be exposed in JSON format. I have nearly implemented this using XMLBeans by doing the following.
In the message flow of OSB, the JSON request is converted into XML and a Service Callout is made to the SOAP service which returns the Employees list in the response. The SOAP response is then assign to the variable 'responseXML' and then a Java callout is made to convert the 'responseXML' to JSON response. The Java callout method is as below. The XMLObject parameter passed from the OSB is a XMLfragment instead of the full XML document.
public static String employeeListResponseXmlToJson(XmlObject xml) {
System.out.println("employeeListResponseXmlToJson() called with: " + xml.toString());
ObjectWriter writer = EmployeeServiceMapperFactory
.getEmployeeListWriter();
EmployeeListResponse employeeListResponse = new EmployeeListResponse();
ArrayList <au.gov.vic.ambulance.pojo.Employee> employeeList = new ArrayList<au.gov.vic.ambulance.pojo.Employee>();
String json = null;
try {
EmployeesDocument doc = EmployeesDocument.Factory.parse(xml.newXMLStreamReader());
if (doc instanceof EmployeesDocument) {
EmployeesDocument employeesDoc = (EmployeesDocument) doc;
Employees source = employeesDoc.getEmployees();
for (Employee emp: source.getEmployeeArray())
au.gov.vic.ambulance.pojo.Employee employee = new au.gov.vic.ambulance.pojo.Employee();
employee.setEmployeeNumber(emp.getEmployeeNumber());
employee.setFirstName(emp.getFirstName());
employee.setMiddleName(emp.getMiddleName());
employee.setLastName(emp.getLastName());
employee.setPreferredName(emp.getPreferredName());
employee.setPreviousLastName(emp.getPreviousLastName());
employee.setTitle(emp.getTitle());
employee.setHireDate(emp.getHireDate());
employeeList.add(employee);
employeeListResponse.setEmployeeArr(employeeList);
json = writer.writeValueAsString(employeeListResponse);
} catch (XmlException e) {
e.printStackTrace();
} catch (JsonGenerationException e) {
e.printStackTrace();
} catch (JsonMappingException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
return json;
The XML in the 'responseXML' variable is a as below
<Employees xmlns:es="http://abc.com/employee>
<Employee>
</Employee>
<Employee>
</Employee>
</Employees>
The XML after Java callout is made from OSB is a as below.
<xml-fragment>
<Employee>
</Employee>
<Employee>
</Employee>
</xml-fragment>
Why is OSB not passing the entire XMLDocument? Please suggest and help.
ThanksUse the JSON libraries like jackson, Gson etc. to convert the from java collection to json that would be much easier. I recently done the same in my webservices.
Regards,
Anshul -
hey all 3.4 promo was saying that there was new JSON support? What whas changed?
Im braking my head trying to figure out how to take JSON response and var response {la:aa} to array or something so i can access returned value with response["la"] or something like that....
any help is appreciatedHi Ujjwal,
BizTalk 2013 and below has no native JSON to Xml capabilities. While writing JsonDecoder pipeline component or one
for a JsonEncoder pipeline component, projects will be taking a dependency on Newtonsoft’s excellent Json.NET library for the actual JSON serialization/deserialization.
There are many articles online around this.
BIZTALK SERVER 2013
SUPPORT FOR RESTFUL SERVICES
Json, Send and Receive
Pipelines for BizTalk Server.
It is in Biztalk 2013 R2 that microsoft has released 2 new pipelines and components for encoding and decoding JSON messages in BizTalk Ports.
Create custom pipelines to process JSON messages
What’s new in BizTalk 2013 R2: WCF-WebHttp Adapter
Rachit
Please mark as answer or vote as helpful if my reply does -
I m building a wcf service n exploring whether I should use JSON or XML. JSON will reduce payload size but I think xml is default config/setting. With JSON, do we need to do any additional setting?
my calling client is a windows service. Is JSON applicable only for web applications? Do I need to serialize in calling code before sending to service and then de-serialize again when service response come back?
thnx in advnce.Yes, json is better.
Vote if help you -
Does Flash for iPhone/iPad support http (JSON) and .pdf loading?
Hi everyone -
I'll get to the point. I am aware that the iPhone/iPad dev kit for Flash has some performance issues, but I believe I am creating something REALLY simple that does not require complex animations (just menus and tweens). So my question(s) is this:
-I need clarification on what network protocols I can use to send and receive data from my app. Can I send / receive JSON data? I know stuff like RTMP is not likely supported (I read it peripherally somewhere) but I want to make sure I can send content like JSON or XML.
-Is it possible to launch a .pdf document from a flash mobile app (well, iPhone or iPad in this case) so that it stays within the application? I don't want it to display in a web browser within the device via some link. I read here
http://help.adobe.com/en_US/as3/iphone/WS789ea67d3e73a8b24b55b57a124b32b5b57-7fff.html
a reference to PDF support via HTMLLoader.pdfCapability as a check, but doesn't specify which devices (all devices? some? none)
Any help on this would be appreciated. It's painful to write in objective c (at least to me )
thanks
EdwardSVG charts from pre-4.0 versions of APEX work fine on iPhone/iPad.
This feature was deprecated in APEX 4.0 without any obvious pre-announcement, a decision that, with an apparently permanently Flash-less iOS and indications that Microsoft intend to add native SVG support to IE, may have been somewhat premature?
Ideally APEX would allow for transparent delivery of either Flash or SVG charts (based on an application preference), and the use of the standard graceful degradation feature of OBJECT elements to allow fail-over from the preferred format to the other where browser support is absent. -
Dear All,
I am trying to implement OSB service where is accepts JSON input and provides the output in the same format. Any pointers to this would be helpful.
I tried converting JSON to xml using JSON lib but however failed to do so.
TIA.
Regards,
Mithun S.Well thanks all for the inputs.
Tried doing things like JSON to xml formats and failed to get the output.
I have an API for Google geocode http://maps.googleapis.com/maps/api/geocode/json? which i am trying to hit via Biz service.
It's not any kind of Web-Service hence getting no results but errors.
Any suggestion, how can i use the above API to get an output in OSB.
Like adding the required address to the API gives me the desired output as in the link below
http://maps.googleapis.com/maps/api/geocode/json?address=Harrow%20HA2%200ET&sensor=false
TIA. -
Native JSON support in Next SQL Server Release
Dear Team,
With 9.3 and upcoming 9.4 release PostgreSQL has started supporting JSON data type. Oracle is following it in their 12c release, when can we expect this in MS SQL? Also will it cover native functions within DB engine which can translate JSON to XML and reverse?
Best Regards
Shrikant KulkarniThanks Cairney_M!! <o:p></o:p>
I did considered CLR and JSON parser UDF from - http://www.sqlservercentral.com/articles/SQLCLR/74160/ and https://www.simple-talk.com/sql/t-sql-programming/consuming-json-strings-in-sql-server/.
However I didn't fell code is traceable as well as scale-able. The one from Phil Factor looks great, it does handles recursion within nodes. Functionalities within PostgreSQL looks much complete where they have ability to CROSS APPLY (Lateral) with JSON
TFV's. <o:p></o:p>
we have unique situation here with JSON text strings coming from Mobile devices, moving to NO-SQL / SQL Azure platform couple be best option here
but standing up whole infrastructure and support for one of the feature is costly. <o:p></o:p>
I am hoping to see same in SQL Server soon and I did vote for it. Anyways - custom SQL CLR seems to be the best option for now. -
Hi
Can anyone help with some In depth tutorials on how to parse json files locally (in the project folder) and online (webservice) in WP8 development
Thank you in advance
Jayjay john1. Build up a strong type class for this json
Visual Studio 2013 Hidden Gem: Paste JSON or XML as C# Classes
2. use Json.Net to Deserialize , like:
var result = Newtonsoft.Json.JsonConvert.DeserializeObject<yourdatatype>(jsonstring);
Working with JSON in C#
在現實生活中,你和誰在一起的確很重要,甚至能改變你的成長軌跡,決定你的人生成敗。 和什麼樣的人在一起,就會有什麼樣的人生。 和勤奮的人在一起,你不會懶惰; 和積極的人在一起,你不會消沈; 與智者同行,你會不同凡響; 與高人為伍,你能登上巔峰。
Maybe you are looking for
-
I am using Lookout 4.5, build 12, and I am having a problem concerning pots. I have data tables created for the different size sewer stations my system monitors. For each station, there are setpoints for starting and stopping of the pumps. I want to
-
Is it possible to boot Bootcamp's Windows through another Mac's Superdrive?
Hello I have a 2011 Imac with a broken Superdrive ( like many Imacs before this one since this known problem keeps being unadressed ), and I was wondering if I could connect my Imac to my Macbook Pro that has a working superdrive, through remote devi
-
Different Exchange rate in MIRO
Hello, MIRO is being done in foregin currency (PO was also in foregin currency), but during MIRO, user wants to give his own exchange rate, instead of that being picked up system, since for these MM invoices, the physical billls which they are gettin
-
Robocopy Log File - Skipped files - Interpreting the Log file
Hey all, I am migrating our main file server that contains approximately 8TB of data. I am doing it a few large folders at a time. The folder below is about 1.2TB. Looking at the log file (which is over 330MB) I can see it skipped a large number of
-
Hebrew support for nano 2nd gen and ITunes
Hi, I have a new ipod nano. I've installed ITunes, and all my hebrew named files are being displayed with strange font (Giberish) Is there any way to get hebrew fonts support for the ipod nano and the ITune 7.0 software ? Dani