Return-Path: Delivered-To: apmail-cxf-dev-archive@www.apache.org Received: (qmail 6107 invoked from network); 7 Oct 2008 15:49:24 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 7 Oct 2008 15:49:24 -0000 Received: (qmail 13142 invoked by uid 500); 7 Oct 2008 15:49:22 -0000 Delivered-To: apmail-cxf-dev-archive@cxf.apache.org Received: (qmail 13100 invoked by uid 500); 7 Oct 2008 15:49:22 -0000 Mailing-List: contact dev-help@cxf.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@cxf.apache.org Delivered-To: mailing list dev@cxf.apache.org Received: (qmail 13089 invoked by uid 99); 7 Oct 2008 15:49:22 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 07 Oct 2008 08:49:22 -0700 X-ASF-Spam-Status: No, hits=1.3 required=10.0 tests=DNS_FROM_SECURITYSAGE,SPF_NEUTRAL X-Spam-Check-By: apache.org Received-SPF: neutral (athena.apache.org: local policy) Received: from [64.79.199.57] (HELO server.dankulp.com) (64.79.199.57) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 07 Oct 2008 15:48:16 +0000 Received: by server.dankulp.com (Postfix, from userid 5000) id 83A66197CA8C; Tue, 7 Oct 2008 11:48:51 -0400 (EDT) X-Spam-Checker-Version: SpamAssassin 3.2.5-gr0 (2008-06-10) on server.dankulp.com X-Spam-Level: X-Msg-File: /tmp/mailfilter.bwQxxTKpXy Received: from [192.168.1.105] (c-24-91-141-225.hsd1.ma.comcast.net [24.91.141.225]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by server.dankulp.com (Postfix) with ESMTP id 62656197CA8C; Tue, 7 Oct 2008 11:48:50 -0400 (EDT) From: Daniel Kulp To: dev@cxf.apache.org Subject: Re: CXF Apache: null pointer problem with my reponse Date: Tue, 7 Oct 2008 11:48:48 -0400 User-Agent: KMail/1.9.9 Cc: vincerix References: <19857308.post@talk.nabble.com> In-Reply-To: <19857308.post@talk.nabble.com> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200810071148.49082.dkulp@apache.org> X-Virus-Checked: Checked by ClamAV on apache.org X-Old-Spam-Status: No, score=-0.8 required=3.0 tests=AWL,BAYES_00,RCVD_IN_PBL, RCVD_IN_SORBS_DUL,RDNS_DYNAMIC autolearn=no version=3.2.5-gr0 Most likely, the response message is actually wrong according to the schema. The request message makes it look like the element form of the schema is set to "unqualified". The "urn:connect" element is qualified properly, but the child elements (user, etc...) are not namespace qualified. The response message, however, puts all the elements into the "urn:ldaplogonwsdl" namespace. If the schema says that the xml should be unqualified, then the message is wrong. CXF will not know how to deserialize it. Dan On Tuesday 07 October 2008, vincerix wrote: > Hello, > > I have a big problem with reception of a CXF answer and i'm looking > for a solution since many days. In my aut-generated classes, i have a > null pointer. > I use "apache-cxf-2.1.2". From a wsdl file, with https, i've > auto-generated many classes with wsdl2java. My application send a > request to LDAP server with webservice (using https). Communication > work fine: my request is sent and web service send me a correct > response. I think my problem is in these auto-generated classes with > wsdl2java, because at the reception of the response, inside of the > response class (a bean), the pointer to another class (an other bean), > is null and my response (in log) is correct and well formed (like in > util soapUI). > > For more information, here is my request xml: > xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" > xmlns:urn="urn:ldaplogonwsdl"> > > > > > > user > pwd > > > > > > Here is my response: > xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" > xmlns:xsd="http://www.w3.org/2001/XMLSchema" > xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" > xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"> > > > > SUCCESS > 11111 > user > name > surname > name@domain.fr > > 111 > test > > > > > > > Here is the auto-generated code with wsdl2java for response: > @XmlAccessorType(XmlAccessType.FIELD) > @XmlType(name = "connectResponseType", propOrder = { > "_return" > }) > > public class ConnectResponseType { > > @XmlElement(name = "return", required = true) > protected ConnectedUser _return; > > public ConnectedUser getReturn() { > return _return; > } > > public void setReturn(ConnectedUser value) { > this._return = value; > } > } > > The "_return" pointer has value null at response time. > > Here is my call code: > URL wsdlURL = new URL("https://adress/ldaplogon?wsdl"); > QName SERVICE_NAME = new QName("urn:ldaplogonwsdl", "ldaplogonwsdl"); > Ldaplogonwsdl ss = new Ldaplogonwsdl(wsdlURL, SERVICE_NAME); > LdaplogonwsdlPortType port = ss.getLdaplogonwsdlPort(); > org.apache.cxf.endpoint.Client client = ClientProxy.getClient(port); > HTTPConduit httpConduit = (HTTPConduit) client.getConduit(); > TLSClientParameters tlsParams = new TLSClientParameters(); > tlsParams.setSecureSocketProtocol("SSL"); > httpConduit.setTlsClientParameters(tlsParams); > HTTPClientPolicy httpClientPolicy = new HTTPClientPolicy(); > httpClientPolicy.setConnectionTimeout(36000); > httpClientPolicy.setAllowChunking(false); > httpClientPolicy.setReceiveTimeout(32000); > httpConduit.setClient(httpClientPolicy); > ConnectRequestType _connect_parameters = new ConnectRequestType(); > User myUser = new User(); > myUser.setLogin(username); > myUser.setPwd(password); > _connect_parameters.setUser(myUser); > ConnectResponseType _connect__return = > port.connect(_connect_parameters); > System.out.println("_connect__return=" + _connect__return); > ConnectedUser connectedUser = (ConnectedUser) > _connect__return.getReturn(); > > And connectedUser has value null. > Please, could you help me? > > Thank you in advance, > Vincent -- J. Daniel Kulp dkulp@apache.org http://www.dankulp.com/blog