@Override
    public void resolve(InjectionBinding<WebServiceRef> binding) throws InjectionException {

        // This was a JAX-WS service reference, we need to do some setup for
        // our object factory, and we also need to make sure we store the
        // metadata away in the appropriate location.

        WebServiceRefInfo wsrInfo = ((WebServiceRefBinding) binding).getWebServiceRefInfo();

        Reference ref = null;

        // If the "lookup-name" attribute was specified for this service-ref, then we'll bind into the namespace
        // an instance of the IndirectJndiLookup reference that will be resolved by the IndirectJndiLookupObjectFactory.
        // If a JNDI lookup is performed on this "service-ref", then the IndirectJndiLookupObjectFactory will simply
        // turn around and handle the extra level of indirection by looking up the referenced service-ref, which
        // will in turn cause our ServiceRefObjectFactory to be invoked.
        if (wsrInfo.getLookupName() != null && !wsrInfo.getLookupName().isEmpty()) {

            if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
                Tr.debug(tc, "Build IndirectJndiLookup(" + wsrInfo.getLookupName() + ") for service-ref '" + wsrInfo.getJndiName());
            }

            IndirectJndiLookupReferenceFactory factory = ivNameSpaceConfig.getIndirectJndiLookupReferenceFactory();
            ref = factory.createIndirectJndiLookup(binding.getJndiName(), wsrInfo.getLookupName(), Object.class.getName());

            if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
                Tr.debug(tc, "Obtained Reference from IndirectJndiLookup object: " + ref.toString());
            }

        } else { // Otherwise, we'll build a reference that will be resolved by our own object factory.

            ref = new Reference(WebServiceRefProcessor.class.getName(), ServiceRefObjectFactory.class.getName(), null);

            // Add our serializable service-ref metadata to the Reference.
            WebServiceRefInfoRefAddr wsrInfoRefAddr = new WebServiceRefInfoRefAddr(wsrInfo);
            ref.add(wsrInfoRefAddr);

            // If our classloader is not null, then that means we're being called under the context of an application module.
            // In this case, we want to store away the module-specific metadata in the module's metadata slot.

            // This has been moved to LibertyProviderImpl since in that time slot, clientMetadata will always be available
            // If CDI is enabled, the injections happens before JaxwsModuleMetaDataLister.metaDataCreated()
            /*
             * if (ivNameSpaceConfig.getClassLoader() != null) {
             * // get the client metadata. in client side, here should be the first time get the client metadata, so will create one.
             * JaxWsClientMetaData clientMetaData = JaxWsMetaDataManager.getJaxWsClientMetaData(ivNameSpaceConfig.getModuleMetaData());
             * 
             * // parsing and merge the client configuration from the ibm-ws-bnd.xml
             * if (clientMetaData != null)
             * {
             * mergeWebServicesBndInfo(wsrInfo, clientMetaData);
             * }
             * 
             * }
             */
            J2EEName j2eeName = ivNameSpaceConfig.getJ2EEName();
            String componenetName = (null != j2eeName) ? j2eeName.getComponent() : null;
            wsrInfo.setComponenetName(componenetName);

        }

        WebServiceRefInfoBuilder.configureWebServiceRefPartialInfo(wsrInfo, ivNameSpaceConfig.getClassLoader());
        binding.setObjects(null, ref);

    }
@ Override public void resolve ( InjectionBinding < WebServiceRef > binding ) throws InjectionException { WebServiceRefInfo wsrInfo = ( ( WebServiceRefBinding ) binding ) . getWebServiceRefInfo ( ) ; Reference ref = null ; if ( wsrInfo . getLookupName ( ) != null && ! wsrInfo . getLookupName ( ) . isEmpty ( ) ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "Build IndirectJndiLookup(" + wsrInfo . getLookupName ( ) + ") for service-ref '" + wsrInfo . getJndiName ( ) ) ; } IndirectJndiLookupReferenceFactory factory = ivNameSpaceConfig . getIndirectJndiLookupReferenceFactory ( ) ; ref = factory . createIndirectJndiLookup ( binding . getJndiName ( ) , wsrInfo . getLookupName ( ) , Object . class . getName ( ) ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "Obtained Reference from IndirectJndiLookup object: " + ref . toString ( ) ) ; } } else { ref = new Reference ( WebServiceRefProcessor . class . getName ( ) , ServiceRefObjectFactory . class . getName ( ) , null ) ; WebServiceRefInfoRefAddr wsrInfoRefAddr = new WebServiceRefInfoRefAddr ( wsrInfo ) ; ref . add ( wsrInfoRefAddr ) ; J2EEName j2eeName = ivNameSpaceConfig . getJ2EEName ( ) ; String componenetName = ( null != j2eeName ) ? j2eeName . getComponent ( ) : null ; wsrInfo . setComponenetName ( componenetName ) ; } WebServiceRefInfoBuilder . configureWebServiceRefPartialInfo ( wsrInfo , ivNameSpaceConfig . getClassLoader ( ) ) ; binding . setObjects ( null , ref ) ; }
This method will resolve the InjectionBinding it is given. This involves storing the correct information within
the binding instance so that later on the injection can occur. It also enables JNDI lookups to occur on the
resource that is indicated in the binding.