EJB Web Services Exception: missing field/property

Hello
I am having trouble creating EJB Web Services.
When i send the following XML-content:
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <SOAP-ENV:Body>
    <yq1:create xmlns:yq1="http://company.com/project/beans/local/">
      <firstName>q</firstName>
      <lastName>s</lastName>
      <email>d</email>
      <userName>f</userName>
      <password>g</password>
    </yq1:create>
  </SOAP-ENV:Body>
</SOAP-ENV:Envelope>
I receive this response:
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <SOAP-ENV:Body>
    <SOAP-ENV:Fault>
      <faultcode>SOAP-ENV:Client</faultcode>
      <faultstring>com.sap.engine.services.webservices.espbase.server.additions.exceptions.ProcessException: Deserializing fails. Nested message: JAXB request bean 'com.company.project.beans.local.jaxws.Create@18eadca' is missing field/property with name 'firstName'.</faultstring>
      <detail>
        <yq1:com.sap.engine.services.webservices.espbase.server.additions.exceptions.ProcessException xmlns:yq1="http://sap-j2ee-engine/client-runtime-error">
          <!-- com.sap.engine.services.webservices.espbase.server.additions.exceptions.ProcessException: Deserializing fails. Nested message: JAXB request bean 'com.company.project.beans.local.jaxws.Create@18eadca' is missing field/property with name 'firstName'. -->
        </yq1:com.sap.engine.services.webservices.espbase.server.additions.exceptions.ProcessException>
      </detail>
    </SOAP-ENV:Fault>
  </SOAP-ENV:Body>
