How to get a collection of beans using web services

Hi,
I'm new to SOAP and Web Services I'd like to know whether the following is possible
or not.
I've created an EJB with this business interface:
public interface Users implements EJBObject {
public User[] getUsers( ) ...
Where the User object is a bean with some properties:
public User implements Serializable {
public void setName( ... ) ...
public String getName( ) ...
public void setAddress( ... ) ...
public String getAdress( ) ...
I've create the ejb-jar.xml and weblogic-ejb-jar.xml that contain the definition
of my EJB and then I try to deploy the web services using the ant task 'wsgen'.
I get the following exception:
org.xml.sax.SAXException: Could not find a codec that understood how to convert
class [LUser; using http://schemas.xmlsoap.org/soap/encoding/
: [ CodecFactory: http://xml.apache.org/xml-soap/literalxml=null, http://schemas.xmlsoap.org/soap/encoding/=null,
=null]
Can someone help to resolve this ? Also, I'd like to know if it's possible that
a web service return a collection of beans as shown above ?
Thanks for your help.
Ludovic.

Java beans are serialized/deserialized by the soap encoding codec
itself. you dont have to write custom encoders. I think the error
is because you dont have the java bean class on the server side.
Java bean class file should be in the classpath or it should be
added to the ejb jar file.
thanks,
-manoj
Ludovic Deravet wrote:
Thanks for your help. Indeed, that was my problem.
But now I'm facing this one:
[SOAPException: faultCode=SOAP-ENV:Client; msg=No Deserializer found to
deserialize a 'urn:local:ns0:return' using encoding style 'http://sch
emas.xmlsoap.org/soap/encoding/'.;
targetException=java.lang.IllegalArgumentException: No Deserializer found to
deserialize a 'urn:local:ns0:
return' using encoding style 'http://schemas.xmlsoap.org/soap/encoding/'.]
at org.apache.soap.rpc.Call.invoke(Call.java:246)
at com.webservices.WSClient.main(WSClient.java:38)
Did you implement your own deserializer to read your array of beans (called
Data) ? Or do I need to do something else ?
Thanks.
Ludovic.
"manoj cheenath" <[email protected]> wrote in message
news:[email protected]...
You can do this. I guess, the problem is because you have
not defined a package for the bean.
Try something like:
package foo.bar;
class User{
I am attaching an example.
-manoj
Ludovic Deravet wrote:
Hi,
I'm new to SOAP and Web Services I'd like to know whether the following
is possible
or not.
I've created an EJB with this business interface:
public interface Users implements EJBObject {
public User[] getUsers( ) ...
Where the User object is a bean with some properties:
public User implements Serializable {
public void setName( ... ) ...
public String getName( ) ...
public void setAddress( ... ) ...
public String getAdress( ) ...
I've create the ejb-jar.xml and weblogic-ejb-jar.xml that contain thedefinition
of my EJB and then I try to deploy the web services using the ant task'wsgen'.
I get the following exception:
org.xml.sax.SAXException: Could not find a codec that understood how toconvert
class [LUser; using http://schemas.xmlsoap.org/soap/encoding/
: [ CodecFactory: http://xml.apache.org/xml-soap/literalxml=null,
http://schemas.xmlsoap.org/soap/encoding/=null,> > > =null
Can someone help to resolve this ? Also, I'd like to know if it's
possible that
a web service return a collection of beans as shown above ?
Thanks for your help.
Ludovic.

Similar Messages

  • How can i records with date format using web services?

    Hello
    I can't record date records using web services. I get no message errors.
    I can import string values but no dates (YYYY-MM-DD). Do you have any clue about that?
    Regards
    Arturo

    hello,
    That's the code I'm using to update an opportunity. In the date fields (e.g. dFecha_de_entrega_al_cliente) I've tried to put an specific date in the correct format (If i put it in another format i've got an error message due the wrong format). The CRM accepted the code but it didn't update the values that are different of string.
    I don´t know if there is something missing in teh program or if the developer environment is not the adequate.
    Regards for your comments
    Arturo
    Private Sub ActualizarOportunidad(ByVal fila As Data.DataRow, ByVal TipoPersona As String)
    Dim oLog As New Log()
    Dim IdLog As Integer
    Dim NumSerie As String = ""
    Try
    oLog.Insert_Log("Activación Garantía - Crear Oportunidad", oLog.GetLastIdProceso())
    IdLog = oLog.GetLastId()
    Dim sr_input As Opportunity.OpportunityUpdate_Input
    Dim sr_output As Opportunity.OpportunityUpdate_Output
    sr_input = New Opportunity.OpportunityUpdate_Input
    Dim sr(1) As Opportunity.OpportunityData
    sr(0) = New Opportunity.OpportunityData
    NumSerie = fila("NumeroSerie").ToString().Trim()
    sr(0).ExternalSystemId = NumSerie
    sr(0).OpportunityName = fila("NumeroSerie").ToString().Trim()
    sr(0).SalesStage = "Deseo" '"Cerrada/Ganada"
    sr(0).dFecha_de_entrega_al_cliente = fila("FechaEmision").ToString().Trim()
    sr(0).dFecha_de_facturacin_al_cliente = fila("FechaCompra").ToString().Trim()
    sr(0).stNro_Factura = fila("NumeroFactura").ToString().Trim()
    sr(0).plActividad_Economica = fila("IdActividad").ToString().Trim()
    sr(0).plTipo_de_Venta = fila("TipoCompra").ToString().Trim()
    sr(0).CustomObject8ExternalSystemId = fila("ApellidoVendedor").ToString.Trim()
    'sr(0).CustomObject8ExternalSystemId = IIf(TipoPersona = "J", fila("DocumentoE").ToString().Trim(), fila("Documento").ToString.Trim())
    'sr(0).CustomObject7ExternalSystemId = fila("")
    Dim lofsr As Opportunity.ListOfOpportunityData
    lofsr = New Opportunity.ListOfOpportunityData
    lofsr.Opportunity = sr
    sr_input.ListOfOpportunity = lofsr
    sr_output = oOpportunity.OpportunityUpdate(sr_input)
    oLog.Update_Log(IdLog, "Si", NumSerie, "")
    Catch ex As SoapException
    Me.txtError.Text = ex.Detail.InnerText.ToString()
    oLog.Update_Log(IdLog, "No", NumSerie, ex.Detail.InnerText.ToString())
    End Try
    End Sub
    ************************************************************************

  • How to get a r/3 file using web dynpro

    Hello Experts.
    Actually I have a new request, I hope you can help me please.
    I'm a web dynpro programmer (java), so my company need to take a r/3 file to download at the local pc. In fact, the file is en r/3 already.
    The matter is, i have no idea how to get that file since my web dynpro app. to download it. the file is a compressed file may be a .ZIP file... so any of you can let me see the light in this??
    thak you all.
    walex

    Hi Walex,
    You will first need a RFM that returns the file that you need.
    Then you can create a Adaptive RFC model in Web Dynpro to access this RFM and store the file in the Web Dynpro context. Web Dynpro provides APIs to save files to the local system
    You can check this article for downloading the file.
    http://wiki.sdn.sap.com/wiki/display/Snippets/WebDynproJava-ExportingTableDataUsingOn-DemandStreams-SAPNW+7.0
    Best Regards,
    Supriya

  • How to get contents of Soap Over JMS web service's wsdl file

    Hi,
    Is there a way to get the soap over jms webservice's wsdl file in browser? if yes please provide me the details how to get it.
    OR how can i get the contensts of WSDL file for soap over jms wsdl file.
    thanks in advance.

    I have the same question ("Assuming I can generate a wsdl file, can I recreate the SOAP request message from the WSDL file automatically (that matches the original request, which is hand build by me?)")
    Have you already found an answer to this?

  • Getting errors with tag lib using Web Service

    I have created a web service client in my WEB-INF/classes catalogue. Im having problems because i get this error message when I compile:
    myServices/myCardValidate$Documents/verifyCreditCard_SOAPXML.jsp [-1:-1] This absolute uri (http://java.sun.com/jstl/core) cannot be resolved in either web.xml or the jar files deployed with this application
    myServices/myCardValidate$Documents/verifyCreditCard_TAGLIB.jsp [-1:-1] File "/WEB-INF/Service1Soap.tld" not found
    Errors compiling Web module compiling..
    anyone got a clue ?
    My other .jsp pages located in the WEB-INF catalogue has the http://java.sun.com/jstl/core uri and works fine...
    thanks in advance..

    Answering my own post to help others with the same problem:
    Im using Sun One Studio 5. What causes the error is that Sun Studio generates by default presentation jsp's etc. for the Web service client. At the properties tab of the client I set the Generate presentation parameter to False. No presentation jsp's are now generated and compiling and deployment of the web module works out fine.
    yours Aqoiiye

  • How to invoke a short lived process using web service start point?

    I have a custom short-lived process that does not take any input parameter. I am able to successfully invoke the process from LiveCycle Workbench ES2. I want this process to be invoked by a java client through a web service call. Apart from the web service URL of my process (which looks like
    http://<server>:<portno>/soap/services/MyApplication/MyProcess?wsdl&lc_version=9.0.0&versi on=1.0) do the java client know anything else? Any authentication is required?
    My intention is to just find out what all the consumer of this process needs to know to invoke it through a web service call.
    Was anybody able to test a short-lived process through a web service invocation from SoapUI?

    I am not a programmer but I did find this article on he Developers Resource site that might lead you in th eright direction:
    http://www.adobe.com/devnet/livecycle/articles/java_soap.html
    Paul

  • How to use web services in Excelsius 2008

    I am new  to this tool. I have trial version on excelsius 2008 and i would like to build a dashboard that should query our corporate database (in oracle). I think web services is a option to do it.  Any samples available?.Please help me
    Edited by: AshishDatar on Jul 27, 2009 6:29 PM

    Hi AshishDatar:
        For you question you want to get data from data base using web service connection. Here I can give you some suggestions
    1.Write a web service to retrieve data from data base, then use Xcelsius u201Cweb service connectionu201D under u201CManage Connectionu201D section to consume the service and get the data from data base to spread sheet.
    2.Xcelsius also provide you a tool to generate web service with easy way (without coding). (Suggested)
    Using flynet, you can get flynet installation file under Xcelsius installation folder u201CXcelsius\Connectivity\Flynet Webservice Generatoru201D for more information about flynet please refer to
    http://myxcelsius.com/2008/11/07/generating-web-services-for-xcelsius-using-flynet-web-service-generator/
    Here is also a demo on how to use  web service conneciton with Xcelsius + Flynet
    https://businessobjects.webex.com/ec0600l/eventcenter/enroll/register.do?siteurl=businessobjects&formId=50213992&confId=50213992&formType=1&loadFlag=1&eventType=1&accessType=
    Hope it helps with your work! And let me know if you need any further help.
    Thanks!
    Bill
    Edited by: Bill Xu on Jul 28, 2009 8:02 AM

  • How to use Web services

    hi all
    In my project reserch I have to make a simple user interface for any simple web service. If anybody can help how can I get a free tool to use web services. I am able to find some free small web services on www.xmethods.net but not able to find any tool to use it. It wil be great help is anyone can help about this.
    Thanks
    Ankur Parekh

    Try SuperWebservice at http://www.acelet.com/super/LimpidDebugger/.
    Programming is not required. It will list all available services for you.
    You call webservice by clicking. You call webservice visually.

  • How to get the list of values for a dynamic parameter using Web Services SDK?

    <p>I am struggling to get the list of values for a dynamic parameter of a report.</p><p>I am using Java Web Services SDK ... I tried to use PromptInfo.getLOV().getValues() method but it does not work.</p><p>First of all ... is this possible (to get the list of values for a dynamic param) using Web Services?</p><p>Second of all, if this is possible, how should I do it ... it seems it works fine when running the report from CMC. It asks for DB logon info and after that it provides a list of values.</p><p>Thx </p>

    <p>Your assumption is correct. We are trying to get the LOVs from the Crystal Report. I was not aware that this is not supported by Web Services SDK.</p><p>We used Web Services SDK to integrated the Crystal Reports in our web application. We implemented some basic actions for reports: schedule, view instances, run ad-hoc reports.</p><p>We encountered this problem when trying to run/schedule reports with dynamic parameters (a list of values from DB). We were unable to get the LOVs.</p><p>Please let me know if you can think of an alternative to look at.</p><p>Thanks a lot,</p><p>Catalin </p>

  • How to get resultset from oracle procedure use ejb3

    how to get resultset from oracle procedure use ejb3
    i know oracle procedure should like this
    Create or replace PROCEDURE resultset_test(
    aaa IN NUMBER,
    bbb OUT sys_refcursor) ....
    but what s the ejb3 scripts looks like? please give me an example or link~
    ths

    - there are no EJB3 scripts, only compiled application code
    - the part of the EJB spec that deals with databases is called the Java Persistence API, but likely you are just looking for the JDBC API.
    Now you should know what to Google to get your "example script": "java jdbc oracle procedure"

  • How to get inputtext's inputvalue by using javascript

    how to get inputtext's inputvalue by using javascript?
    and how to judge whether its be filled or empty string

    Why do you want to use javascript..? Why not action listener..? You can check whether its an empty string by checking
    if(str != null && !str.equals("")) {..}
    where str is the variable for inputText value.
    If this is not helpful, do provide more details on which version of JDev you are using and what are you trying (your usecase).
    regards,
    ~Krithika

  • How to get Default Activity(Infotype 0315) using BAPI

    Hi Everyone,
    I have a task to get Default Activity by Personal number for my third party application. Unfortunately function HR_READ_INFOTYPE is not allowed for Remote Call.
    Is there any simple way how to get this value from system using BAPI? E.e. using RFC_READ_TABLE function(but i don't know table name ).
    Thanks,
    Roman.

    Table -> PA0315        Field ->LSTAR (Activity Type)
    Class :CL_HRPT_INFOTYPE_0315
    You can also use FM "CATS_GET_INFOTYPE_0315" RFC Enable
    Good luck !
    ~Saquib

  • When I open a pdf file, after a few seconds, it hides the toolbar and I don't know how to get it back.  I use multiple monitors and, without being able to grab the toolbar, I am unable to move the pdf file to a different monitor.  How do I stop this?

    When I open a pdf file, after a few seconds, it hides the toolbar and I don't know how to get it back.  I use multiple monitors and, without being able to grab the toolbar, I am unable to move the pdf file to a different monitor.  How do I stop this?

    Does Firefox switch to full screen if you press F11 ?
    You can also try the F10 key to see if that brings up the menu bar.
    * If the above steps didn't help then see http://kb.mozillazine.org/Corrupt_localstore.rdf
    Note: Do not delete localstore.rdf in the program folder (Windows: "C:\Program Files\Mozilla Firefox\defaults\profile\") (Mac: "/Applications/Firefox.app/defaults/profile/")

  • How to get the ablolute path of the web application in WebSphere?

    How to get the ablolute path of the web application in WebSphere?
    For example:
    I have installed IBM WebSphere on D:\WebSphere\Appserver, and I created a new appliction named "myapp" on D:\myapp,. How can I get the absolute path of application "myapp"? In other words,how can I get the absolute path of the application's
    root directory?

    In the WebSphere(default), what directory is the Java Bean's root directory ?

  • How to use web services in JSF app

    I am unsure if this is the right forum for this question. Let me know if it is not - and where I should go.
    Anyways, I'm building a JSF web app, in which there is a datatable page displaying some business data. The app is going to be deployed and run in the customer's web server, but the data to be displayed is from the business solution provider's database. Currently the provider supplies web services to retrieve the data. So, my task is to call these web services from my JSF page, get and display the data.
    I've never used web services before. Can someone give me a quick start, as what I need to know to use these web services, and how to use them in coding terms. I googled the web quite a bit and finally decided to turn to SDN forum.
    Thanks!

    http://help.sap.com/saphelp_nw04/helpdata/en/9b/dad1ae3908ee44a5caf57e10918be9/content.htm
    http://help.sap.com/saphelp_47x200/helpdata/en/2d/64d029e74911d6b2e400508b6b8a93/content.htm

Maybe you are looking for