Return-Path: X-Original-To: apmail-cxf-dev-archive@www.apache.org Delivered-To: apmail-cxf-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 094E7102F7 for ; Wed, 19 Feb 2014 16:53:23 +0000 (UTC) Received: (qmail 51112 invoked by uid 500); 19 Feb 2014 16:53:19 -0000 Delivered-To: apmail-cxf-dev-archive@cxf.apache.org Received: (qmail 51040 invoked by uid 500); 19 Feb 2014 16:53:19 -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 51029 invoked by uid 99); 19 Feb 2014 16:53:19 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 19 Feb 2014 16:53:19 +0000 X-ASF-Spam-Status: No, hits=2.5 required=5.0 tests=FREEMAIL_ENVFROM_END_DIGIT,SPF_SOFTFAIL,URI_HEX X-Spam-Check-By: apache.org Received-SPF: softfail (nike.apache.org: transitioning domain of wastin06@gmail.com does not designate 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; Wed, 19 Feb 2014 16:53:13 +0000 Received: from [192.168.236.26] (helo=sam.nabble.com) by sam.nabble.com with esmtp (Exim 4.72) (envelope-from ) id 1WGAOC-0005O1-8N for dev@cxf.apache.org; Wed, 19 Feb 2014 08:52:52 -0800 Date: Wed, 19 Feb 2014 08:52:52 -0800 (PST) From: wasew To: dev@cxf.apache.org Message-ID: <1392828772225-5740171.post@n5.nabble.com> Subject: Response Java Object ElementNSImpl problem MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org Hi, I implement bipro ws client. First I call security token I have problems on response. I cannot get a RequestedSecurityToken object, because the "any" parameter is ElementNSImpl. By return a type he get a null. My Client implementation: public class WSClient { public static void main(String[] args) throws Exception { XTrustProvider.install(); UsernamePasswordLoginXX service = new UsernamePasswordLoginXXX( new URL( "urlXXXX?wsdl"), new QName("http://www.bipro.net/namespace", "UsernamePasswordLogin_XXXX")); SecurityTokenServicePortType port = service.getUserPasswordLogin(); org.xmlsoap.schemas.ws._2005._02.trust.ObjectFactory trustFactory = new ObjectFactory(); JAXBElement elementTokenType = trustFactory .createTokenType("http://schemas.xmlsoap.org/ws/2005/02/sc/sct"); JAXBElement elementRequestType = trustFactory .createRequestType("http://schemas.xmlsoap.org/ws/2005/02/trust/Issue"); RequestSecurityTokenType parameters = new RequestSecurityTokenType(); parameters.setContext("xmlns:wst=\"http://schemas.xmlsoap.org/ws/2005/02/trust\""); parameters.getAny().add(elementTokenType); parameters.getAny().add(elementRequestType); QName BiPROVersion_QNAME = new QName("http://www.bipro.net/namespace/allgemein", "BiPROVersion"); JAXBElement elementBiproVersion = new JAXBElement(BiPROVersion_QNAME, String.class, null, "XXXX"); parameters.getAny().add(elementBiproVersion); QName RequestType_QNAME = new QName("http://schemas.xmlsoap.org/ws/2005/02/trust", "RequestType"); Map attributes = parameters.getOtherAttributes(); attributes.put(RequestType_QNAME, "wst"); Holder parameters0 = new Holder(); port.requestSecurityToken(parameters, parameters0); List objectList = parameters0.value.getAny(); for (Object object : objectList) { if (object instanceof JAXBElement) { JAXBElement element = (JAXBElement) object; Object valueObject = element.getValue(); if (valueObject instanceof LifetimeType) { LifetimeType lifetimeType = (LifetimeType) valueObject; System.out.println("Create: " + lifetimeType.getCreated().getValue() + " Expires: " + lifetimeType.getExpires().getValue()); } if (valueObject instanceof RequestedSecurityTokenType) { RequestedSecurityTokenType estt = (RequestedSecurityTokenType) valueObject; System.out.println("Obj: " + estt.getAny()); } System.out.println("Obj: " + valueObject.toString()); } } } } Output: Obj: http://schemas.xmlsoap.org/ws/2005/02/sc/sct Create: 2014-02-19T17:43:46 Expires: 2014-02-19T21:43:46 Obj: org.xmlsoap.schemas.ws._2005._02.trust.LifetimeType@3c789d63 Obj: [wsc:SecurityContextToken: null] Obj: org.xmlsoap.schemas.ws._2005._02.trust.RequestedSecurityTokenType@12a4ed99 Is this a right way to get the STS? -- View this message in context: http://cxf.547215.n5.nabble.com/Response-Java-Object-ElementNSImpl-problem-tp5740171.html Sent from the cxf-dev mailing list archive at Nabble.com.