</SOAP-ENV:Envelope>
This is the code to my EJB and the interface:
@WebService(endpointInterface="com.company.project.beans.local.PersonLocal", portName="PersonBeanPort", targetNamespace="http://company.com/project/beans/local/", serviceName="PersonService")
@Stateless
public class PersonBean implements PersonLocal {
     @PersistenceContext
     private EntityManager em;
     public void createAsObject(Person person) {
          em.persist(person);
     public void create(String firstName, String lastName, String email, String userName, String password) {
          Person person = new Person(firstName, lastName, email, userName, password);
          createAsObject(person);
@WebService(targetNamespace="http://company.com/project/beans/local/", name="PersonLocal")
@Local
public interface PersonLocal {
     @WebMethod(operationName="createAsObject")
     public void createAsObject(@WebParam(name="person")
     Person person);
     @WebMethod(operationName="create")
     public void create(@WebParam(name="firstName")
     String firstName, @WebParam(name="lastName")
     String lastName, @WebParam(name="email")
     String email, @WebParam(name="userName")
     String userName, @WebParam(name="password")
     String password);
Do you have any advice on how to resolve this problem?
Thanks in advance
Vincent

Hi,
in case you want some specific text,you can raise the exception  like this in your function module.
MESSAGE I001(ZPLATINO)  RAISING EXCEPT1.
message class: ZPLATINO
exception        : EXCEPT1
message no 001,
message text : CHECK ERROR PUSHKAR1
and your response will be like.:
<soap-env:Envelope xmlns:soap-env="http://schemas.xmlsoap.org/soap/envelope/">
     <soap-env:Body>
          <soap-env:Fault>
               <faultcode>soap-env:Client</faultcode>
               <faultstring xml:lang="en">EXCEPT1</faultstring>
               <detail>
                    <n0:Zpl.Exception xmlns:n0="urn:sap-com:document:sap:soap:functions:mc-style">
                         <Name>EXCEPT1</Name>
                         <Text>CHECK ERROR PUSHKAR1</Text>
                         <Message>
                              <ID>ZPLATINO</ID>
                              <Number>001</Number>
                         </Message>
                    </n0:Zpl.Exception>
               </detail>
          </soap-env:Fault>
     </soap-env:Body>
</soap-env:Envelope>
I think this solves your problem.
points..points..:)
Message was edited by:
        pushkar anand

Similar Messages

  • XML data from a Web Service sometimes missing fields I need, any ideas on a trap?

    I get reports from our ERP via a web service to SSRS.  Just got asked to make a tweak in a report and find that the WebService only sends data that is needed for this transaction.  My issue is our entire system is based around EACH item we make. 
    New Trading Partner got Case Price.  We put two of our items together in a box for them is all that happened.
    Need to identify package column that had "ea" hard coded. 
    When I get a cs item there are more elements that identify conversion factor UOM etc.  They are only sent down for CASE items.  How do I trap for a column not being there 99.98555% of the time?
    _conv =  conversion factor.  I only receive it with a 2,4,6 in it whe4n the item is not an each. 
     =iif(Len(Fields!tcibd003_conv.Value) >0  , Fields!inh4470_qshp.Value / Fields!tcibd003_conv.Value , Fields!inh4470_qshp.Value  )
    How do I trap for this?  I tried Fields!tcibd003_conv.IsMissing but that didn't seem to work as expected.
    TIA

    Hello,
    Sorry, I cannot get your requirment and report design structure currently. Can you post the following information to us ? It is benefite us for further analysis.
    1. The fields in your dataset. You can post the dataset with sample data if it is convenient.
    2. The Report design structure: Table or Matrix and Group inforamation
    3. It seems that you want to filter the report data based on a expression, please post more details about the filter logic and expected result.
    Regards,
    Fanny Liu
    Fanny Liu
    TechNet Community Support

  • Problem generating stubs for Java EJB web service deployed in OAS

    I created an EJB web service and I've successfully deployed it in my Oracle App Server. Some of the methods work fine but others produce the ff error:
    org.apache.soap.SOAPException - java.lang.IllegalArgumentException: No Serializer found to serialize [classname] using encoding style [encoding]It seems that the objects specified as parameters in the web service methods exposed are the only ones that had stubs generated for them. Other objects I use, which are usually wrapped inside a Vector, did not have generated stubs.
    Example:
         public String loginUser(UserDTO userDTO) throws RemoteException, NamingException, SQLException;
    public String addItems (Vector vecItems) throws RemoteException, NamingException, SQLException; // where vecItems is a collection of ItemDTO objects     In this scenario, stubs were generated for the UserDTO class, but not for the ItemDTO class. In effect, calling the addItems method resulted to the exception I mentioned above.
    I did a workaround wherein I declared a dummy method which accepted all the types of objects I needed as parameters so all the necessary stubs can be generated, but this fix doesn't feel like it's the proper solution to my problem.
    If anyone can help me, it would be greatly appreciated. Thanks!

    Crossposted:
    Problem generating stubs for Java EJB web service deployed in OAS

  • How to create secure EJB web service in Oc4J using JDeveloper?

    We are going to develop a EJB web service running in OC4J using JDeveloper 10.1.3.3.
    By using the JDeveloper feature, we can simply create the web service by using the "Web Service Endpoint Interface" in the session bean.
    However, unlike the web service created from Java class, I can't find any option to change the security setting of this web service. We tried adding annotation like @DenyAll for testing, but there has no effect and related method can still be called without WS-Security header.
    Now, we can only change the security setting via the web console after deployment (select the web service, then enable security in administration page, and then edit security configuration to change the inbound policies for authentication). It works in our local machine, but it may not work in the production environment as we cannot touch the em console.
    May I know if there has any way to include the security setting inside the project?
    Thanks in advance.

    If I am not wrong, you might be probably talking about this :
    http://docs.oracle.com/cd/B40099_02/books/EAI2/EAI2_WebServices33.html#wp179056
    In order to implement the SOAP header, you would have to :
    (1) Define SOAP header in the wsdl of the service.
    (2) Add a new soap binding in the wsdl, which contains soap header and soap body.
    I think, this should get you going..

  • Consuming EJB Web Service in WD ABAP component

    Hi,
    I have a scenario where I have Portal KM access methods exposed as EJB Web Service. This web service is deployed on J2EE engine.
    And I have to consume this web service from my WD ABAP component controller.
    Any idea how this can be achieved?
    Thanks and regards,
    Amey

    This doesn't really have anything to do with Web Dynpro.  Normal ABAP functionality is used for the consumption of a web service.  In ABAP we create a proxy class based off the WSDL of the web service.  This proxy class can then be called from within Web Dynpro like any other ABAP class.  You can read about consuming a web service in the online help:
    http://help.sap.com/saphelp_nw70ehp1/helpdata/en/9e/c7a3591dc74a679bbc9716354e42af/frameset.htm

  • How to add image in ejb web service

    Hello Community,
    I am writing web service to create a PDF file using itext API. In PDF file i want to add an image.
    Can someone please tell that , how can i add image(jpeg, png , etc.) to an ejb web service?
    Thanks in advance
    Regards,
    Dishant Chawla

    Hi,
    Please check the below code which i used to add image to the header using iText . Similarly you can add image directly to the document also as a element.
    Adding image as Header:
    httpServletRequest = request.getServletRequest();
    domainURL=httpServletRequest.getScheme()+"://"+httpServletRequest.getServerName();
    imgLogo=domainURL+request.getWebResourcePath()+"/images/XXXX.jpg";
    image =Image.getInstance(imgLogo);
    image.scalePercent(22);// As per you need
    chunk = new Chunk(image, 0, -20);
    HeaderFooter header_pdf = new HeaderFooter(new Phrase(chunk), false); // here i have added image as header
    header_pdf.disableBorderSide(0);
    header_pdf.setAlignment(Element.ALIGN_CENTER);
    header_pdf.setBorder(0);
    document.setHeader(header_pdf);
    (or)
    Adding Image a Element:
    httpServletRequest = request.getServletRequest();
    domainURL=httpServletRequest.getScheme()+"://"+httpServletRequest.getServerName();
    imgLogo=domainURL+request.getWebResourcePath()+"/images/XXXX.jpg";
    image =Image.getInstance(imgLogo);
    image.scalePercent(22);
    document.add(image);
    Java IText: Image | tutorials.jenkov.com
    Regards,
    Srinivasan V

  • EJB Web Service Interface parameters name changed

    Hi, all,
    I create a simple Session EJB 3.0 with Web Service interface in Jdeveloper 10.1.3.4. and I deployed it into the embedded OC4J server.
    The question is I found that the web service operator parameters is changed to "String_1" (actually the parameter in EJB method is String ss). And I found the WSDL file is also String_1.
    How to create the real parameter name in WSDL from EJB Web Service interface? Any help on that?
    Best Regards,
    Bill

    if you do a lookup for the name "java:comp/env/ejb/queryProc" in the servlet, the deployment descriptor of your web-archive must contain an ejb-reference with the ref-name 'ejb/queryProc'.

  • Combine Annotation Driven EJB Web Services with BPEL

    Hi friends,
    We developed two Annotation Driven EJB Web Service and deployed successfully .
    webservice 1 accepts username and password as input and returns true if ldap authentication is successful.
    webservice 2 accepts username and password,and groupname as input and returns true if user is part of ldap group.
    How can we combine these two services in SOA with input (username,password,group) and output (isAuthenticated ,isGroupMember) using BPEL process...
    Regards,
    jdev

    I will create a schema with input as (username,password,group) and Output as (isAuthenticated ,isGroupMember).
    Then based on your requirement you have to create either Sync or Async service.
    From the BPEL process i will call the 2 webservices using webservice call.
    On receiving the result, populate the output variable(isAuthenticated ,isGroupMember) and send as response.
    Thanks,
    Vijay

  • Maintaing state with ejb web services

    Hello,
    I understand there are no straight way to maintain state with ejb web services. Basically I have a stateful session bean and I would like to maintain state across requests. What is the best/cleanest architecture I can use in order to maintain state with web services?
    Any reply appreciated,
    Julien.

    Here's how BEA suggests you do it:
    http://e-docs.bea.com/wls/docs81/webserv/design.html#1058330

  • Error deploy EJB web services

    please help!!!
    Hi! I've problems to deploy an ejb web services.
    I've the following error:
    Error instantiating compiler:
    06/07/19 10:48:51 WARNING: EJBContainer.postInit
    Error generating wrappers for file:/C:/Oracle/oc4j/j2ee/home/applications/EJB-WS-EAR/EJB-WS.jar
    com.evermind.compiler.CompilationException: Error instantiating compiler: webservice artifact generation failed :java.lang.NullPointerException : null
    used by: java.lang.NullPointerException
         at oracle.j2ee.ws.common.mapping.JavaWsdlMappingMetadata.findPortMapping(JavaWsdlMappingMetadata.java:296)
         at oracle.j2ee.ws.common.processor.config.ModelInfo.javaNameOfPort(ModelInfo.java:453)
         at oracle.j2ee.ws.common.processor.modeler.wsdl.WSDLModeler.processPort(WSDLModeler.java:693)
         at oracle.j2ee.ws.common.processor.modeler.wsdl.WSDLModeler.processService(WSDLModeler.java:651)
         at oracle.j2ee.ws.common.processor.modeler.wsdl.WSDLModeler.internalBuildModel(WSDLModeler.java:393)
         at oracle.j2ee.ws.common.processor.modeler.wsdl.WSDLModeler.buildModel(WSDLModeler.java:207)
         at oracle.j2ee.ws.common.processor.config.ModelInfo.buildModel(ModelInfo.java:167)
         at oracle.j2ee.ws.common.processor.Processor.runModeler(Processor.java:72)
         at oracle.j2ee.ws.server.codegen.WsCompile.run(WsCompile.java:448)
         at oracle.j2ee.ws.server.codegen.ServerArtifactGenerator.generateCompilables(ServerArtifactGenerator.java:408)
         ... 15 more
    I'm working with jwsdp 1.5 and Oracle OC4J Standalone v10.1.3
    Do you have any idea?
    Thanks in advance!

    Hello,
    Could you send me you source and ear at: tugdual[dot]grall[at]oracle[dot]com
    Regards
    Tugdual Grall

  • Need help in EJB Web Services

    I have been programming an EJB Web Service. I programmed the EJB and I have programmed the Client. It works properly when I execute it in the command line.
    However, I would like to access it using a web page. I have tried with a JSP (I posted some messages in the forum before) but I had lots of problems because of the versions. I have tried with a servlet but it doesn't work (I don't know really how to execute it, where to deploy it, what is the address to write in the iExplorer, and so on).
    Please, if somebody can help me I will be very thankful.
    I am new in developing with J2EE and OC4J and I am desperate!
    I need documentation or a complete example for OC4J 9.0.3.
    Thank you very much!
    Paloma

    I have been programming an EJB Web Service. I programmed the EJB and I have programmed the Client. It works properly when I execute it in the command line.
    However, I would like to access it using a web page. I have tried with a JSP (I posted some messages in the forum before) but I had lots of problems because of the versions. I have tried with a servlet but it doesn't work (I don't know really how to execute it, where to deploy it, what is the address to write in the iExplorer, and so on).
    Please, if somebody can help me I will be very thankful.
    I am new in developing with J2EE and OC4J and I am desperate!
    I need documentation or a complete example for OC4J 9.0.3.
    Thank you very much!
    Paloma

