Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8515121
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T05:03:38+00:00 2026-06-11T05:03:38+00:00

I started to try out JavaFX2.2 making requests to a RESTful web service. To

  • 0

I started to try out JavaFX2.2 making requests to a RESTful web service. To create my webservice I followed this Netbeans guide: http://netbeans.org/kb/docs/websvc/rest.html (based on my database).

The entities, config and service package were generated succesfully and when I test the service by right-clicking my project and choosing ‘Test RESTful Web Service…’ it all seems to work (getting XML response)

Now I try to create a JavaFX2 application that does requests to this webservice. For that I use a Jersey Client (also generated by Netbeans 7.2) based on my DAPFacadeREST service. When I hit a button in my application, following gets executed:

NewJerseyClient njc = new NewJerseyClient();

String s = njc.find_XML(String.class, "1");  

System.out.println("Output from Server .... \n");
System.out.println(s);

This gives me following response from the server:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
    <dap>
        <adres>Street 1</adres>
        <btw></btw>
        <contactPersoon></contactPersoon>
        <dapid>1</dapid>
        <email>blablabla@skynet.be</email>
        <gemeente>RandomCity</gemeente>
        <land>België</land>
        <naam>Paul The Man</naam>
        <postcode>9999</postcode>
        <tel>+32999 88 77 66</tel>
    </dap>

This info is correct, but now I’m stuck. I want this to be converted to a JavaFX2 object, preferably something like this:

public class DAP {
    private  SimpleIntegerProperty DAPID = new SimpleIntegerProperty();
    private  SimpleStringProperty naam = new SimpleStringProperty("");
    private  SimpleStringProperty contactPersoon = new SimpleStringProperty("");
    private  SimpleStringProperty adres = new SimpleStringProperty("");
    private  SimpleStringProperty postcode = new SimpleStringProperty("");
    private  SimpleStringProperty gemeente = new SimpleStringProperty("");
    private  SimpleStringProperty land = new SimpleStringProperty("");
    private  SimpleStringProperty telefoonnummer = new SimpleStringProperty("");
    private  SimpleStringProperty btw = new SimpleStringProperty("");
    private  SimpleStringProperty email = new SimpleStringProperty("");

    //constructor, getters & setters below

Is this even possible? I mean, with SOAP you can use proxy classes, but there SimpleIntegerProperty aren’t known at the server side (JavaEE 6). That’s why I’m going with REST. Is this going to be the same problem as with SOAP? Because at the server side (at the RESTful web service), the generated entities are looking like the following:

public class DAP implements Serializable {
private static final long serialVersionUID = 1L;
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Basic(optional = false)
@Column(name = "DAPID")
private Integer dapid;
@Basic(optional = false)
@NotNull
@Lob
@Size(min = 1, max = 65535)
@Column(name = "Naam")
private String naam;
@Basic(optional = false)
@NotNull
@Lob
@Size(min = 1, max = 65535)
//etc

Those the field ‘naam’ is just a normal String, where I want it to be a SimpleStringProperty at my client side.

I’ve did some reading already on JAXB but I don’t get the picture what I should create at client side and what should I create on server side. If I’m not mistaking, I have to make a xsd file somewhere? But again, will this support a SimpleStringProperty as type?

Sorry for the long posts but I hope someone can help me out… Thanks in advance.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T05:03:40+00:00Added an answer on June 11, 2026 at 5:03 am

    You can create an XmlAdapter to handle SimpleStringProperty. Since JAXB (JSR-222) is the standard binding layer for both JAX-WS (SOAP) and JAX-RS (RESTful) web services you could use this approach for both. The XmlAdapter would look something like the following

    public class SimpleStringPropertyAdatper extends XmlAdapter<String, SimpleStringProperty> {
    
       @Override
        public SimpleStringProperty unmarshal(String v) throws Exception {
            return new SimpleStringProperty(v);
        }
    
        @Override
        public String marshal(SimpleStringProperty v) throws Exception {
            if(null == v) {
                return v;
            }
            return v.getString(); // Or whatever the correct method is
        } 
    
    }
    

    The @XmlJavaTypeAdapter annotation is used to configure the XmlAdapter you can do this at the package info using a package-info class to specify that the adapters should be used for all instances of the specified classes.

    @XmlJavaTypeAdapters({
        @XmlJavaTypeAdapter(value=SimpleStringPropertyAdapter.class, type=String.class),
        @XmlJavaTypeAdapter(value=SimpleIntegerPropertyAdapter.class, type=Integer.class),
    })
    package com.example;
    
    import javax.xml.bind.annotation.adapters.*; 
    

    For More Information

    • http://blog.bdoughan.com/2012/02/jaxb-and-package-level-xmladapters.html
    • http://blog.bdoughan.com/2011/05/jaxb-and-joda-time-dates-and-times.html
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have started to try out to use the new Search API, the demo
I have started to try out noSQL databases now and are currently testing out
I just started out with Python and wanted to try out tornado. Running the
I have started learning perl and like to try out new things. I have
I've recently started looking at the Google Maps API to try out something new
I wanted to try out some simple operations on files and I started with
I just started using netbeans (NetBeans IDE 7.2 (Build 201207171143) under Win7/64bit) to try
I want to know if this code will work(I cannot try it out right
I just started C and wanted to try out a euler problem. For Euler
I was trying to create a simple console application to try out Qt's XML

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.