You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@tuscany.apache.org by Ashwini Kumar Jeksani <As...@infosys.com> on 2008/04/02 16:57:51 UTC

Reg: passing Javaobject using a JSON binding

Hi,
I have a service which is exposed over JSON binding and will return a java object as a response. I want the response data to be in an xml format when I call it from the .html file using DOJO, but I am getting the output as shown. Could anyone tell me how to convert the java object data to an xml in my case? Any help would be appreciated.


Code used in html file:

        var employeeService = new dojo.rpc.JsonService("EmployeeJSON?smd");

        employeeService.fetchEmployeeData(empID).addCallback(contentCallBack)

output:

        {"result": poc.employeedata.EmployeeData@b48b11,"id":1}


P.S: Here poc.employeedata.EmployeeData is the java bean

Thanks & Regards
Ashwini Kumar Jeksani


**************** CAUTION - Disclaimer *****************
This e-mail contains PRIVILEGED AND CONFIDENTIAL INFORMATION intended solely for the use of the addressee(s). If you are not the intended recipient, please notify the sender by e-mail and delete the original message. Further, you are not to copy, disclose, or distribute this e-mail or its contents to any other person and any such actions are unlawful. This e-mail may contain viruses. Infosys has taken every reasonable precaution to minimize this risk, but is not liable for any damage you may sustain as a result of any virus in this e-mail. You should carry out your own virus checks before opening the e-mail or attachment. Infosys reserves the right to monitor and review the content of all messages sent to or from this e-mail address. Messages sent to or from this e-mail address may be stored on the Infosys e-mail system.
***INFOSYS******** End of Disclaimer ********INFOSYS***

RE: Reg: passing Javaobject using a JSON binding

Posted by Ashwini Kumar Jeksani <As...@infosys.com>.
Hi,

I had opened the JIRA and attached the war file with it.
https://issues.apache.org/jira/browse/TUSCANY-2196


Thanks & Regards
Ashwini Kumar Jeksani


-----Original Message-----
From: Raymond Feng [mailto:enjoyjava@gmail.com]
Sent: Thursday, April 03, 2008 9:10 PM
To: tuscany-user@ws.apache.org
Subject: Re: Reg: passing Javaobject using a JSON binding

Hi,

Would you please open a JIRA [1] and attach your test case there? It will
help us resolve the issue more effectively.

[1] https://issues.apache.org/jira/browse/TUSCANY

Thanks,
Raymond

--------------------------------------------------
From: "Ashwini Kumar Jeksani" <As...@infosys.com>
Sent: Thursday, April 03, 2008 6:22 AM
To: <tu...@ws.apache.org>
Subject: RE: Reg: passing Javaobject using a JSON binding

