Hi, I think if you use two separate factory instances, you don't have this problem even if you have namespace collision.
Can you try the following? JaxWsDynamicClientFactory dcf1 = JaxWsDynamicClientFactory.newInstance(); JaxWsDynamicClientFactory dcf2 = JaxWsDynamicClientFactory.newInstance(); deviceClient1 = dcf1.createClient(wsdlURL1); deviceClient2 = dcf2.createClient(wsdlURL2); regards, aki 2011/3/25 Tomas Olsson <[email protected]>: > Hi, > I have stumbled on this annoying problem (CXF 2.3.2), if I want to create > two dynamic clients like this: > > JaxWsDynamicClientFactory dcf = JaxWsDynamicClientFactory.newInstance(); > deviceClient1 = dcf.createClient(wsdlURL1); > deviceClient2 = dcf.createClient(wsdlURL2); > > But only the first one will work properly. When I call the second one it > does not find the generated classes (the same if I shift their creation > order, the last created will not work properly). I believe the problem can > be due to both having the same namespace. Part of the exception below: > > WARNING: Interceptor for > {http://tempuri.org/}BasicSwitchWS#{http://tempuri.org/}GetSwitchStatus has > thrown exception, unwinding now > org.apache.cxf.interceptor.Fault: Marshalling Error: > org.tempuri.GetSwitchStatus is not known to this context > at > org.apache.cxf.jaxb.JAXBEncoderDecoder.marshall(JAXBEncoderDecoder.java:256) > at org.apache.cxf.jaxb.io.DataWriterImpl.write(DataWriterImpl.java:169) > at > org.apache.cxf.interceptor.AbstractOutDatabindingInterceptor.writeParts(AbstractOutDatabindingInterceptor.java:110) > at > org.apache.cxf.interceptor.BareOutInterceptor.handleMessage(BareOutInterceptor.java:68) > at > org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:255) > at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:516) > > Is there any workaround? I cannot change their namespaces. > > /Tomas > > >