  • Handling Java Web Service Exception in ABAP

    Hi
    I have created a web service in Java using NWDS.
    Which has a businessMethod which throws a Exception based on certain business logic.
    I have consumed this  Web Service Method using .NET Client.
    i am able to catch the Exception and get the Exceltion Message.
    But when i try to consume the same web service Method in ABAP,
    i am not getting the Exception Message .
    The Method call works fine.
    What am i missing here ?
    regards
    Rajendra

    Hi,
    Upon further investigation and comparison of the custom exception object (generated during consumer proxy creation for a CUSTOM web service) with a standard exception object(generated during consumer proxy creation for a STANDARD web service) I found that the sub-elements of the exception structure errorPart are not available in the custom exception object (and one of these sub-elements is the message text).
    Call Stack,ExceptionName and MessageText Elements are missing in the errorPart node of Exception
    Node. as seen in the ABAP Exception structure generated.
    Queries:
    1.       Are there any standards which need to be followed when coding exceptions in the Java web service for consumption in ABAP such that all sub-elements of the exception object are also created in ABAP during the proxy creation?
    2.       Can we get the Java code for a standard web service available in SAP Netweaver? Asking the same as the exception object created for the standard web service RoomABAPWS contains the sub-elements. Getting the Java code of the same will be very helpful in resolving the issue.
    Regards
    Rajendra

