Skip to main content

Custom class in a Web Servcie Client

1 reply [Last post]
Joined: 2009-02-23

Suppose we have a web service:

public class TestWs {

public void test(Foo foo) {

and a Foo class:

public class Foo {

private String message;

public String getMessage() {
return message;

public void setMessage(String message) {
this.message = message;


Is this possible to use THIS Foo class in a web service client instead of that one generated by a wsimport task? I mean that I want to generate client service (WebServiceClient) with the wsimport task but it should use my implementation of the Foo class.
Thanks for help!

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
Joined: 2007-09-06

Yes it is.

Create static binder methods that take a string and return a Foo and the other way. Then declare a custom type binding in an xjb file.

printMethod="package_name.CustomFooBinder.toString" />

There probably plenty of examples available on the web. Good luck!

I'm not sure about complex types though...

Message was edited by: woel