[JBossWS] - Re: Type Substitution doesn't work with Schema2Java Client a
by mrokka123
WOW! It really works. Thanks a lot Richard.
It even works on JBossWs 1.2.1 [I think Which was default JBossWs for JBoss4.2.0].
Here?s the working version:
POJO Class
A.java
package com.d2.client;
public abstract class A implements java.io.Serializable{
private String name;
public void setName(String name){
this.name=name;
}
public String getName(){
return name;
}
}
B.java
package com.d2.client;
public class B extends A implements java.io.Serializable{
}
package-info.java //this class does the magic
@javax.xml.bind.annotation.XmlSchema(namespace = "http://client.d2.com/")
package com.d2.client;
-------------------------------------------------------------------------------------
WebService
package com.d2.webservice;
import javax.jws.WebService;
import javax.jws.WebMethod;
import javax.jws.soap.SOAPBinding;
import com.d2.client.*;
@WebService(name = "MyWebServicePortType", serviceName = "MyWebService",
portName = "MyWebServicePort",targetNamespace = "http://client.d2.com")
@SOAPBinding(style = SOAPBinding.Style.DOCUMENT,
use = SOAPBinding.Use.LITERAL,
parameterStyle = SOAPBinding.ParameterStyle.WRAPPED)
public class MyWebService{
@WebMethod
public String getClassName(A obj){
System.out.println("class name:"+obj.getClass().getName());
System.out.println("Parent name:"+obj.getName());
return obj.getClass().getName();
}
@WebMethod
public void dummyMethod(B obj)//if we use @XmlSeeAlso then this method not needed
{
}
}
Regards,
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4091427#4091427
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4091427
18Â years, 6Â months
[JBoss Seam] - Re: How to initialize List of custom object by means of comp
by Jump
I've changed List<ProcessDefinition> to ProcessDefinition[] and finally got an exception! :)
anonymous wrote :
| Caused by: java.lang.IllegalArgumentException: No converter for type: [Lmy.ProcessDefinition;
| at org.jboss.seam.util.Conversions.getConverter(Conversions.java:55)
| at org.jboss.seam.Component$ConstantInitialValue.(Component.java:2029)
| at org.jboss.seam.Component.getInitialValue(Component.java:449)
| at org.jboss.seam.Component.getTopInitialValue(Component.java:429)
| at org.jboss.seam.Component.initInitializers(Component.java:407)
| at org.jboss.seam.Component.(Component.java:263)
| at org.jboss.seam.Component.(Component.java:203)
| at org.jboss.seam.init.Initialization.addComponent(Initialization.java:851)
|
now my toolbar looks like
| @Local
| public interface Toolbar {
|
| public ProcessDefinition[] getAvailableProcesses();
| public void setAvailableProcesses(ProcessDefinition[] availableProcesses);
| public void create();
| public void destroy();
|
| }
|
| @Stateful
| @Name("toolbarImpl")
| @Scope(ScopeType.SESSION)
| public class ToolbarImpl implements Toolbar {
|
| private ProcessDefinition[] availableProcesses = null;
|
|
| @DataModel
| public ProcessDefinition[] getAvailableProcesses() {
| return availableProcesses;
| }
|
| public void setAvailableProcesses(ProcessDefinition[] processes) {
| availableProcesses = processes;
| }
|
| @Create
| public void create() {
|
| }
|
| @Destroy @Remove
| public void destroy() {
|
| }
|
| }
|
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4091424#4091424
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4091424
18Â years, 6Â months