Bonjour,

Je développe un service web hébergé sur Jboss 4.2.3 GA.
J'arrive à me connecter avec SOAP UI et le retour est correct mais je n'arrive
pas à récupérer mon objet depuis le client.
J'ai lu beaucoup de chose sur le net, mais à chaque fois les exemples sont incomplet et simpliste.

Voici le code coté serveur :


Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
@Remote
@WebService
public interface IComplexService{
	IComplexType getComplexType(String paramName,int integer,boolean bool);	
}
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
@Stateless
@WebService
@SOAPBinding(style = SOAPBinding.Style.DOCUMENT)
public class ComplexService implements IComplexService{
	@Override
	@WebMethod
	public ComplexType getComplexType(String paramName, int integer,boolean bool){
		ComplexType complexType = new ComplexType();
		complexType.setStringParam(paramName);
		complexType.setIntparam(integer);
		complexType.setBoolParam(bool);
		return complexType;
	}
}
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
public interface IComplexType{
	String getStringParam();
	void setStringParam(String stringParam);
	int getIntparam();
	void setIntparam(int intparam);
	boolean isBoolParam();
	void setBoolParam(boolean boolParam);
}
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
public class ComplexType implements IComplexType{
	private String stringParam;
	private int intparam;
	private boolean boolParam;
 
	public String getStringParam(){return stringParam;}
	public void setStringParam(String stringParam){this.stringParam = stringParam;}
	public int getIntparam(){return intparam;}
	public void setIntparam(int intparam){this.intparam = intparam;}
	public boolean isBoolParam(){return boolParam;}
	public void setBoolParam(boolean boolParam){this.boolParam = boolParam;}
}
Le but du jeu est de récupérer l'objet ComplexType.
Coté client, j'ai généré un ejbClient contenant mon interface IComplexType.
Voici le code du client

Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
public class Client {
	public String getWebService(){
		IComplexType complexType = null;
		try {
			QName qNameService = new QName("http://impl.ws.ste.com/","ComplexServiceService");
			Service service = Service.create(new URL("http://gnb403250:8080/ProducteurWS-ear-ProducteurWS-ejb-1.0/ComplexService?wsdl"),qNameService);      
			QName qNamePort = new QName("http://impl.ws.ste.com/","ComplexServicePort");
			IComplexService complexService = service.getPort(qNamePort,IComplexService.class);
			complexType = complexService.getComplexType("test",1,false);
		} catch(Exception e) {
            e.printStackTrace();
		}
		return complexType.getStringParam();
 
    }
}
L'erreur suivante est généré au niveau du getPort :

Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
10:25:24,037 ERROR [STDERR] java.lang.IllegalStateException: Cannot build JAXB context
10:25:24,037 ERROR [STDERR]     at org.jboss.ws.metadata.builder.jaxws.JAXWSMetaDataBuilder.createJAXBContext(JAXWSMetaDataBuilder
.java:955)
10:25:24,037 ERROR [STDERR]     at org.jboss.ws.metadata.builder.jaxws.JAXWSClientMetaDataBuilder.rebuildEndpointMetaData(JAXWSCli
entMetaDataBuilder.java:303)
10:25:24,037 ERROR [STDERR]     at org.jboss.ws.core.jaxws.spi.ServiceDelegateImpl.getPortInternal(ServiceDelegateImpl.java:271)
10:25:24,037 ERROR [STDERR]     at org.jboss.ws.core.jaxws.spi.ServiceDelegateImpl.getPort(ServiceDelegateImpl.java:202)
10:25:24,037 ERROR [STDERR]     at javax.xml.ws.Service.getPort(Service.java:143)
10:25:24,037 ERROR [STDERR]     at com.ste.ws.Client.getWebService(Client.java:23)
10:25:24,037 ERROR [STDERR]     at org.apache.jsp.index_jsp._jspService(index_jsp.java:61)
10:25:24,037 ERROR [STDERR]     at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
10:25:24,037 ERROR [STDERR]     at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
10:25:24,037 ERROR [STDERR]     at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:373)
10:25:24,037 ERROR [STDERR]     at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:336)
10:25:24,037 ERROR [STDERR]     at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265)
10:25:24,037 ERROR [STDERR]     at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
10:25:24,037 ERROR [STDERR]     at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:29
0)
10:25:24,037 ERROR [STDERR]     at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
10:25:24,037 ERROR [STDERR]     at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
10:25:24,037 ERROR [STDERR]     at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:23
5)
10:25:24,037 ERROR [STDERR]     at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
10:25:24,037 ERROR [STDERR]     at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:230)
10:25:24,037 ERROR [STDERR]     at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
10:25:24,037 ERROR [STDERR]     at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:182
)
10:25:24,037 ERROR [STDERR]     at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:84)
10:25:24,037 ERROR [STDERR]     at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
10:25:24,037 ERROR [STDERR]     at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
10:25:24,037 ERROR [STDERR]     at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:157)
10:25:24,037 ERROR [STDERR]     at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
10:25:24,037 ERROR [STDERR]     at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:262)
10:25:24,037 ERROR [STDERR]     at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
10:25:24,037 ERROR [STDERR]     at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583
)
10:25:24,053 ERROR [STDERR]     at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:446)
10:25:24,053 ERROR [STDERR]     at java.lang.Thread.run(Thread.java:722)
10:25:24,053 ERROR [STDERR] Caused by: org.jboss.ws.WSException: Failed to create JAXBContext
10:25:24,053 ERROR [STDERR]     at org.jboss.ws.core.jaxws.CustomizableJAXBContextFactory.createContext(CustomizableJAXBContextFac
tory.java:116)
10:25:24,053 ERROR [STDERR]     at org.jboss.ws.metadata.builder.jaxws.JAXWSMetaDataBuilder.createJAXBContext(JAXWSMetaDataBuilder
.java:951)
10:25:24,053 ERROR [STDERR]     ... 30 more
10:25:24,053 ERROR [STDERR] Caused by: com.sun.xml.bind.v2.runtime.IllegalAnnotationsException: 2 counts of IllegalAnnotationExcep
tions
com.ste.ws.api.IComplexType is an interface, and JAXB can't handle interfaces.
        this problem is related to the following location:
                at com.ste.ws.api.IComplexType
                at private com.ste.ws.api.IComplexType com.ste.ws.api.jaxws.GetComplexTypeResponse._return
                at com.ste.ws.api.jaxws.GetComplexTypeResponse
