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 23421104BC for ; Thu, 18 Jul 2013 08:52:49 +0000 (UTC) Received: (qmail 91644 invoked by uid 500); 18 Jul 2013 08:52:48 -0000 Delivered-To: apmail-cxf-dev-archive@cxf.apache.org Received: (qmail 91246 invoked by uid 500); 18 Jul 2013 08:52:48 -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 91238 invoked by uid 99); 18 Jul 2013 08:52:47 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 18 Jul 2013 08:52:47 +0000 X-ASF-Spam-Status: No, hits=1.5 required=5.0 tests=HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_PASS,WEIRD_PORT X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of mail2jimma@gmail.com designates 209.85.128.53 as permitted sender) Received: from [209.85.128.53] (HELO mail-qe0-f53.google.com) (209.85.128.53) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 18 Jul 2013 08:52:41 +0000 Received: by mail-qe0-f53.google.com with SMTP id 1so1618337qee.26 for ; Thu, 18 Jul 2013 01:52:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:reply-to:in-reply-to:references:date:message-id :subject:from:to:content-type; bh=1UzKWeZ7cntFo3euuLWv1+vZ7ORFOuZ9x3WFHXh3S9A=; b=sHyxKRWc04uPr0Tvj/+YCp41mXDxniLqAFFNNrcTWxcnuLnHFs+uVBLyIHgqnwSIHJ AKBv8VVd8T+lkxBGCC4dp+OfTfS8rmHBE5rWmue8mwcmuQklrgo+lz9DIow0WMRQXnbt 1KGM3IHK6DWZTUT6xPV6UKpc6Nwv7WFzextZCaISKpL+mA/7/IAoWQWIhtmxwEedBk8a mmckopQS83tMQhcJu/gSdVvN41fGSUQTDZFgAe89wkmnRu7ohY4/saCSNtZO1zWFjjsN PGscQcNjGbOHpgz+FMP6LEbkn1EjFAftwjLO4+f5whylLgdQMzU8sZ4wD80zvrFlPc4C N8/w== MIME-Version: 1.0 X-Received: by 10.49.61.167 with SMTP id q7mr11491608qer.80.1374137540364; Thu, 18 Jul 2013 01:52:20 -0700 (PDT) Received: by 10.49.37.169 with HTTP; Thu, 18 Jul 2013 01:52:20 -0700 (PDT) Reply-To: mail2jimma@gmail.com In-Reply-To: References: Date: Thu, 18 Jul 2013 16:52:20 +0800 Message-ID: Subject: Re: [jira] [Resolved] (CXF-4836) ServiceImpl getPort does not need to throw Exception if the portName can not be found in portInfos From: Jim Ma To: "dev@cxf.apache.org" Content-Type: multipart/alternative; boundary=047d7bdc9fbaf7516104e1c5536a X-Virus-Checked: Checked by ClamAV on apache.org --047d7bdc9fbaf7516104e1c5536a Content-Type: text/plain; charset=ISO-8859-1 Please see revision 1504368: https://fisheye6.atlassian.com/changelog/cxf?cs=1504368 On Thu, Jul 18, 2013 at 2:45 PM, Bin Zhu wrote: > I see this issue has been marked as resolved, but I didn't find the code > changes for it. Where can I check the code fix for this issue? Thanks. > > > 2013/7/18 Jim Ma (JIRA) > > > > > [ > > > https://issues.apache.org/jira/browse/CXF-4836?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel > ] > > > > Jim Ma resolved CXF-4836. > > ------------------------- > > > > Resolution: Fixed > > > > > ServiceImpl getPort does not need to throw Exception if the portName > can > > not be found in portInfos > > > > > > -------------------------------------------------------------------------------------------------- > > > > > > Key: CXF-4836 > > > URL: https://issues.apache.org/jira/browse/CXF-4836 > > > Project: CXF > > > Issue Type: Bug > > > Components: JAX-WS Runtime > > > Affects Versions: 2.6.2 > > > Reporter: Yan Min Sheng > > > Assignee: Jim Ma > > > > > > We create such client which will set target address info and binding > > info in RequestContext of BindingProvider. > > > String mtom11URL = " > > http://localhost:9080//MyBusiness/MTOM11Service"; > > > > > > MTOMInterface port = null; > > > BindingProvider bp = null; > > > > > > System.out.println("Looking up SOAP 1.1 MTOM service"); > > > QName serviceName = new QName(" > > http://shengym.com/MyBusiness/","MTOM11Service"); > > > QName portName = new QName(" > http://shengym.com/MyBusiness", > > "MTOM11Port"); > > > // Setup the necessary JAX-WS artifacts > > > Service svc = Service.create(serviceName); > > > port = svc.getPort(portName, MTOMInterface.class); > > > // Set the target URL > > > bp = (BindingProvider) port; > > > Map requestCtx = bp.getRequestContext(); > > > > > requestCtx.put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY,mtom11URL); > > > > > > // Enable MTOM > > > SOAPBinding binding = (SOAPBinding) bp.getBinding(); > > > binding.setMTOMEnabled(true); > > > However, it reports such error: > > > javax.xml.ws.WebServiceException:Port{ > > http://shengym.com/MyBusiness/}MTOM11Port not found. > > > org.apache.cxf.jaxws.ServiceImpl.getPort(ServiceImpl.java:332) > > > org.apache.cxf.jaxws.ServiceImpl.getPort(ServiceImpl.java:323) > > > javax.xml.ws.Service.getPort(Service.java:134) > > > I know that the added following code can fix this error: > > > svc.addPort(portName, SOAPBinding.SOAP11HTTP_MTOM_BINDING, mtom11URL); > > > Well, this error should not report even the addPort method is not > called. > > > I know the added check in ServiceImpl is to avoid run time error and > > report it as early as possible. But I think it is not needed. The reasons > > are: > > > 1. User can get run time error later; > > > 2. User can set target addess info and bind info in other ways (as my > > example shows) > > > I remove the check from the ServiceImpl then my client code works well. > > > > -- > > This message is automatically generated by JIRA. > > If you think it was sent incorrectly, please contact your JIRA > > administrators > > For more information on JIRA, see: > http://www.atlassian.com/software/jira > > > --047d7bdc9fbaf7516104e1c5536a--