Return-Path: X-Original-To: apmail-axis-java-dev-archive@www.apache.org Delivered-To: apmail-axis-java-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 830D68B80 for ; Fri, 12 Aug 2011 09:09:29 +0000 (UTC) Received: (qmail 86386 invoked by uid 500); 12 Aug 2011 09:09:25 -0000 Delivered-To: apmail-axis-java-dev-archive@axis.apache.org Received: (qmail 85607 invoked by uid 500); 12 Aug 2011 09:09:16 -0000 Mailing-List: contact java-dev-help@axis.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: java-dev@axis.apache.org Delivered-To: mailing list java-dev@axis.apache.org Received: (qmail 85228 invoked by uid 500); 12 Aug 2011 09:09:12 -0000 Delivered-To: apmail-ws-axis-dev@ws.apache.org Received: (qmail 85223 invoked by uid 99); 12 Aug 2011 09:09:12 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 12 Aug 2011 09:09:12 +0000 X-ASF-Spam-Status: No, hits=1.0 required=5.0 tests=FORGED_YAHOO_RCVD,FREEMAIL_FROM,SPF_PASS,T_TO_NO_BRKTS_FREEMAIL X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of lists@nabble.com designates 216.139.236.26 as permitted sender) Received: from [216.139.236.26] (HELO sam.nabble.com) (216.139.236.26) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 12 Aug 2011 09:09:05 +0000 Received: from isper.nabble.com ([192.168.236.156]) by sam.nabble.com with esmtp (Exim 4.72) (envelope-from ) id 1QrnjQ-0003zY-Ra for axis-dev@ws.apache.org; Fri, 12 Aug 2011 02:08:44 -0700 Message-ID: <32248266.post@talk.nabble.com> Date: Fri, 12 Aug 2011 02:08:44 -0700 (PDT) From: lethi To: axis-dev@ws.apache.org Subject: axis2 client MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Nabble-From: leha11_4@yahoo.com Hi, I created some web services with WSIG, an jade application using Asix 1.4, (see in the wsdl file) and all work well (I test with interne SoapClient) now I have to develop a soap client from an externe java application. For that, I tried to use asix2 (last version). Axiom for generating a client (is XMLBeans better complex schema of data?) I put all .jar files of axis2's lib in classpath but nothing work. Would you help me to create the stub classes and after client classes? There are errors whan i run the RpcClient.jave: Exception in thread "main" 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:123) 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 org.apache.axis2.client.ServiceClient.sendReceive(ServiceClient.java:540) at org.apache.axis2.client.ServiceClient.sendReceive(ServiceClient.java:521) at org.apache.axis2.rpc.client.RPCServiceClient.invokeBlocking(RPCServiceClient.java:102) at requests.searchprofil.RpcClient.main(RpcClient.java:87) 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:305) at org.apache.axiom.soap.impl.builder.StAXSOAPModelBuilder.createOMElement(StAXSOAPModelBuilder.java:252) at org.apache.axiom.soap.impl.builder.StAXSOAPModelBuilder.createNextOMElement(StAXSOAPModelBuilder.java:234) at org.apache.axiom.om.impl.builder.StAXOMBuilder.next(StAXOMBuilder.java:249) at org.apache.axiom.soap.impl.builder.StAXSOAPModelBuilder.getSOAPEnvelope(StAXSOAPModelBuilder.java:204) at org.apache.axiom.soap.impl.builder.StAXSOAPModelBuilder.(StAXSOAPModelBuilder.java:154) at org.apache.axiom.soap.impl.builder.StAXSOAPModelBuilder.(StAXSOAPModelBuilder.java:140) at org.apache.axis2.builder.BuilderUtil.getSOAPBuilder(BuilderUtil.java:686) at org.apache.axis2.transport.TransportUtils.createDocumentElement(TransportUtils.java:215) at org.apache.axis2.transport.TransportUtils.createSOAPMessage(TransportUtils.java:145) at org.apache.axis2.transport.TransportUtils.createSOAPMessage(TransportUtils.java:108) And the class file: package requests.searchprofil; import java.util.Date; import java.text.ParseException; import java.text.SimpleDateFormat; import javax.xml.namespace.QName; import org.apache.axis2.AxisFault; import org.apache.axis2.addressing.EndpointReference; import org.apache.axis2.client.Options; //import org.apache.axis2.client.ServiceClient; import org.apache.axis2.rpc.client.RPCServiceClient; import objectsEtoile.CompetenceFunctional; import objectsEtoile.CompetenceTechnique; import objectsEtoile.Profil; import objectsEtoile.Researchprofil; import objectsEtoile.Stockcvlist; public class RpcClient { public static void main(String[] args1) throws AxisFault { RPCServiceClient serviceClient = new RPCServiceClient(); Options options = serviceClient.getOptions(); EndpointReference targetEPR = new EndpointReference("http://localhost:8080/Etoile/ws/PlanningcvFunctions?WSDL"); options.setTo(targetEPR); /* * Fetching a list of Profil from the Address book */ // QName of the method to invoke QName opFindEntry = new QName("http://localhost:8080/Etoile/ws/PlanningcvFunctions?WSDL", "Researchprofil"); // QName opFindEntry = new QName("http://localhost:8080/Etoile/detail.jsp?service=PlanningcvFunctions", "Researchprofil"); /* * Constructing a new Entry */ CompetenceTechnique ct= new CompetenceTechnique(); ct.setId_tech(2); ct.setName_Tech("java"); ct.setFather_tech(0); ct.setNiveau_tech("expert"); CompetenceFunctional cf = new CompetenceFunctional(); cf.setId_fonct(05); cf.setName_fonct("j2ee"); cf.setFather_fonct(2); cf.setNiveau_fonct("confirme"); Profil p = new Profil(); /** * W3C-ISO8601 date format used in conversion from String to Date */ // SimpleDateFormat zulu = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSS"); // try { // Date d= (Date)zulu.parseObject("2011-10-26T21:32:52.000"); // System.out.println("date: "+d.toString()); // p.setAvaibility(d); // } catch (ParseException e) { // // TODO Auto-generated catch block // e.printStackTrace(); // } p.setIdent(0); p.setName(""); p.setApplication(1); // 1= Planning, 2= Record p.addTechcompetences(ct); p.addFunctionalcompetences(cf); Researchprofil entry= new Researchprofil(); entry.setProfil(p); Object[] opFindEntryArgs = new Object[] { entry }; System.out.println("entry: "+entry.getProfil().toString()); System.out.println("entryO: "+opFindEntryArgs.toString()); Class[] returnTypes = new Class[] { Profil.class }; Object[] response = serviceClient.invokeBlocking(opFindEntry,opFindEntryArgs, returnTypes); Stockcvlist result = (Stockcvlist) response[0]; if (result == null) { System.out.println("No entry found for " + entry); return; } System.out.println("Profils list :" + result.getAllCvlist().toString()); } } there is wsdl file content: - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Thank a lot and best regard Lethi -- View this message in context: http://old.nabble.com/axis2-client-tp32248266p32248266.html Sent from the Axis - Dev mailing list archive at Nabble.com. --------------------------------------------------------------------- To unsubscribe, e-mail: java-dev-unsubscribe@axis.apache.org For additional commands, e-mail: java-dev-help@axis.apache.org