com.ste.ws.api.IComplexType does not have a no-arg default constructor.
        this problem is related to the following location:
                at com.ste.ws.api.IComplexType
                at private com.ste.ws.api.IComplexType com.ste.ws.api.jaxws.GetComplexTypeResponse._return
                at com.ste.ws.api.jaxws.GetComplexTypeResponse
10:25:24,053 ERROR [STDERR]     at com.sun.xml.bind.v2.runtime.IllegalAnnotationsException$Builder.check(IllegalAnnotationsExcepti
on.java:102)
10:25:24,053 ERROR [STDERR]     at com.sun.xml.bind.v2.runtime.JAXBContextImpl.getTypeInfoSet(JAXBContextImpl.java:438)
10:25:24,053 ERROR [STDERR]     at com.sun.xml.bind.v2.runtime.JAXBContextImpl.<init>(JAXBContextImpl.java:286)
10:25:24,053 ERROR [STDERR]     at com.sun.xml.bind.v2.ContextFactory.createContext(ContextFactory.java:139)
10:25:24,053 ERROR [STDERR]     at com.sun.xml.bind.api.JAXBRIContext.newInstance(JAXBRIContext.java:105)
10:25:24,053 ERROR [STDERR]     at org.jboss.ws.core.jaxws.CustomizableJAXBContextFactory.createContext(CustomizableJAXBContextFac
tory.java:110)
10:25:24,068 ERROR [STDERR]     ... 31 more
10:25:24,068 ERROR [[jsp]] Servlet.service() for servlet jsp threw exception
java.lang.NullPointerException
        at com.ste.ws.Client.getWebService(Client.java:30)
        at org.apache.jsp.index_jsp._jspService(index_jsp.java:61)
        at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
        at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:373)
        at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:336)
        at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
        at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
        at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:230)
        at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
        at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:182)
        at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:84)
        at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
        at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
        at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:157)
        at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
        at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:262)
        at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
        at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
        at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:446)
        at java.lang.Thread.run(Thread.java:722)
J'espère que vous pourrez m'aider.

Merci d'avance

leod