> Hi Raymond,
>
> This might help you debugging.
>
> http://localhost:8080/EmployeeService?smd
> =========================================
>
> {"SMDVersion":".1","objectName":"EmployeeBOService","serviceType":"JSON-RPC","serviceURL":"http://localhost:8080/EmployeeService","methods":[{"name":"fetchEmployeeData","parameters":[{"name":"param0","type":"STRING"}]}]}
>
>
> After browsing through my problem I came to an opinion that the java bean
> is not properly converted to jsonobject. Am I right here? could you please
> help me debug my issue?
>
> My Console:
>
>     [java] Apr 3, 2008 6:15:12 PM
> org.apache.tuscany.sca.http.jetty.JettyServer addServletMapping
>     [java] INFO: Added Servlet mapping:
> http://hydhtc43236:8080/EmployeeService/*
>     [java] Apr 3, 2008 6:15:12 PM
> org.apache.tuscany.sca.http.jetty.JettyServer addServletMapping
>     [java] INFO: Added Servlet mapping:
> http://hydhtc43236:8080/EmployeeService
>     [java] Apr 3, 2008 6:15:12 PM
> org.apache.tuscany.sca.http.jetty.JettyServer addServletMapping
>     [java] INFO: Added Servlet mapping:
> http://hydhtc43236:8080/SCADomain/scaDomain.js
>     [java] Apr 3, 2008 6:15:12 PM
> org.apache.tuscany.sca.http.jetty.JettyServer addServletMapping
>     [java] INFO: Added Servlet mapping: http://hydhtc43236:8080/*
>     [java] Employee Details server started (press enter to shutdown)
>     [java] Name :admin
>     [java] DOJ :2006-06-26 00:00:00.0
>     [java] EMAIL :admin@test.com
>     [java] Apr 3, 2008 6:15:28 PM com.metaparadigm.jsonrpc.BeanSerializer
> analyzeBean
>     [java] INFO: analyzing employeedata.EmployeeData
>
>
> Thanks & Regards
> Ashwini Kumar Jeksani
>
>
> -----Original Message-----
> From: Ashwini Kumar Jeksani [mailto:Ashwini_Jeksani@infosys.com]
> Sent: Thursday, April 03, 2008 6:17 PM
> To: tuscany-user@ws.apache.org
> Subject: RE: Reg: passing Javaobject using a JSON binding
>
> Hi Raymond,
>
> Thanx for the help but now I am getting [object Object] in the response
> could you tell me how to convert it?
>
> Thanks & Regards
> Ashwini Kumar Jeksani
>
> -----Original Message-----
> From: Raymond Feng [mailto:enjoyjava@gmail.com]
> Sent: Wednesday, April 02, 2008 9:01 PM
> To: tuscany-user@ws.apache.org
> Subject: Re: Reg: passing Javaobject using a JSON binding
>
> Hi,
>
> It seem that the java bean has not been transformed into JSON. Do you have
> the @Remotable annotation on the service interface exposed over
> binding.jsonrpc?
>
> Thanks,
> Raymond
> --------------------------------------------------
> From: "Ashwini Kumar Jeksani" <As...@infosys.com>
> Sent: Wednesday, April 02, 2008 7:57 AM
> To: <tu...@ws.apache.org>
> Subject: Reg: passing Javaobject using a JSON binding
>
>>
>> Hi,
>> I have a service which is exposed over JSON binding and will return a
>> java
>> object as a response. I want the response data to be in an xml format
>> when
>> I call it from the .html file using DOJO, but I am getting the output as
>> shown. Could anyone tell me how to convert the java object data to an xml
>> in my case? Any help would be appreciated.
>>
>>
>> Code used in html file:
>>
>>        var employeeService = new
>> dojo.rpc.JsonService("EmployeeJSON?smd");
>>
>>
>> employeeService.fetchEmployeeData(empID).addCallback(contentCallBack)
>>
>> output:
>>
>>        {"result": poc.employeedata.EmployeeData@b48b11,"id":1}
>>
>>
>> P.S: Here poc.employeedata.EmployeeData is the java bean
>>
>> Thanks & Regards
>> Ashwini Kumar Jeksani
>>
>>
>> **************** CAUTION - Disclaimer *****************
>> This e-mail contains PRIVILEGED AND CONFIDENTIAL INFORMATION intended
>> solely for the use of the addressee(s). If you are not the intended
>> recipient, please notify the sender by e-mail and delete the original
>> message. Further, you are not to copy, disclose, or distribute this
>> e-mail
>> or its contents to any other person and any such actions are unlawful.
>> This e-mail may contain viruses. Infosys has taken every reasonable
>> precaution to minimize this risk, but is not liable for any damage you
>> may
>> sustain as a result of any virus in this e-mail. You should carry out
>> your
>> own virus checks before opening the e-mail or attachment. Infosys
>> reserves
>> the right to monitor and review the content of all messages sent to or
>> from this e-mail address. Messages sent to or from this e-mail address
>> may
>> be stored on the Infosys e-mail system.
>> ***INFOSYS******** End of Disclaimer ********INFOSYS***
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tuscany-user-unsubscribe@ws.apache.org
> For additional commands, e-mail: tuscany-user-help@ws.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: tuscany-user-unsubscribe@ws.apache.org
For additional commands, e-mail: tuscany-user-help@ws.apache.org


Re: Reg: passing Javaobject using a JSON binding

