Unable to create java web service

morning all
Being new to ejbs I created a simple ejb project comprising one entity bean and one session bean. The session bean exposes two methods one to retrieve individual employee data (return object EmployeeData class which implements java.o.Serializable) and a second retrieving all employee data (return object java.util.Collection).
When I attempt to create a Java Web Service and select the session bean to expose as a web service the method are grayed out, clicking 'Why Not?' displays a message box showing the message
'The following parameter types do not have an XML Schema Mapping and\or serializer specified'
What does this mean and how do I solve it?

Hi,
The java.io.Serializable marker is not consulted when determining whether a Java object can be transmitted in a web service invocation. Instead, each parameter and return value of a web service method must conform to one of the 3 rules below:
1. It is a Java primitive (int, long, byte etc.), Java primitive wrapper (java.lang.Integer etc.), or a java.lang.String.
2. It is a Java bean with a zero-argument constructor, and a pair of "get" and "set" methods for each property to be exposed. Each property must itself conform to one of these 3 rules.
3. It is an array of a type that meets either rule 1 or rule 2.
In the first case, I'd hazard a guess that your EmployeeData class doesn't have the form of a Java bean. Make sure it's got the zero-argument constructor, and that all of the "get" and "set" methods use types which are themselves publishable.
In the second case, java.util.Collection doesn't conform to any of the 3 rules above. However, once you've fixed your EmployeeData class, you can convert the method that returns the Collection into a method that returns a EmployeeData[], which you will be able to publish in your web service.
Hope that helps,
Alan.

