Migrating JAX-RPC to JAX-WS

K

Karl Uppiano

I am having difficulty migrating a JAX-RPC application to JAX-WS.

The JAX-RPC web service uses custom parameters and return data carrier
classes. The data carrier classes look something like this:

public class WsProperty {
int key;
int value;
}

The JAX-RPC web methods look something like this:

public WsProperty[] getProperties() throws RemoteException;

public void setProperties(WsProperty[] properties) throws
RemoteException;

The resulting WSDL contains descriptors for the params and return types
along with the method itself.

My JAX-WS web methods look something like this:

@WebMethod()
@WebResult(name = "WsPropertyArray")
public WsProperty[] getProperties() throws RemoteException {
...
}

@WebMethod()
public void setProperties(@WebParam(name = "WsPropertyArray")
WsProperty[] properties) throws RemoteException {
...
}

The problem is, I do not see any description of the custom data type in the
WSDL. Although the NetBeans tools seem to generate generic objects with
similar names, they do not implement anything beyond the base Object
methods. I could use reflection to get the data, but that seems wrong. Any
suggestions?
 
K

Karl Uppiano

Karl Uppiano said:
I am having difficulty migrating a JAX-RPC application to JAX-WS.

The JAX-RPC web service uses custom parameters and return data carrier
classes. The data carrier classes look something like this:

public class WsProperty {
int key;
int value;
}

The JAX-RPC web methods look something like this:

public WsProperty[] getProperties() throws RemoteException;

public void setProperties(WsProperty[] properties) throws
RemoteException;

The resulting WSDL contains descriptors for the params and return types
along with the method itself.

My JAX-WS web methods look something like this:

@WebMethod()
@WebResult(name = "WsPropertyArray")
public WsProperty[] getProperties() throws RemoteException {
...
}

@WebMethod()
public void setProperties(@WebParam(name = "WsPropertyArray")
WsProperty[] properties) throws RemoteException {
...
}

The problem is, I do not see any description of the custom data type in
the WSDL. Although the NetBeans tools seem to generate generic objects
with similar names, they do not implement anything beyond the base Object
methods. I could use reflection to get the data, but that seems wrong. Any
suggestions?

P.S., Oops, typo alert: the data carrier members are public.

public class WsProperty {
public int key;
public int value;
}
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,982
Messages
2,570,189
Members
46,734
Latest member
manin

Latest Threads

Top