Creating a web service with XMLBeans

Hello
I have created an XML schema defining some complex types such as Person, Address, etc.. I use the Apache XMLBeans project (version 2.2.0) to automatically generate Java beans from my schema. I then populate these objects using standard accessors.
I want to expose methods such as Find, Retrieve, etc.. as web services which return these XMLBean objects in the SOAP body.
public PersonType findPerson(String p_surname)
public AddressType retrieveAddress(String p_houseNumber, String p_postcode)
I understand the fundamentals of web services and have successfully written web services from scratch using Apache Axis.
I'm now using JDeveloper 10.1.3.0.4 and creating web services using the wizard. When stepping through the wizard I get to the part where you are asked to choose which methods of your class you wish to expose. In my case all the methods are greyed out. Now I believe this is because my methods are returning complex Java types (generated by XMLBeans) which themselves contain other complex types which have no serializers defined for them.
Has anyone written a custom serializer for XMLBeans to work with JDeveloper/OC4J or know how to get started? Any other tips?
Any advice greatly appreciated.
Thanks.

Hi,
When you start the create WS wizard in SE80 you can choose what to base it on - an RFC, a BAPI or a function group.  If you choose function group you can then choose which modules within that function group to make available as operations.
Hope this helps,
Gareth.

Similar Messages

  • How to create a web services with Developer Studio?

    hi all,
    I would like to know how can I create a Web Services with Developer Studio 7.0, but a try because I could not publish it to consume.
    thanks!

    Thanks for your answers
    Web Services try when I get the following error:
    http://img386.imageshack.us/my.php?image=errorms9.jpg
    <--Localization failed: ResourceBundle='com.sap.caf.rt.resources.CAFExceptionResources',
    ID='MMR_BO_NOTFOUND', Arguments: ['Prueba2Service']-->
    I do not know what the cause of error
    thanks

  • Security Error when creating a web service with Flex

    Hello comminuty.
    I'm using Flex to create a standalone application and I have to use web services to retrieve data from SAP.
    I used the bapi bapi_flight_getlist to create an associated WS that works fine (tested with the Eclipse's WS Explorer).
    In Flex Builder, I use the following code to create my web service:
         <mx:WebService
              showBusyCursor="true"
              id="service"           
              wsdl="{wsdl}"
              result="resultCreateWSHandler(event);"
              fault="faultCreateWSHandler(event);">
                <mx:operation name="FlightGetList"
                     result="resultWSHandler(event)"
                     fault="faultWSHandler(event)"></mx:operation>                    
            </mx:WebService>
    And this is the error I'm getting:
    (mx.messaging.messages::ErrorMessage)#0
      body = (null)
      clientId = "DirectHTTPChannel0"
      correlationId = "E578ED8C-EF29-44E7-8D57-57B4DB6EB613"
      destination = ""
      extendedData = (null)
      faultCode = "Channel.Security.Error"
      faultDetail = "Destination: DefaultHTTP"
      faultString = "Security error accessing url"
      headers = (Object)#1
        DSStatusCode = 0
      messageId = "6E7AC45E-418D-90CD-96AD-57B52DB1DAF4"
      rootCause = (flash.events::SecurityErrorEvent)#2
        bubbles = false
        cancelable = false
        currentTarget = (flash.net::URLLoader)#3
          bytesLoaded = 0
          bytesTotal = 0
          data = (null)
          dataFormat = "text"
        eventPhase = 2
        target = (flash.net::URLLoader)#3
        text = "Error #2048: Violation de la sécurité Sandbox : http://localhost:8300/ztest2/bin-debug/ztest2.swf ne peut pas charger de données à partir de http://XXXX:8006/sap/bc/srt/wsdl/bndg_DEB8A28C2E19EEF19C080050568D135B/wsdl11/allinone/ws_policy/document?sap-client=800."
        type = "securityError"
      timestamp = 0
      timeToLive = 0
    Translation: "Error #2048: Sandbox security violation: http:....swf cannot load data from http:...client=800"
    Would any of you have an idea about what is causing this error??
    Thanks for any help you can provide.
    Regards,
    C.

    Hi Cristina
    Did your flex application worked. i am also having same problm. cant access the BAPI from standalone flex application.
    Jay

  • Create RESTful web service with CSV format (bug??)

    Hi All:
    I am using APEX 4.2.2 with APEX listener 2.0.2.
    I have create a RESTful web service to retreieve some data from a table. The format is "CSV" (the other option is JSON, which I am not faimilar with).
    then I tested and it generate with below sample data.
    United States,"Zhang, Kevin",IT
    Above data means: Country, fullname, department
    As you can see value of fullname is double-quoted and also contains a comma (,) in it.
    Then I create a web service reference in a test application. Then I create a a form and report on web service.
    The problem is the fullname. The output looks like below:
    Country                 fullname                    Department
    United States        "Zhang                      IT
    As you can see, APEX is not able to get fullname correctly.
    Anyone see this issue and how to resolve it?
    Thanks!
    Kevin

    Kevin,
    I'm not sure I would classify it as a bug so much as an enhancement. We need the ability to set the "Text qualifier" as one can from Excel. This would allow the above to be seen a single a single field and, then, to do what you want. However, as I'm sure you realize, this just doesn't exist at the moment.
    So; you could store the first and last names in separate fields in the table (don't forget that you could use virtual columns for this purpose) or simply alter your query to pull them out as if they were separate fields, i.e. use SubStr and InStr.
    If you simply must see them in this format when the CSV is opened, you could create a formula in Excel to do this for you.
    -Joe

  • How can I create a Web Service with several classes

    Hello,
    I developed an API which I want to use to create a webService that offer an acces to all the classes and use all their methods.I tried this with Netbeans but I view that I will have a WSDL file for each class.
    But I have tested the yahoo api web service of the image search and it offer acces to several objects such us request and result.So I want to make a service that offer the use of several objects. Can I do this.If yes how ? Because I have read tutorials about WebServices and they mention that to create a webservice I must have an EndPoint class so only one class.
    Please I juste began with webservices so I don't know how to do.
    Thanks in advance.

    I don't believe this is possible when starting from Java. I think you need to start with a WSDL to get this to work. I am curious as to why having multiple WSDLs is an issue, would you care to eloborate.
    Thanks

  • Performance of web services with XMLBeans on WLS 9

    We are planning to use XMLBeans extensively for web services development on WLS. Recently another group within our company did a performance study indicating horrible performance with XMLBeans and WLS 9.2 especially when processing long requests (> 1000 xml elements). This puts in question whether XMLBeans with WLS 9.x is actually the right platform for us to build/host a large number of services.
    XMLBeans is a highly regarded XML<->Java binding tool as explained in numerous past articles both on Dev2Dev and other technology websites. We also understand that it is an integral technology used by other BEA products such as WLI and Liquid Data.
    We are wondering if BEA has any resources/reports on performance of web services (which uses XMLBeans) on WebLogic. Thanks.
    Edited by ductrinh at 06/04/2007 1:05 PM
    Edited by ductrinh at 06/04/2007 1:06 PM

    Hi,
    We test several frameworks and find out that usually JAXB 2.0 performs better than XMLBeans, but that is not a strict rule.
    Regards,
    LG

  • Web Services with XMLBeans Validation

    Hi,
    I am very new to XMLBeans and Web Services. From my understanding, schemas can be used to validate an xml document.
    However, I would like to find out:
    1. Can I validate my web service inputs againest the generated XMLBeans objects/schema?
    2. How do I validate my input parameters from the web service? My input parameters include enumerations of valid values and also numeric values.
    Fyi, the XMLBeans objects were generated from the schema which i created, and my web service is referencing/using these XMLBeans objects to package the results to the calling class/method.
    Great Thanks!

    Hi,
    However, I would like to find out:
    1. Can I validate my web service inputs againest the
    generated XMLBeans objects/schema?Yes just use the following code:
    XmlObject obj = your object
    ArrayList validationErrors = new ArrayList();
    XmlOptions validationOptions = new XmlOptions();
    validationOptions.setErrorListener(validationErrors);
    obj.validate(validationOptions);the last method will return a boolean. The validationErrors arraylist will contain the errors if occured
    >
    2. How do I validate my input parameters from the web
    service? My input parameters include enumerations of
    valid values and also numeric values.If you put constains in your xsd they will also available inside the generated code. So validating will also see does errors.
    >
    Fyi, the XMLBeans objects were generated from the
    schema which i created, and my web service is
    referencing/using these XMLBeans objects to package
    the results to the calling class/method.
    Great Thanks!Hope this helps!

  • How to create web services with complex objects as parameters

    Hi,
    Not sure if this is the right place, but...
    I'm using Netbeans 5.5 and trying to learn web services.
    Creating a simple web service with simple parameters like strings and integers is nice and easy. I'm now trying to take the next step, and create a web service with a more complex schema as a parameter.
    I've tried two approaches, and hit dead ends on both:
    (1) Define my complex schema as an xsd file, and then create a WSDL file. Creating the schema and saving it in my EFB project works fine; when I try to create a new WSDL file, the IDE gives me a button to import external schemas - which is where the problem is: the Browse simply won't find my newly created schema file.
    (2) Define a Java class (in this case, it's a fairly simple example containing a single ArrayList), and then use the IDE to generate a web service from Java. The IDE does this fine, but I now have no idea how to consume or test the web service - I don't know where to look for the WSDL that has presumably been generated, and I'm also a bit iffy over what answers to give the WSDL creator about port names etc.
    Ideally, I'd prefer to get approach 1 to work - can someone point me in the direction of a sensible tutorial for these things?
    (Happy to carry on using Netbeans 5.5 or to revert to Sun Studio Enterprise, which I was playing with before.)
    All help appreciated, Thanks

    - For NetBeans related questions, nbusers mailing list is more suited. It is often visited by NetBeans experts.
    http://www.netbeans.org/community/lists/top.html
    ...[email protected]
    The NetBeans users mailing list. General discussion of NetBeans use, this is the place to ask for help and to help others.... (There is a 'Subscribe' button next to the above that you can use to subscribe to the list).
    Can you try posting this question on nbusers list?
    - SJSE 8.1 is based on an older version of NB (NB5.0).
    You should definitely continue with NetBeans, since all development is now being done in NetBeans; all the major JSE modules have been moved to opensource at netbeans.org and are all being developed there. There are as yet no future plans to work on further releases for JSE.
    Please check out http://www.netbeans.org for more details.

  • How to create default web service constructor with optional parameters in C#

    hi senior :)
    i tried to create a web services with a default constructor and another that takes few arguments, no matter
    what i do I couldn't call the non default constructor from the client! how can I pass my arguments in the constructor? worse yet, I tried to pass my arguments to another exposed WebMethod, guess what? the public or private variables i'm trying to update,
    do not get updated, what gives? any documentation on how to use web services? i'm pretty newbie at this. thanks

    http://forums.asp.net/
    You need to post to Web services section in the above forum.

  • How can I create a web Service from my Web Dynpro Application ?

    Hi,
    Kindly let me know How I could create a "Web Service" with my Web Dynpro DC project.
    Awaiting your responses.
    Regards,
    Mahesh

    Hi Mahesh,
          You can use the web services by creating the Model in web Dynpro
    And if you want to publish your own web service then you have to create a EJB module and publish as a web service.
    Thanks
    Ninad

  • Weblogic - a web service with java.lang.Object parameter

    hi all,
    i'm creating a web service with a java.lang.Object parameter.
    my question is as follows:
    when a client calls the web service, how to i get the soap message object and convert it to soap message string using the parameter?
    thanks,
    alex

    Here's some code from one of the Axis samples, this shows the basic process of making a call:
    package samples.message;
    import org.apache.axis.client.Service;
    import org.apache.axis.client.Call;
    import org.apache.axis.message.SOAPBodyElement;
    import org.apache.axis.utils.Options;
    import org.apache.axis.utils.XMLUtils;
    import org.w3c.dom.Element;
    import java.net.URL;
    import java.util.Vector;
    public class TestMsg {
    public String doit(String[] args) throws Exception {
    Options opts = new Options(args);
    opts.setDefaultURL("http://localhost:8080/axis/services/MessageService");
    Service service = new Service();
    Call call = (Call) service.createCall();
    call.setTargetEndpointAddress( new URL(opts.getURL()) );
    SOAPBodyElement[] input = new SOAPBodyElement[2];
    input[0] = new SOAPBodyElement(XMLUtils.StringToElement("urn:foo",
    "e1", "Hello"));
    input[1] = new SOAPBodyElement(XMLUtils.StringToElement("urn:foo",
    "e1", "World"));
    Vector elems = (Vector) call.invoke( input );
    SOAPBodyElement elem = null ;
    Element e = null ;
    elem = (SOAPBodyElement) elems.get(0);
    e = elem.getAsDOM();
    String str = "Res elem[0]=" + XMLUtils.ElementToString(e);
    elem = (SOAPBodyElement) elems.get(1);
    e = elem.getAsDOM();
    str = str + "Res elem[1]=" + XMLUtils.ElementToString(e);
    return( str );
    public static void main(String[] args) throws Exception {
    String res = (new TestMsg()).doit(args);
    System.out.println(res);

  • ABAP Web Service with tables

    Hello,
    <br>
    <br>
    We need to build a web service with a predefined message in our ERP (ABAP), without PI or WebAS JAVA.
    <br>
    <br>
    We thought it should be a simple task, because we had no problem with many other applications and systems when building the same service, but were not able to build it with SAP ABAP, probably as a consequence of our lack of knowledge on ABAP SOAP runtime.
    <br>
    <br>
    We have an external asynchronous process that delivers information to many other systems using web services (information diffusion). Concecuently, the web service call's structure is determined by the caller, so we have to fulfill this structure if we want to receive the info.
    <br>
    <br>
    The owner of the process defined a very simple service call, in which one kind of  "record" can be repeated 1 to n times:
    <br>
    <br>
    <br>
    <br>
    <br>
    <br>
    &lt;reglasSuscripcion&gt;
    <br>
                &lt;!Zero or more repetitions:&gt;
    <br>
                   &lt;nombre&gt;?&lt;/nombre&gt;
    <br>
                   &lt;valor&gt;?&lt;/valor&gt;
    <br>
                   &lt;nombre&gt;?&lt;/nombre&gt;
    <br>
                   &lt;valor&gt;?&lt;/valor&gt;
    <br>
                   &lt;nombre&gt;?&lt;/nombre&gt;
    <br>
                   &lt;valor&gt;?&lt;/valor&gt;
    <br>
    <br>
                   &lt;nombre&gt;?&lt;/nombre&gt;
    <br>
                   &lt;valor&gt;?&lt;/valor&gt;
    <br>
    &lt;/reglasSuscripcion&gt;
    <br>
    <br>
    <br>
    In order to receive this info, we have to implement an abap web service handler to accept this kind of call, the same way other applications/systems have already done.
    <br>
    <br>
    We tried to build a RFC function call and create a web service with the wizard and it resulted in a web service with the following WSDL:
    <br>
    <br>
    &lt;soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:urn="urn:sap-com:document:sap:soap:functions:mc-style"&gt;
    <br>
    <br>
    <br>
    <br>
             &lt;reglasSuscripcion&gt;
    <br>
                &lt;!Zero or more repetitions:&gt;
    <br>
                &lt;item&gt;
    <br>
                   &lt;nombre&gt;?&lt;/nombre&gt;
    <br>
                   &lt;valor&gt;?&lt;/valor&gt;
    <br>
                &lt;/item&gt;
    <br>
    <br>
    <br>
    <br>
    &lt;item&gt;
    <br>
                   &lt;nombre&gt;?&lt;/nombre&gt;
    <br>
                   &lt;valor&gt;?&lt;/valor&gt;
    <br>
                &lt;/item&gt;
    <br>
             &lt;/reglasSuscripcion&gt;
    <br>
    <br>
    <br>
    <br>
    We found two main problems:
    <br>
    <br>
    1.- When "wrapping" the RFC as a WS with the wizard, for a table datatype it automatically includes the <item></item> tag, so we break the predefined calling rules.
    <br>
    <br>
    2.- The namespace is fixed by the wizard, and we would like to use a common namespace for all the "susbscribers", logically, the namespace fixed by the information diffusion service.
    <br>
    <br>
    We also tried to find info on the outside-in approach for building a web service from the WSDL, but all the info we found required the ESR and we have no PI, just the ERP.
    <br>
    <br>
    Any ideas on how to proceed?
    <br>
    <br>
    Thanks in advance,
    <br>
    <br>
    Joseba M. Iturbe
    <br>
    <br>
    Edited by: Soporte Desarrollo on Mar 5, 2010 10:56 AM

    #2.  I've recently had to "zap" some namespaces in an ECC5 system because the calling (TIBCO) system didn't appreciate the default SAP "urn" default - something to do with multiple colons in the address.  There were, I think, just three table this affected, all VEP* ones.  I think I should have been able to change these via the virtual interface in SE80 except that the ECC5 code was a bit "light" in this respect, so you may be able to do this now in SOAMANAGER in ECC6 (btw,  I also had to re-save the WS definition within WSCONFIG and re-activate the virtual interfaces after this "zap" to generated the associated handler class again).
    #1. Given your "name / value" pairs represent a complex type, then it might be better practice to have them as "item" which is probably why SAP proposes it this way... what does your custom function module parameter list look like?
    Jonathan

  • Web Service with database

    Dear All,
    I'm new to java web service. Can anyone guide me on how to setup the environment to start developing my web service?
    I need to create a web service with login function. What client is more easy for me to call login service?

    You can download Java Web Services Developer Pack 1.3 and tutorial at http://java.sun.com/webservices.
    The Java Web Services Developer Pack (Java WSDP) is a free integrated toolkit you can use to build, test and deploy XML applications, Web services, and Web applications with the latest Web service technologies and standards implementations. The tutorial has numerous code examples to get you started on develop, deploy and invoke your own web service using JAX-RPC. You can use the environment provided by tutorial to start developing your web service.
    Thanks,
    -Arun

  • Web Services with JBuilder

    I've created a web service with jbuilder.I've deployed it in weblogic server 7. Jbuilder also creates a client jar file necessary where I want to call my web service. Imagine I want to call my webservice from a .NET platform. How I have to do it? I don't understand how I can create a generic web service that I can call from a J2EE platform or .NET platform...
    Any explanation to clarify my ideas?
    Thanks!

    All you need to do to access the web service from a .NET client is to point to the WSDL file generated by JBuilder. Visual Studio .NET will generate all the necessary classes from the WSDL file. You will be able to use these generated client classes to access your Java Web Service

  • Web Services with POST Bindings

    Hi,
    I am creating a web service with a method which takes a value from the user and inserts the value into the database .Now the value which is taken is of type 'long' and cannot be sent through the URL.
    As far as my understanding goes, the default SOAP binding that I am using currently uses the HTTP GET method,ie through the URL, to send the SOAP request. But the problem is that my Request is too big and I have to use the HTTP POST method.
    Now, my questions are as follows:
    1.Instead of using the default SOAP binding, can I use the HTTP POST bindings? IF yes, How do I go about it?
    2.Is there a way to specify to the SOAP to use HTTP POST( for example in the 'transport' attribute)?
    Thanks,
    Ramya.

    Normally, Oracle's stack expects a post binding and the SOAP client does it for you this way under the covers [1].
    We did add a get binding so that if you came in via a browser in Oracle9iAS 9.0.3 and OracleAS 10g 9.0.4 and later - we generate a home page and a parameter form from which you can test out the Web service when coming in via a browser.
    What SOAP client are you using? Are you constructing your own SOAP message, using Oracle's SOAP libraries or another package?
    Mike.
    [1]
    Sample SOAP client using Oracle's SOAP libraries
    public String sahHello(String test) throws Exception
    String returnVal = null;
    URL endpointURL = new URL(_endpoint);
    Call call = new Call();
    call.setSOAPTransport(m_httpConnection);
    call.setTargetObjectURI("MyWebService1");
    call.setMethodName("sayHello");
    call.setEncodingStyleURI(Constants.NS_URI_SOAP_ENC);
    Vector params = new Vector();
    params.addElement(new Parameter("test", java.lang.String.class, test, null));
    call.setParams(params);
    call.setSOAPMappingRegistry(m_smr);
    Response response = call.invoke(endpointURL, "");
    if (!response.generatedFault())
    Parameter result = response.getReturnValue();
    returnVal = (String)result.getValue();
    else
    Fault fault = response.getFault();
    throw new SOAPException(fault.getFaultCode(), fault.getFaultString());
    return returnVal;

Maybe you are looking for

  • Macbook Pro 2011 Lion 10.7.2 HD crashed.

    My hard drive crashed and I am trying to replace it. The new hard drive is physically installed. I do not have a way to get a startup disk or make a usb drive because I have no access to any other mac computers. I tried internet recovery but when I g

  • Policies and Watermarks on docs with Signatures

    Is there a way to add a watermark to a document that contains electronic signatures.  Unless I am doing something wrong, I get an error message saying something to the effect that, "encryptUsingPolicy: Cannot encrypt a signed PDF -- (error code bin:

  • Cable speed slow on MacBook

    I bought a Time Capsule in March and all worked well at first. I was streaming from iTunes lib on Time Capsule (TC) to my MacBook and on to a 802.11g AP Express via AirTunes. No problems for a month or so. Then streaming became very inconsistent. Ope

  • How to sync the timestamp type in 10g with oracle 8i

    Hi, I have oracle 8i on solaris server and we have created application database as well. I have created oracle 10g databse in some other server and imported the whole database into 10g. Since there is timestamp format difference in oracle 8i and 10g

  • Total Items sold

    Forum, I am looking for advise and hoping someone could help. I would like to know the best way to get from SAP the following information: 1) A list of stock items 2) What was sold for each year dating back to 2008. 3) Quantity sold for each year dat