  • ABAP Web Services Exception Valorization in SOAP Fault Message

    Hi,
    I created a Custom Function Module in ABAP with a custom exception ( "Exception1) in exception list (including a short text description of the exception ("This is the first exception!!!")).
    I exposed it as web services by means of 'Web service ABAP creation wizard".
    I hard coded the raising of the exception in order to see the valorization of SOAP Fault Message.
    The problem is that the field "Text" in SOAP fault message is empty instead of "This is the first exception!!!".
    Can you help me?
    Thanks in advance
    Giuseppe
    <soap-env:Envelope xmlns:soap-env="http://schemas.xmlsoap.org/soap/envelope/">
         <soap-env:Body>
              <soap-env:Fault>
                   <faultcode>soap-env:Client</faultcode>
                   <faultstring xml:lang="it">Exception1</faultstring>
                   <detail>
                        <n0:Zprova.Exception xmlns:n0="urn:sap-com:document:sap:soap:functions:mc-style">
                             <Name>Exception1</Name>
                             <Text/>
                        </n0:Zprova.Exception>
                   </detail>
              </soap-env:Fault>
         </soap-env:Body>
    </soap-env:Envelope>

    Hi,
    in case you want some specific text,you can raise the exception  like this in your function module.
    MESSAGE I001(ZPLATINO)  RAISING EXCEPT1.
    message class: ZPLATINO
    exception        : EXCEPT1
    message no 001,
    message text : CHECK ERROR PUSHKAR1
    and your response will be like.:
    <soap-env:Envelope xmlns:soap-env="http://schemas.xmlsoap.org/soap/envelope/">
         <soap-env:Body>
              <soap-env:Fault>
                   <faultcode>soap-env:Client</faultcode>
                   <faultstring xml:lang="en">EXCEPT1</faultstring>
                   <detail>
                        <n0:Zpl.Exception xmlns:n0="urn:sap-com:document:sap:soap:functions:mc-style">
                             <Name>EXCEPT1</Name>
                             <Text>CHECK ERROR PUSHKAR1</Text>
                             <Message>
                                  <ID>ZPLATINO</ID>
                                  <Number>001</Number>
                             </Message>
                        </n0:Zpl.Exception>
                   </detail>
              </soap-env:Fault>
         </soap-env:Body>
    </soap-env:Envelope>
    I think this solves your problem.
    points..points..:)
    Message was edited by:
            pushkar anand