Posted by Raymond Feng <en...@gmail.com>.
Hi,

Would you please open a JIRA [1] and attach your test case there? It will 
help us resolve the issue more effectively.

[1] https://issues.apache.org/jira/browse/TUSCANY

Thanks,
Raymond

--------------------------------------------------
From: "Ashwini Kumar Jeksani" <As...@infosys.com>
Sent: Thursday, April 03, 2008 6:22 AM
To: <tu...@ws.apache.org>
Subject: RE: Reg: passing Javaobject using a JSON binding

> Hi Raymond,
>
> This might help you debugging.
>
> http://localhost:8080/EmployeeService?smd
> =========================================
>
> {"SMDVersion":".1","objectName":"EmployeeBOService","serviceType":"JSON-RPC","serviceURL":"http://localhost:8080/EmployeeService","methods":[{"name":"fetchEmployeeData","parameters":[{"name":"param0","type":"STRING"}]}]}
>
>
> After browsing through my problem I came to an opinion that the java bean 
> is not properly converted to jsonobject. Am I right here? could you please 
> help me debug my issue?
>
> My Console:
>
>     [java] Apr 3, 2008 6:15:12 PM 
> org.apache.tuscany.sca.http.jetty.JettyServer addServletMapping
>     [java] INFO: Added Servlet mapping: 
> http://hydhtc43236:8080/EmployeeService/*
>     [java] Apr 3, 2008 6:15:12 PM 
> org.apache.tuscany.sca.http.jetty.JettyServer addServletMapping
>     [java] INFO: Added Servlet mapping: 
> http://hydhtc43236:8080/EmployeeService
>     [java] Apr 3, 2008 6:15:12 PM 
> org.apache.tuscany.sca.http.jetty.JettyServer addServletMapping
>     [java] INFO: Added Servlet mapping: 
> http://hydhtc43236:8080/SCADomain/scaDomain.js
>     [java] Apr 3, 2008 6:15:12 PM 
> org.apache.tuscany.sca.http.jetty.JettyServer addServletMapping
>     [java] INFO: Added Servlet mapping: http://hydhtc43236:8080/*
>     [java] Employee Details server started (press enter to shutdown)
>     [java] Name :admin
>     [java] DOJ :2006-06-26 00:00:00.0
>     [java] EMAIL :admin@test.com
>     [java] Apr 3, 2008 6:15:28 PM com.metaparadigm.jsonrpc.BeanSerializer 
> analyzeBean
>     [java] INFO: analyzing employeedata.EmployeeData
>
>
> Thanks & Regards
> Ashwini Kumar Jeksani
>
>
> -----Original Message-----
> From: Ashwini Kumar Jeksani [mailto:Ashwini_Jeksani@infosys.com]
> Sent: Thursday, April 03, 2008 6:17 PM
> To: tuscany-user@ws.apache.org
> Subject: RE: Reg: passing Javaobject using a JSON binding
>
> Hi Raymond,
>
> Thanx for the help but now I am getting [object Object] in the response 
> could you tell me how to convert it?
>
> Thanks & Regards
> Ashwini Kumar Jeksani
>
> -----Original Message-----
> From: Raymond Feng [mailto:enjoyjava@gmail.com]
> Sent: Wednesday, April 02, 2008 9:01 PM
> To: tuscany-user@ws.apache.org
> Subject: Re: Reg: passing Javaobject using a JSON binding
>
> Hi,
>
> It seem that the java bean has not been transformed into JSON. Do you have
> the @Remotable annotation on the service interface exposed over
> binding.jsonrpc?
>
> Thanks,
> Raymond
> --------------------------------------------------
> From: "Ashwini Kumar Jeksani" <As...@infosys.com>
> Sent: Wednesday, April 02, 2008 7:57 AM
> To: <tu...@ws.apache.org>
> Subject: Reg: passing Javaobject using a JSON binding
>
>>
>> Hi,
>> I have a service which is exposed over JSON binding and will return a 
>> java
>> object as a response. I want the response data to be in an xml format 
>> when
>> I call it from the .html file using DOJO, but I am getting the output as
>> shown. Could anyone tell me how to convert the java object data to an xml
>> in my case? Any help would be appreciated.
>>
>>
>> Code used in html file:
>>
>>        var employeeService = new 
>> dojo.rpc.JsonService("EmployeeJSON?smd");
>>
>>
>> employeeService.fetchEmployeeData(empID).addCallback(contentCallBack)
>>
>> output:
>>
>>        {"result": poc.employeedata.EmployeeData@b48b11,"id":1}
>>
>>
>> P.S: Here poc.employeedata.EmployeeData is the java bean
>>
>> Thanks & Regards
>> Ashwini Kumar Jeksani
>>
>>
>> **************** CAUTION - Disclaimer *****************
>> This e-mail contains PRIVILEGED AND CONFIDENTIAL INFORMATION intended
>> solely for the use of the addressee(s). If you are not the intended
>> recipient, please notify the sender by e-mail and delete the original
>> message. Further, you are not to copy, disclose, or distribute this 
>> e-mail
>> or its contents to any other person and any such actions are unlawful.
>> This e-mail may contain viruses. Infosys has taken every reasonable
>> precaution to minimize this risk, but is not liable for any damage you 
>> may
>> sustain as a result of any virus in this e-mail. You should carry out 
>> your
>> own virus checks before opening the e-mail or attachment. Infosys 
>> reserves
>> the right to monitor and review the content of all messages sent to or
>> from this e-mail address. Messages sent to or from this e-mail address 
>> may
>> be stored on the Infosys e-mail system.
>> ***INFOSYS******** End of Disclaimer ********INFOSYS***
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tuscany-user-unsubscribe@ws.apache.org
> For additional commands, e-mail: tuscany-user-help@ws.apache.org
>
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: tuscany-user-unsubscribe@ws.apache.org
For additional commands, e-mail: tuscany-user-help@ws.apache.org


