Bonjour, je me mords les doigts depuis plusieurs jours sur un client Java se connectant sur un service web php :

http://intevit.com/ws/ex4/

Mon wsdl est situe ici :
http://intevit.com/ws/ex4/
http://intevit.com/ws/ex4/WebService.wsdl

J'utilise wsdl2java de axis2 pour generer mon stub puis je cree mon 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
 
 
try {
			Service1Stub stub = new Service1Stub("http://intevit.com/ws/ex4/WebService.wsdl");
			Service1Stub.Add add = new Service1Stub.Add ();
 
			add.setA(1);
			add.setB(2);
				System.out.println(stub.add(add).getResultAdd());
 
 
	        } catch(Exception e){
	            e.printStackTrace();
	            System.out.println("\n\n\n");
	        }
Voici l'erreur a l'execution :
org.apache.axis2.AxisFault: First Element must contain the local name, Envelope , but found definitions
at org.apache.axis2.AxisFault.makeFault(AxisFault.java:430)
at org.apache.axis2.transport.TransportUtils.createSOAPMessage(TransportUtils.java:118)
at org.apache.axis2.transport.TransportUtils.createSOAPMessage(TransportUtils.java:67)
at org.apache.axis2.description.OutInAxisOperationClient.handleResponse(OutInAxisOperation.java:354)
at org.apache.axis2.description.OutInAxisOperationClient.send(OutInAxisOperation.java:417)
at org.apache.axis2.description.OutInAxisOperationClient.executeImpl(OutInAxisOperation.java:229)
at org.apache.axis2.client.OperationClient.execute(OperationClient.java:165)
at namespace.webservice._new.Service1Stub.add(Service1Stub.java:458)
at namespace.webservice._new.Client.main(Client.java:23)
Caused by: org.apache.axiom.soap.SOAPProcessingException: First Element must contain the local name, Envelope , but found definitions
at org.apache.axiom.soap.impl.builder.StAXSOAPModelBuilder.constructNode(StAXSOAPModelBuilder.java:267)
at org.apache.axiom.soap.impl.builder.StAXSOAPModelBuilder.createOMElement(StAXSOAPModelBuilder.java:224)
at org.apache.axiom.soap.impl.builder.StAXSOAPModelBuilder.createNextOMElement(StAXSOAPModelBuilder.java:196)
at org.apache.axiom.om.impl.builder.StAXOMBuilder.next(StAXOMBuilder.java:207)
at org.apache.axiom.soap.impl.builder.StAXSOAPModelBuilder.getSOAPEnvelope(StAXSOAPModelBuilder.java:161)
at org.apache.axiom.soap.impl.builder.StAXSOAPModelBuilder.<init>(StAXSOAPModelBuilder.java:110)
at org.apache.axis2.builder.BuilderUtil.getSOAPBuilder(BuilderUtil.java:682)
at org.apache.axis2.transport.TransportUtils.createDocumentElement(TransportUtils.java:210)
at org.apache.axis2.transport.TransportUtils.createSOAPMessage(TransportUtils.java:140)
at org.apache.axis2.transport.TransportUtils.createSOAPMessage(TransportUtils.java:103)
... 7 more
Merci pour l'aide!