  • EJB Web service date type

    Hi,
    I have a web service implemented by session bean from CMP Entity Beans from table,this works, but a DATE type present in the field of database table not appear in WSDL definition, therefore I can't assign this value at object.
    Any idea?
    Thanks for your answers.
    Juan.

    Hello Juan,
    Could you please give me more information about the release and features you are using?
    - which version of OracleAS ?(10g R2-10.1.2 or 10g R3 - 10.1.3)
    - which kind/version of EJB? 2.0, 2.1 or 3.0
    I would expect to see a java.sql.Date that will be mapped to a xsd:dateTime in the WSDL.
    Regards
    Tugdual Grall

  • Envorcing authentication with session ejb web service?

    I implemented a web service as a session ejb. Some of the methods exposed by this web service require certain privileges. I modified my ejb-jar.xml file and declaratively specified this by using the <method-permission> element.
    I have a Java client. If I pass credentials (e.g., name, password) into the constructor of the stub for the web service interface, the container properly recognizes this information, authenticates the user and either responds to or rejects the request based on if the user is permitted to call the method.
    I have a non-Java client. If I try to do the same thing, it does not work. Peeking underneath the covers, I've discovered that the credentials are never being used.
    Now I did get something to work. If I manually modify the web.xml for the web-services.war that is generated by servicegen to put a security constraint on the URL for the web service using the <security-constraint> element, when I run the non-Java client again, the credentials are used, properly recognized, etc.
    (1) Does anyone know why the security constraint is necessary for the non-Java client but not the Java client?
    (2) Am I doing something wrong? missing something? Is there a different way to do this?
    (3) Since I implemented the web service as a session EJB but it appears the generated web-services.war content needs to be manually modified, is there a way to generate this security constraint? I've tried various things and cannot seem to do this.
    Thanks for feedback!

    Debu,
    Yes, it successfully deployed.
    Here are the messages from the failed run.
    BUILD SUCCESSFUL
    Total time: 33 seconds
    D:\Oracle_ejb3.0\demo\howtoejb30ws>ant run
    Buildfile: build.xml
    common:
    [echo] BuildName: ejb30ws
    [echo] BuildHome: D:\Oracle_ejb3.0\demo\howtoejb30ws
    [echo] BuildFile: D:\Oracle_ejb3.0\demo\howtoejb30ws\build.xml
    [echo] BuildJVM: 1.5
    oracle-env-check:
    java-env-check:
    init:
    [echo] -----> Initializing project properties
    setup:
    [echo] -----> Creating the required sub-directories
    cli-setup:
    [echo] -----> Setting up the application client module
    [oracle:genProxy] null, WSDLException: faultCode=INVALID_WSDL: The document: http://localhost:8888/ejb
    /ejb30ws?wsdl is not a wsdl file or does not have a root element of "definitions" in the "http://schem
    mlsoap.org/wsdl/" namespace or the "http://www.w3.org/2004/08/wsdl" namespace.
    [oracle:genProxy] WSDLException: faultCode=INVALID_WSDL: The document: http://localhost:8888/ejb30ws/e
    ws?wsdl is not a wsdl file or does not have a root element of "definitions" in the "http://schemas.xml
    .org/wsdl/" namespace or the "http://www.w3.org/2004/08/wsdl" namespace.
    BUILD FAILED
    D:\Oracle_ejb3.0\demo\howtoejb30ws\build.xml:316: oracle.j2ee.ws.common.tools.api.WsdlValidationExcept
    null, WSDLException: faultCode=INVALID_WSDL: The document: http://localhost:8888/ejb30ws/ejb30ws?wsdl
    not a wsdl file or does not have a root element of "definitions" in the "http://schemas.xmlsoap.org/ws
    namespace or the "http://www.w3.org/2004/08/wsdl" namespace.
    Total time: 3 seconds
    D:\Oracle_ejb3.0\demo\howtoejb30ws>

Maybe you are looking for