Similar Messages

  • Problem in creating Java Web Service

    hi,
    i am trying to create a simple java webservice through eclipse and tomcat.
    this is my code: -----
    package com.test;
    public class addfunc {
         static StringBuffer sb = null;
         static String n3 = null;
         * @param args
         public void confunc(String n1, String n2, StringBuffer sb) {
              n3 = n1 + "~" + n2;
              sb = new StringBuffer(n3);
              System.out.println("inside confunc:" + sb);
         public static void main(String[] args) {
              // TODO Auto-generated method stub
              String n1 = "test1";
              String n2 = "test2";
              addfunc c = new addfunc();
              c.confunc(n1, n2, sb);
              sb = new StringBuffer(n3);
              System.out.println("before split : " + sb);
    but i am not able to proceed through....while trying to create a web service i am getting the following error:---------------------------
    The service class "com.test.addfunc" does not comply to one or more requirements of the JAX-RPC 1.1 specification, and may not deploy or function correctly.
    The method "confunc" on the service class "com.test.addfunc" uses a data type, "java.lang.StringBuffer", that is not supported by the JAX-RPC specification. Instances of the type may not serialize or deserialize correctly. Loss of data or complete failure of the Web service may result.
    Kindly suggest me the steps......
    thanks!

    hi,
    i am trying to create a simple java webservice through eclipse and tomcat.
    this is my code: -----
    package com.test;
    public class addfunc {
         static StringBuffer sb = null;
         static String n3 = null;
         * @param args
         public void confunc(String n1, String n2, StringBuffer sb) {
              n3 = n1 + "~" + n2;
              sb = new StringBuffer(n3);
              System.out.println("inside confunc:" + sb);
         public static void main(String[] args) {
              // TODO Auto-generated method stub
              String n1 = "test1";
              String n2 = "test2";
              addfunc c = new addfunc();
              c.confunc(n1, n2, sb);
              sb = new StringBuffer(n3);
              System.out.println("before split : " + sb);
    but i am not able to proceed through....while trying to create a web service i am getting the following error:---------------------------
    The service class "com.test.addfunc" does not comply to one or more requirements of the JAX-RPC 1.1 specification, and may not deploy or function correctly.
    The method "confunc" on the service class "com.test.addfunc" uses a data type, "java.lang.StringBuffer", that is not supported by the JAX-RPC specification. Instances of the type may not serialize or deserialize correctly. Loss of data or complete failure of the Web service may result.
    Kindly suggest me the steps......
    thanks!

  • Frustating errors while creating java web-service

    Hey All
    Me getting a frustating problem while making the webservice using Eclipse, jdk1.6.0_03,and Tomcat-5.0.
    The overall scenario is like this.There is a class “WsEpp” of which I have to make webservice.”WsEpp” class is using the object of another class “EppService”, and if certain conditions will be fullfill then “EppService” class will use the object of another class “PrintClass”,which is allready using the object of class “PrintLib”.
    “PrintLib” class is a long file and its using many classes which are in supported jar files.
    Here is the some part of “PrintLib” where I am facing the problem,
    Scenario-1
    public epp_Command command_data = new epp_Command();
    public PrintLib()
    System.out.println("CONSTRUCTOR 1");
    this.command_data = new epp_Command();
    System.out.println("CONSTRUCTOR 2");
    Here I am using the constructor of the “PrintLib” and “epp_Command” is included into jar files.When “WsEpp” is running as web service then
    <faultcode>soapenv:Server.userException</faultcode>
    <faultstring>java.lang.reflect.InvocationTargetException</faultstring>
    occurs as the response of webservice.
    Scenario-2
    //public epp_Command command_data = new epp_Command();
    public PrintLib()
    System.out.println("CONSTRUCTOR 1");
    // this.command_data = new epp_Command();
    System.out.println("CONSTRUCTOR 2");
    When I am commenting the lines as shown in scenarion-2,then the service is running well and printing CONSTRUCTOR 1 and CONSTRUCTOR 2 as given in println command.
    And response of webservice gives the desired result.
    Scenario-3
    public epp_Command command_data = null;
    public PrintLib()
    System.out.println("CONSTRUCTOR 1");
    this.command_data = new epp_Command();
    System.out.println("CONSTRUCTOR 2");
    By using scenarion-3 the service is running and printing only CONSTRUCTOR 1 as given in println command.And also
    <faultcode>soapenv:Server.userException</faultcode>
    <faultstring>java.lang.reflect.InvocationTargetException</faultstring>
    occurs as the response of webservice.
    I am suffering with this problem from last 2 weeks.Kindally help me and provide me the some suggestions and tips.In case of any more requirement I can provid ethe whole codes.

    Hi,
    Can anybody tell me please, is it possible to create
    a Web Service from java class where the input from
    user is required ?Yes, the parameters of your method will be mapped in WSDL.
    But i've some considerations about your code.
    I suggest you change the name of isPrime do Prime, its a good code convention to put the name of class starting with Upper case. and isn't good the name of class equals to name of method.
    I suggest you to change the "static boolean isPrime (int n)" to "public boolean isPrime(int n)" to publish a method as a WebService method it's must be public and not static. After this change try to generate your Web Service.
    Regards.

  • Creating Java web service Proxies in  nwds 7.3

    Hi Experts,
    I'm trying to consume the WSDL (Which has been generated from PI. ESR) by following the below thread in NWDS 7.3 but I'm not successful in doing so.
    https://help.sap.com/saphelp_nwesrce/helpdata/en/45/100c6be9f87201e10000000a155369/content.htm
    In NWDS 7.0 I could able to do generate Java proxy by creating the project File-->new -->project-->web services-->Deployable Proxy Project--> and Proj name and Finish. Once created it will open in Web services Prospective and appears in Client Explorer and we can create the proxy by right clicking --> new--> client Proxy Definition. I want the same thing in NWDS 7.3 also, but in 7.3 I'm struggling to have the similar steps, I found above help document but it is not that clear. Appreciate if any one has document or point to the right thread which has document/example in performing the sa,e thing in NWDS7.3.
    Below is the screenshot from NWDS7.0. But want to do the same in NWDS 7.3

    Thank you so much Durga, for providing the documents, really helpful. However I have created the Web dynpro DC as below and had few questions when doing it in NW 7.3 version.
    Points which I have performed.
    1) Created the Web dynpro Java (Web services) DC and application in NWDS 7.3 version.
    2) Created the Model's and imported the WSDL from local/ESR (SAP PI web service)
    3) created the Service Groups and which populated Service references
    4) Deployed the DC in the AS Java 7.3 and configured the Consumer Service Groups for interacting during run time.
    Now my question is can we import multiple WSDL's by creating multiple models as shown in the picture? along with the multiple service groups in the same web dynpro java DC? Will it work?
    And if yes, If want to use this model from this (Web services) DC to another DC if I add this as dependency and model to the public parts that will do the trick? or will I have do any other configuration/ settings to use this DC in any other DC? Appreciate  if you could take a look at this and advise?

  • Please Help! Unable to create a web service.

    Hi all,
    I have created a deployable proxy, a EJB with a stateless session bean, and a enterprise application project with the above ejb added. I add the deployable proxy into ejb, so that i can utilize the interface(web service) provided by the external party. After i implement the code to call the web service from external party in stateless session bean, i should create a web service by right click on session bean>New>Web Service. However, nothing was happened while a pop up window of web service creation wizard should appear. NWDS showed "End Point Doesn't Exist" when i tried to create the web service by File>New>Others>Web Service>Web Service (New VI and WSD).
    Anybody have any idea of it? Your help will be apperciated.
    Warmest Regards,
    Jane

    Hi all,
    I notice that once i implement the interface from deployable proxy, the problem of "SEI doen't exist" appeared.
    Anyone can help pls? anyone encounter the same problem before? It is urgent.
    Thank in advance.
    Warmest Regards,
    Jane

  • Create Java Web Services in RAD 7.5

    Hi,
    I am new to web services and am looking to create web services in RAD 7.5. Can someone suggest some useful references for beginners for web service development in RAD 7.5?
    Thanks.

    How about forgetting about RAD 7.5 for now and just learning how to create webservices.
    Just google for "jax-ws tutorial" and learn them in an IDE independent way. Should then be easy to adapt to your IDE (or others) later.

  • Java web service question

    I am trying to create a java web service using the wizard in Jdeveloper, but I am not able to pick up the java class I want. I already setup the classpath and library to include the java class files. but seems the wizard doesn't look at the classpath. what's the right way to do it?
    Is there any demo or tutorial code about how to create java web service ?

    Hello again,
    I am quite surprised I got no responses to my query below.
    Can anyone explain how I might do this?
    Please feel free to respond to [email protected]
    I am looking for what I think should be a simple
    example/tutorial but so far no luck. I am using
    JDeveloper 10g 10.1.3 and the Oracle Application
    Server.
    want to do this:
    create a simple Java web service
    deploy it
    create another simple Java web service, that makes a
    call to a method on the first service
    deploy it
    client->WSfront->WSback
    want to keep this as basic as possible.
    lthough I have found examples of how to create a web
    service proxy, there are no examples that I have
    found that show how to use that proxy in another web
    service:
    I did what I thought were the right things; generated
    a proxy for the first web service, and used that
    proxy in the second web service's source Java class.
    However when I deployed and tested many classes were
    missing: all the classes the proxy class depends
    on.
    I actually managed to get something like this working
    but had to manually create the .ear and .war files
    for WSfront, explode the archives, and manually add
    the missing classes to its WEB-INF/classes.

  • Creating a Web Service From an existing Java Project

    Hi folks,
    I'm new to web services and SAP Netweaver so I need to know if I can use my exisiting Java codes (not EJB's though) for creating web services and the WSDL. I've already gotten the codes working and all and just need to make them into web services and deploy them (plus give my WSDL).
    I've noticed in some samples that they used EJB's for creating new web services and I've been trying to find samples/steps on just creating webservices from exisitng java codes. I've been using AXIS but I've been told that creating web services using the Netweaver Developer Studio is rather easy.
    Thanks in advance!

    Hi Amol!
    Thanks for the link
    I was trying it out, but could you see if this was correct:
    I just made one simple java project (with one class file) and using the link you sent me and did just the step for using the web service Creation Wizard. I made it say Test service and got into the Web Services Explorer but it says it couldn't open my wsdl:
    IWAB0379E Unable to open http://localhost:50000/HelloBeanService/HelloBean?wsdl.
    IWAB0135E An unexpected error has occurred.
    WSDLException
    WSDLException: faultCode=OTHER_ERROR: http://localhost:50000/HelloBeanService/HelloBean?wsdl
    Did I miss a step?
    Thanks again!

  • Parse errors while creating a Web service from Java class!

    Can anybody tell me please, is it possible to create a Web Service from java class where the input from user is required ?
    I have the following program, which is successfully compiled, but when I'm trying to make a web service in JDeveloper, the following error occurs:
    "Validation failed.
    The implementation class primePackage.isPrime ofport type MyWebService contains parse errors."
    import java.io.*;
    import java.util.*;
    class isPrime
    public static void main (String args[])
    Scanner reader = new Scanner(System.in);
    int n;
    System.out.println ("Enter a number you want to know is it prime or not");
    n=reader.nextInt();
    if (isPrime(n))
    System.out.println ("True");
    else
    System.out.println ("False");
    static boolean isPrime (int n)
    int i=2;
    while (i<=n-1)
    if (n%i==0)
    return false;
    i++;
    return true;
    }

    Hi,
    Can anybody tell me please, is it possible to create
    a Web Service from java class where the input from
    user is required ?Yes, the parameters of your method will be mapped in WSDL.
    But i've some considerations about your code.
    I suggest you change the name of isPrime do Prime, its a good code convention to put the name of class starting with Upper case. and isn't good the name of class equals to name of method.
    I suggest you to change the "static boolean isPrime (int n)" to "public boolean isPrime(int n)" to publish a method as a WebService method it's must be public and not static. After this change try to generate your Web Service.
    Regards.

  • Any difference in creating a web service from a java class or session bean?

    Hi,
    The JDeveloper tutorial at http://www.oracle.com/technology/obe/obe1013jdev/10131/devdepandmanagingws/devdepandmanagingws.htm demonstrates creating a web service from a plain java class. I'm wondering:
    - Is it possible to create a web service from a stateless session bean instead of a java class? If so, what's the proper way to do this in JDeveloper? When I tried doing so in JDeveloper 10.1.3.0.4 (SU5) using the J2EE Web Service wizard, the wizard did not list the session bean in the Component To Publish dropdown (it does list any java classes available in the project). I can proceed by manually typing in the name of the session bean. After the wizard completes though, the @Stateless annotation that had been in my session bean class code is removed and replaced by a @WebService annotation. The end result is that it looks like it made no difference whether I had tried to create the web service from a session bean or plain java class as the annotations in the resulting web service code are the same (although if I had started from a session bean, the class for the web service still implements the Local/Remote EJB interface that the session bean originally implemented).
    - Assuming it's possible to create a web service from a stateless session bean, is there any advantage/disadvantage creating a web service from a java class vs a stateless session bean? I'm creating the web service from scratch so I also need to either build the java class or stateless session bean the web service would be based on from scratch too.
    Thanks for any ideas about this.

    Hi,
    EJB Session beans (EJB 3.0) are deployed as WebServices by annotating the class with @WebService and the methds with @WebMethod (both tags require you to add the JSR-181 library to your project (available in the JDeveloper list of libraries)). Unlike the J2E WebService, the EJB session bean service is turned into a WebService upon deployment. This means you obtain teh WSDL file after deployment
    - Assuming it's possible to create a web service from a stateless session bean, is there any advantage/disadvantage creating a web service from a java class vs a stateless session bean?
    The difference is that EJB Session bean based web services are integrated with the J2EE container, which means that they can leverage container services like transaction handling, data sources, security, JMS etc.
    Frank

  • ABAP WebService Created but unable to locate in Web Services Navigator

    Hi all,
    We have got a SAP WAS 640 system and had created an RFC and converted into a Web Service via transaction code SE37. Have also confirmed to be working using the test page.
    However, in the Web Services Navigator homepage, I am unable to find this newly created ABAP Web Service. Neither can I see the newly created ABAP Web Service in NetWeaver Developer Studio.
    My question is, is the ABAP Web Service deployed in the ABAP stack or J2EE stack? How can I get to "see" the Web Service  via the Web Service Navigator page? Did I miss any configurations?
    Thanks for any help rendered.

    Hi,
    Do you see you web service in the wsadmin trans?

  • Creating a java Web Service Using Axis

    I need to write a Java web Service using Axis which send a file as an DIme attachement and It should to be invoked by .NET Client .
    I need to know how to attach a file to Soap response and how to read a file from the response at Client.
    I am new to web Services ,,please help me......

    Hi
    You can use a java web service to publish a Web service from a Java class.
    A wizard creates the WSDL document and deployment files needed to publish your code as a Web service. After you select the class and methods you want to publish, the wizard generates deployment descriptors, a JAX-RPC mapping file, and a WSDL document that can be deployed to an application server.
    You can refer : \bpel\samples\tutorials\102.InvokingProcesses\ws sample to invoke a WS using JAX-RPC Call.
    Hope that helps!
    Cheers
    A

  • Java Web Service Deployed on App server does not run

    hi,
    I created a java web service and deployed it on my Application server. When i open the enterprise manager i find my webservice there. I click on test web service and it gives me two options one with a 4443 port and other with a 7777 port. It picks up a 0.0.0.0 hostname though i deplyoed it on to a different machine.
    I choose to use the 7777 port and test the web service whrn i click invoke it give me the error
    Internal Server Error
    The server encountered an internal error or misconfiguration and was unable to complete your request.
    Please contact the server administrator, [email protected] and inform them of the time the error occurred, and anything you might have done that may have caused the error.
    More information about this error may be available in the server error log.
    and when using the 4443 port it gives me the error as
    "SSL Error: unable to find valid certification path to requested target"
    please suggest how i can test a simple java webservice.
    Thanks
    Sravanti

    I think the problem is to add the custom dll files while deploying the application. Could any one please suggest how i can add custom dll file for deployment?
    Thanks
    Sravanti

  • NullPointerException in Create J2EE Web Service Wizard

    I created an EJB2.1 session bean that has a method which returns an user defined class and also throws user defined exception. I tried to use the Create J2EE Web Service and chose to use RPC/Encoded scheme.
    The WSDL and java-wsdl mapping files were generated, but I got the following messages and exception. The webservices.xml and oracle-webservices.xml were not generated and wizard did not finish. Any ideas why would this happen?
    Web Service Log :
    Generating WSDL and mapping file
    Generating deployment descriptors
    ERROR: [failed to localize] Unable to find member message in jax-rpc mapping metadata for the exception whose wsdl message is: {http://mypackage/}MyException
    Exception dialog :
    java.lang.NullPointerException
         at oracle.j2ee.ws.tools.wsa.Util.createDeploymentDescriptors(Util.java:482)
         at oracle.j2ee.ws.tools.wsa.Util.createDeploymentDescriptors(Util.java:759)
         at oracle.jdeveloper.webservices.model.Generator.generateDDFiles(Generator.java:734)
         at oracle.jdeveloper.webservices.model.java.BaseJavaGenerator.doGeneration(BaseJavaGenerator.java:173)
         at oracle.jdeveloper.webservices.model.Generator.generateImpl(Generator.java:447)
         at oracle.jdeveloper.webservices.model.Generator.generate(Generator.java:295)
         at oracle.jdeveloper.webservices.model.WebService.saveEditImpl(WebService.java:3971)
         at oracle.jdeveloper.webservices.model.WebService.mav$saveEditImpl(WebService.java)
         at oracle.jdeveloper.webservices.model.WebService$1.run(WebService.java:3817)
         at oracle.jdeveloper.webservices.model.GeneratorUI$GeneratorAction.run(GeneratorUI.java:446)
         at oracle.ide.dialogs.ProgressBar.run(ProgressBar.java:551)
         at java.lang.Thread.run(Thread.java:595)

    Specifically, this happens only when there is an exception thrown from the session bean method.

  • Really impossible to create a web service for JBoss using eclipse's WTP?

    I'm starting to get nuts!!!
    I'm an experienced J2SE and J2ME Java developer... but I have huge problems creating a web service using eclipse WTP!
    The tutorials I found are for tomcat... But I want to code for JBoss and not for tomcat...!!!
    There must be somebody out there with the same issues...
    This tutorial works fine for Tomcat...
    http://www.eclipse.org/webtools/community/tutorials/BottomUpWebService/BottomUpWebService.html
    But if I do the same with JBoss... it's not possible to incoke my web service method... ok, I thought... just need to check google... BUT I didn't find any solution in the whole WWW. Found a lot of questions of people with the same problems... but no solution! :(
    Still getting that:
    ERROR [EngineConfigurationFactoryServlet] Unable to find config file. Creating new servlet engine config file: /WEB-INF/server-config.wsdd
    I know a little bit what a wsdd does... but isn't it the job of the WTP to create that file???
    I really hope you have some places for me to start, 'cause I don't know anymore places to ask for...
    Maybe this is a JBoss issue... I don't know...
    Or is there a tutorial on how to create a web Service using JBoss IDE?
    Sascha

    Hi Massimo,
    Quiet a few points here.
    1. Oracle Type objects do not map to XML Complex type
    2. Oracle Type objects do not map to Apex Page Item Types
    3. Apex Page Item types are substituted into the WS Request XML by a process which is part of the Web Service Reference creation through the Wizard in Apex.
    >
    After created the web service (without any errors), I click on test.
    - I can select the Operation --> CREATE_LINGUA
    - I can input data for Basic Authentication
    - I can't view Input Parameters --> Report returned no rows.
    I've tried with normal type like Varchar2 and all was ok.
    Is possible in Apex to use web services based on complex type, tipically an Array?
    >
    As you have guessed the Wizard driven Web Service Reference definition process cannot handle complex types of input parameters required by a Request. By definition the number of complex types possible are infinite, so they are not likely to come built in.
    Passing an array is no solution because finally the values passed have to be plugged into the right SimpleTypes inside a ComplexType in the Request.
    Based on your WSDL your Request will be
    <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:cre="http://xmlns.oracle.com/orawsv/GRIMALDI/PKG_WEBSERVICES/CREATE_LINGUA">
       <soapenv:Header/>
       <soapenv:Body>
          <cre:SNUMBER-CREATE_LINGUAInput>
             <cre:PLINGUA-LINGUAT-CIN>
                <cre:LINGUAT>
                   <cre:CODICE>?</cre:CODICE>
                   <cre:DESCRIZIONE>?</cre:DESCRIZIONE>
                </cre:LINGUAT>
             </cre:PLINGUA-LINGUAT-CIN>
          </cre:SNUMBER-CREATE_LINGUAInput>
       </soapenv:Body>
    </soapenv:Envelope>However, all is not lost. You can always use the UTL_HTTP package API to construct your Request.
    Regards,

Maybe you are looking for

  • Why do we need to have payment info if we already have money on iTunes?

    why do we need to have payment info if we already have money on iTunes?

  • GL header field in IV

    Hallo to all, transaction MIRO or MIR7, realese 5.0, doase anyone know is there possibility to make manuale input to G/L field in IV header detail tab ( INVFO-HKONT - the field is updated from Vendor master record). In SPRO i didnt find any solution,

  • Try to connect oracle in portal 4.0 and cannot create database connection for the realm

    hello, i have try to use the method in configuring Weblogic Portal for Oracle Database. I have made all with no problems but when i stop and i start the weblogic portal i have this error java.lang.IllegalAccessError: Exception[com.bea.p13n.security.r

  • Connect Netgear access point to Home Hub?

    Before I switched to using a Home Hub 2, I was using a Netgear router/modem (DG834G).  And I also had a Netgear WPN802 access point connected to the DG834G router/modem (via ethernet cable), and this enabled me to connect to internet using wifi from

  • Flash Player-MP3 Compatibility Issue

    Does Flash Player 10 hav any compatibility issues in Playing CBR MP3. The reason why I am asking is because of the observation which I made (Given  Below) I am right now working  on a module "Live Streaming Codecs" for an e-learning application. I us