You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@cxf.apache.org by "Jim Ma (JIRA)" <ji...@apache.org> on 2013/07/18 08:14:48 UTC

[jira] [Resolved] (CXF-4836) ServiceImpl getPort does not need to throw Exception if the portName can not be found in portInfos

     [ 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<String, Object> 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

Re: [jira] [Resolved] (CXF-4836) ServiceImpl getPort does not need to throw Exception if the portName can not be found in portInfos

Posted by Jim Ma <ma...@gmail.com>.
Please see revision 1504368:
https://fisheye6.atlassian.com/changelog/cxf?cs=1504368


On Thu, Jul 18, 2013 at 2:45 PM, Bin Zhu <lu...@gmail.com> 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) <ji...@apache.org>
>
> >
> >      [
> >
> 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<String, Object> 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
> >
>

Re: [jira] [Resolved] (CXF-4836) ServiceImpl getPort does not need to throw Exception if the portName can not be found in portInfos

Posted by Bin Zhu <lu...@gmail.com>.
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) <ji...@apache.org>

>
>      [
> 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<String, Object> 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
>