Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id CAEFA200B13 for ; Wed, 15 Jun 2016 19:06:19 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id C96F6160A4D; Wed, 15 Jun 2016 17:06:19 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id EA671160A19 for ; Wed, 15 Jun 2016 19:06:18 +0200 (CEST) Received: (qmail 27559 invoked by uid 500); 15 Jun 2016 17:06:17 -0000 Mailing-List: contact users-help@cxf.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: users@cxf.apache.org Delivered-To: mailing list users@cxf.apache.org Received: (qmail 27514 invoked by uid 99); 15 Jun 2016 17:06:17 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd1-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 15 Jun 2016 17:06:17 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd1-us-west.apache.org (ASF Mail Server at spamd1-us-west.apache.org) with ESMTP id 344EDC32E7 for ; Wed, 15 Jun 2016 17:06:17 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd1-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 3.575 X-Spam-Level: *** X-Spam-Status: No, score=3.575 tagged_above=-999 required=6.31 tests=[HTML_MESSAGE=2, KAM_BADIPHTTP=2, KAM_LAZY_DOMAIN_SECURITY=1, NORMAL_HTTP_TO_IP=0.001, RP_MATCHES_RCVD=-1.426] autolearn=disabled Received: from mx2-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd1-us-west.apache.org [10.40.0.7]) (amavisd-new, port 10024) with ESMTP id LS3yJAo1jiDI for ; Wed, 15 Jun 2016 17:06:15 +0000 (UTC) Received: from host.soundevelopment.com (host.soundevelopment.com [206.222.5.218]) by mx2-lw-eu.apache.org (ASF Mail Server at mx2-lw-eu.apache.org) with ESMTPS id E51A05F1F7 for ; Wed, 15 Jun 2016 17:06:13 +0000 (UTC) Received: from elnso598.applevac.com (unknown [63.127.20.4]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) by host.soundevelopment.com (Postfix) with ESMTP id 730DAA8276 for ; Wed, 15 Jun 2016 13:05:30 -0400 (EDT) From: Michael Beardsley Content-Type: multipart/alternative; boundary="Apple-Mail=_A134B42E-2B2B-4839-8CFE-A3F8F1B157D7" Subject: Struggling with WS-Policy HTTP Basic Authentication Message-Id: <0E681F29-1F3E-4728-A872-415AF1A4B600@soundevelopment.com> Date: Wed, 15 Jun 2016 10:06:09 -0700 To: users@cxf.apache.org Mime-Version: 1.0 (Mac OS X Mail 7.3 \(1878.6\)) X-Mailer: Apple Mail (2.1878.6) archived-at: Wed, 15 Jun 2016 17:06:20 -0000 --Apple-Mail=_A134B42E-2B2B-4839-8CFE-A3F8F1B157D7 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=windows-1252 I am trying to get a simple SOAP client working based off a WSDL that = has various policies defined. - I do not own the service and have no way to modify it. - Spring is not involved in anyway and will not be. - Using jaxws-maven-plugin to generate the proxy code. Version 2.4.1 - Using version 3.1.6 of CXF - Including the following dependencies: cxf-rt-rs-client, = cxf-rt-security, cxf-rt-ws-policy, cxf-rt-ws-security, = cxf-rt-frontend-jaxws, cxf-rt-features-logging (The JAX-RS client dependency is included because this app will call a = REST service after getting a response from the SOAP service. The JAX-RS = stuff is working fine). The SOAP message generated by CXF appears to be properly formed. I can = successfully send the exact same message to the service endpoint using = cURL and get the expected response. I can see in the logging that CXF is = receiving the same response as cURL, but then blowing up on: org.apache.cxf.ws.policy.PolicyVerificationInInterceptor handle SEVERE: = Inbound policy verification failed: These policy alternatives can not be = satisfied: org.apache.cxf.ws.policy.PolicyException: These policy alternatives can = not be satisfied: = {http://docs.oasis-open.org/ws-sx/ws-securitypolicy/200702}HttpBasicAuthen= tication The response from the SOAP service does not include the Authorization = header. Is that why this is happening? Why does CXF care about = authentication on the inbound message? My client doesn=92t have or = require authentication=85 the service does. Stepping through in the debugger shows that the AssertionInfoMap has = ServiceModelPolicyProvider and Wsdl11AttachmentPolicyProvider instances = available, but nothing referring to HTTP Basic Auth. Am I missing a = dependency? Here is my client code public static void main(String[] args) { // Get a proxy for the SOAP endpoint. This is generated from = their WSDL file as part of the Maven build. Zcustomer1 soap =3D new Zcustomer1(); ZUDSCUSTOMER1 port =3D soap.getZcustomer1(); =09 LoggingInInterceptor logInbound =3D new LoggingInInterceptor(); logInbound.setPrettyLogging(true); LoggingOutInterceptor logOutbound =3D new = LoggingOutInterceptor(); logOutbound.setPrettyLogging(true); =09 Client cxf =3D ClientProxy.getClient(port); cxf.getInInterceptors().add(logInbound); cxf.getOutInterceptors().add(logOutbound); =09 // The SOAP service uses HTTP Basic Authentication Map requestContext =3D ((BindingProvider) = port).getRequestContext(); requestContext.put(BindingProvider.USERNAME_PROPERTY, = "username"); requestContext.put(BindingProvider.PASSWORD_PROPERTY, = "password"); =09 // Invoke the SOAP service String iKUNNR =3D "foo"; KNA1 response =3D port.zudsCUSTOMER1(iKUNNR); } Here is the WSDL = = = = = = = = = = = = = = = = --Apple-Mail=_A134B42E-2B2B-4839-8CFE-A3F8F1B157D7--