RE: Reg: passing Javaobject using a JSON binding

Posted by Ashwini Kumar Jeksani <As...@infosys.com>.
Hi Raymond,

This might help you debugging.

http://localhost:8080/EmployeeService?smd
=========================================

{"SMDVersion":".1","objectName":"EmployeeBOService","serviceType":"JSON-RPC","serviceURL":"http://localhost:8080/EmployeeService","methods":[{"name":"fetchEmployeeData","parameters":[{"name":"param0","type":"STRING"}]}]}


After browsing through my problem I came to an opinion that the java bean is not properly converted to jsonobject. Am I right here? could you please help me debug my issue?

My Console:

     [java] Apr 3, 2008 6:15:12 PM org.apache.tuscany.sca.http.jetty.JettyServer addServletMapping
     [java] INFO: Added Servlet mapping: http://hydhtc43236:8080/EmployeeService/*
     [java] Apr 3, 2008 6:15:12 PM org.apache.tuscany.sca.http.jetty.JettyServer addServletMapping
     [java] INFO: Added Servlet mapping: http://hydhtc43236:8080/EmployeeService
     [java] Apr 3, 2008 6:15:12 PM org.apache.tuscany.sca.http.jetty.JettyServer addServletMapping
     [java] INFO: Added Servlet mapping: http://hydhtc43236:8080/SCADomain/scaDomain.js
     [java] Apr 3, 2008 6:15:12 PM org.apache.tuscany.sca.http.jetty.JettyServer addServletMapping
     [java] INFO: Added Servlet mapping: http://hydhtc43236:8080/*
     [java] Employee Details server started (press enter to shutdown)
     [java] Name :admin
     [java] DOJ :2006-06-26 00:00:00.0
     [java] EMAIL :admin@test.com
     [java] Apr 3, 2008 6:15:28 PM com.metaparadigm.jsonrpc.BeanSerializer analyzeBean
     [java] INFO: analyzing employeedata.EmployeeData


Thanks & Regards
Ashwini Kumar Jeksani


