It seems that the ServiceImpl code is copying over stuff from the following items (all this stuff is near the 620 line): features, interceptors, conduit selector
It seems to do nothing with the following: address, bus, properties, handlers I don't know which of these things it SHOULD do. To my noobie viewpoint, it seems like it should copy the address information if present, set the bus in the endpoint object if present, and copy any properties found into the endpoint object. I have no idea what to do with handlers. Unless anyone disagrees, I'll make a bug report for this and patch it. I'll also patch the DispatchImpl to respect the ws-addressing feature if set in the jaxws:client bean. Thanks, Jesse -----Original Message----- From: Jesse Pangburn [mailto:[email protected]] Sent: Friday, August 19, 2011 12:54 PM To: Daniel Kulp; [email protected] Subject: RE: Can Dispatch API be used with jaxws:client Spring configuration? When I debug into ServiceImpl line 610, it gets down to org.apache.cxf.configuration.spring.ConfigurerImpl and line 151 throws: org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named '{urn:ihe:iti:xds-b:2007}DocumentRegistry_Port_Soap12.jaxws-client.proxyFactory' is defined This is caught and logged FINE, which amusingly has the comment: // users often wonder why the settings in their configuration files seem // to have no effect - the most common cause is that they have been using // incorrect bean ids If I check my spring context and call context.getBeanDefinitionNames() I get the following (among others): registryClient.jaxws-client.proxyFactory It does not have an entry with that name from the exception. The similar entry is does have is from the id attribute, so I tried removing that id attribute (and other things) but leaving the createdFromAPI (because that makes the .jaxws-client part of the name) from jaxws:client and just leaving: <jaxws:client name="{urn:ihe:iti:xds-b:2007}DocumentRegistry_Port_Soap12" address="http://localhost:30320/tf6/services/xdsregistryb" createdFromAPI="true"> <jaxws:features> <wsa:addressing/> </jaxws:features> </jaxws:client> Now the ConfigurerImpl matches the bean name and configured it and ServiceImpl line 621 does apply the ws-addressing feature, but unfortunately the addressing is wrong. Probably same problem as yesterday when I tried configuring it via the cxf:bus, that code in DispatchImpl is probably not enabling ws-addressing. Also, it uses the address from the WSDL and ignores the address in the jaxws:client element. At least it's closer. Thanks, Jesse -----Original Message----- From: Daniel Kulp [mailto:[email protected]] Sent: Thursday, August 18, 2011 7:51 PM To: [email protected] Cc: Jesse Pangburn Subject: Re: Can Dispatch API be used with jaxws:client Spring configuration? This SHOULD be working. Line 610 of ServiceImpl.java calls off to the configureObject with the right name, so it should be configuring in the features and then copying them over at line 621. Any chance you can debug through that code to see if anything looks strange? Dan On Thursday, August 18, 2011 3:11:40 PM Jesse Pangburn wrote: > I'm trying to use the Spring jaxws:client configuration to put as much of > the setup for my Dispatch API client into Spring as possible, but it seems > to be ignoring it. > > The following is the code I'm using to setup the dispatch client: > URL wsdlURL = new > URL("file:/home/jpangburn/Desktop/IHE/XDSb.Support.Materials.v9/wsdl/XDS.b_ > DocumentRegistry.wsdl"); Service service = Service.create(wsdlURL, new > QName("urn:ihe:iti:xds-b:2007", "DocumentRegistry_Service")); > Dispatch<StaxSource> disp = service.createDispatch(new > QName("urn:ihe:iti:xds-b:2007", "DocumentRegistry_Port_Soap12"), > StaxSource.class, Service.Mode.PAYLOAD); > > So the port is "{urn:ihe:iti:xds-b:2007}DocumentRegistry_Port_Soap12". In > my Spring configuration I've tried this: <jaxws:client id="registryClient" > name="{urn:ihe:iti:xds-b:2007}DocumentRegistry_Port_Soap12" > address="http://localhost:30320/tf6/services/xdsregistryb" > xmlns:ihe="urn:ihe:iti:xds-b:2007" > endpointName="ihe:DocumentRegistry_Port_Soap12" > serviceName="ihe:DocumentRegistry_Service" > createdFromAPI="true"> > <jaxws:features> > <wsa:addressing > xmlns:wsa="http://cxf.apache.org/ws/addressing"/> > </jaxws:features> > </jaxws:client> > > At first I hoped the "name" attribute would cause the matching at it would > pick up my "address" attribute to set the destination address and my > wsa:addressing feature to enable ws-addressing. It did not, just sent to > the same url defined in the WSDL. So I added the endpointName and > serviceName attributes, which also didn't help. Then I added > "createdFromAPI" which didn't do anything either. > > I know the Spring configuration is working to some degree because if I put > in a http:conduit that works just fine: <http:conduit > name="{urn:ihe:iti:xds-b:2007}DocumentRegistry_Port_Soap12.http-conduit"> > <http:tlsClientParameters disableCNCheck="true"> > ... > > Is jaxws:client configuration just not related to the Dispatch API at all? > If so, why not? This seems like it would be a nice way to setup address > overrides, turn on/off jaxws:features, logging, interceptors, etc. for the > Dispatch API. > > Thanks, > Jesse -- Daniel Kulp [email protected] http://dankulp.com/blog Talend - http://www.talend.com