-----Original Message-----
From: Ashwini Kumar Jeksani [mailto:Ashwini_Jeksani@infosys.com]
Sent: Thursday, April 03, 2008 6:17 PM
To: tuscany-user@ws.apache.org
Subject: RE: Reg: passing Javaobject using a JSON binding

Hi Raymond,

Thanx for the help but now I am getting [object Object] in the response could you tell me how to convert it?

Thanks & Regards
Ashwini Kumar Jeksani

-----Original Message-----
From: Raymond Feng [mailto:enjoyjava@gmail.com]
Sent: Wednesday, April 02, 2008 9:01 PM
To: tuscany-user@ws.apache.org
Subject: Re: Reg: passing Javaobject using a JSON binding

Hi,

It seem that the java bean has not been transformed into JSON. Do you have
the @Remotable annotation on the service interface exposed over
binding.jsonrpc?

Thanks,
Raymond
--------------------------------------------------
From: "Ashwini Kumar Jeksani" <As...@infosys.com>
Sent: Wednesday, April 02, 2008 7:57 AM
To: <tu...@ws.apache.org>
Subject: Reg: passing Javaobject using a JSON binding

>
> Hi,
> I have a service which is exposed over JSON binding and will return a java
> object as a response. I want the response data to be in an xml format when
> I call it from the .html file using DOJO, but I am getting the output as
> shown. Could anyone tell me how to convert the java object data to an xml
> in my case? Any help would be appreciated.
>
>
> Code used in html file:
>
>        var employeeService = new dojo.rpc.JsonService("EmployeeJSON?smd");
>
>
> employeeService.fetchEmployeeData(empID).addCallback(contentCallBack)
>
> output:
>
>        {"result": poc.employeedata.EmployeeData@b48b11,"id":1}
>
>
> P.S: Here poc.employeedata.EmployeeData is the java bean
>
> Thanks & Regards
> Ashwini Kumar Jeksani
>
>
> **************** CAUTION - Disclaimer *****************
> This e-mail contains PRIVILEGED AND CONFIDENTIAL INFORMATION intended
> solely for the use of the addressee(s). If you are not the intended
> recipient, please notify the sender by e-mail and delete the original
> message. Further, you are not to copy, disclose, or distribute this e-mail
> or its contents to any other person and any such actions are unlawful.
> This e-mail may contain viruses. Infosys has taken every reasonable
> precaution to minimize this risk, but is not liable for any damage you may
> sustain as a result of any virus in this e-mail. You should carry out your
> own virus checks before opening the e-mail or attachment. Infosys reserves
> the right to monitor and review the content of all messages sent to or
> from this e-mail address. Messages sent to or from this e-mail address may
> be stored on the Infosys e-mail system.
> ***INFOSYS******** End of Disclaimer ********INFOSYS***
>

---------------------------------------------------------------------
To unsubscribe, e-mail: tuscany-user-unsubscribe@ws.apache.org
For additional commands, e-mail: tuscany-user-help@ws.apache.org


RE: Reg: passing Javaobject using a JSON binding

Posted by Ashwini Kumar Jeksani <As...@infosys.com>.
Hi Raymond,

Thanx for the help but now I am getting [object Object] in the response could you tell me how to convert it?

Thanks & Regards
Ashwini Kumar Jeksani

-----Original Message-----
From: Raymond Feng [mailto:enjoyjava@gmail.com]
Sent: Wednesday, April 02, 2008 9:01 PM
To: tuscany-user@ws.apache.org
Subject: Re: Reg: passing Javaobject using a JSON binding

Hi,

It seem that the java bean has not been transformed into JSON. Do you have
the @Remotable annotation on the service interface exposed over
binding.jsonrpc?

Thanks,
Raymond
--------------------------------------------------
From: "Ashwini Kumar Jeksani" <As...@infosys.com>
Sent: Wednesday, April 02, 2008 7:57 AM
To: <tu...@ws.apache.org>
Subject: Reg: passing Javaobject using a JSON binding

>
> Hi,
> I have a service which is exposed over JSON binding and will return a java
> object as a response. I want the response data to be in an xml format when
> I call it from the .html file using DOJO, but I am getting the output as
> shown. Could anyone tell me how to convert the java object data to an xml
> in my case? Any help would be appreciated.
>
>
> Code used in html file:
>
>        var employeeService = new dojo.rpc.JsonService("EmployeeJSON?smd");
>
>
> employeeService.fetchEmployeeData(empID).addCallback(contentCallBack)
>
> output:
>
>        {"result": poc.employeedata.EmployeeData@b48b11,"id":1}
>
>
> P.S: Here poc.employeedata.EmployeeData is the java bean
>
> Thanks & Regards
> Ashwini Kumar Jeksani
>
>
> **************** CAUTION - Disclaimer *****************
> This e-mail contains PRIVILEGED AND CONFIDENTIAL INFORMATION intended
> solely for the use of the addressee(s). If you are not the intended
> recipient, please notify the sender by e-mail and delete the original
> message. Further, you are not to copy, disclose, or distribute this e-mail
> or its contents to any other person and any such actions are unlawful.
> This e-mail may contain viruses. Infosys has taken every reasonable
> precaution to minimize this risk, but is not liable for any damage you may
> sustain as a result of any virus in this e-mail. You should carry out your
> own virus checks before opening the e-mail or attachment. Infosys reserves
> the right to monitor and review the content of all messages sent to or
> from this e-mail address. Messages sent to or from this e-mail address may
> be stored on the Infosys e-mail system.
> ***INFOSYS******** End of Disclaimer ********INFOSYS***
>

---------------------------------------------------------------------
To unsubscribe, e-mail: tuscany-user-unsubscribe@ws.apache.org
For additional commands, e-mail: tuscany-user-help@ws.apache.org


Re: Reg: passing Javaobject using a JSON binding

Posted by Raymond Feng <en...@gmail.com>.
Hi,

It seem that the java bean has not been transformed into JSON. Do you have 
the @Remotable annotation on the service interface exposed over 
binding.jsonrpc?

Thanks,
Raymond
--------------------------------------------------
From: "Ashwini Kumar Jeksani" <As...@infosys.com>
Sent: Wednesday, April 02, 2008 7:57 AM
To: <tu...@ws.apache.org>
Subject: Reg: passing Javaobject using a JSON binding

>
> Hi,
> I have a service which is exposed over JSON binding and will return a java 
> object as a response. I want the response data to be in an xml format when 
> I call it from the .html file using DOJO, but I am getting the output as 
> shown. Could anyone tell me how to convert the java object data to an xml 
> in my case? Any help would be appreciated.
>
>
> Code used in html file:
>
>        var employeeService = new dojo.rpc.JsonService("EmployeeJSON?smd");
>
> 
> employeeService.fetchEmployeeData(empID).addCallback(contentCallBack)
>
> output:
>
>        {"result": poc.employeedata.EmployeeData@b48b11,"id":1}
>
>
> P.S: Here poc.employeedata.EmployeeData is the java bean
>
> Thanks & Regards
> Ashwini Kumar Jeksani
>
>
> **************** CAUTION - Disclaimer *****************
> This e-mail contains PRIVILEGED AND CONFIDENTIAL INFORMATION intended 
> solely for the use of the addressee(s). If you are not the intended 
> recipient, please notify the sender by e-mail and delete the original 
> message. Further, you are not to copy, disclose, or distribute this e-mail 
> or its contents to any other person and any such actions are unlawful. 
> This e-mail may contain viruses. Infosys has taken every reasonable 
> precaution to minimize this risk, but is not liable for any damage you may 
> sustain as a result of any virus in this e-mail. You should carry out your 
> own virus checks before opening the e-mail or attachment. Infosys reserves 
> the right to monitor and review the content of all messages sent to or 
> from this e-mail address. Messages sent to or from this e-mail address may 
> be stored on the Infosys e-mail system.
> ***INFOSYS******** End of Disclaimer ********INFOSYS***
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: tuscany-user-unsubscribe@ws.apache.org
For additional commands, e-mail: tuscany-user-help@ws.apache.org