Java Code Examples for org.apache.cxf.service.model.EndpointInfo#setProperty()

The following examples show how to use org.apache.cxf.service.model.EndpointInfo#setProperty() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: KerberosTokenInterceptorProvider.java    From steady with Apache License 2.0 6 votes vote down vote up
static final TokenStore getTokenStore(Message message) {
    EndpointInfo info = message.getExchange().get(Endpoint.class).getEndpointInfo();
    synchronized (info) {
        TokenStore tokenStore = 
            (TokenStore)message.getContextualProperty(SecurityConstants.TOKEN_STORE_CACHE_INSTANCE);
        if (tokenStore == null) {
            tokenStore = (TokenStore)info.getProperty(SecurityConstants.TOKEN_STORE_CACHE_INSTANCE);
        }
        if (tokenStore == null) {
            TokenStoreFactory tokenStoreFactory = TokenStoreFactory.newInstance();
            String cacheKey = SecurityConstants.TOKEN_STORE_CACHE_INSTANCE;
            if (info.getName() != null) {
                cacheKey += "-" + info.getName().toString().hashCode();
            }
            tokenStore = tokenStoreFactory.newTokenStore(cacheKey, message);
            info.setProperty(SecurityConstants.TOKEN_STORE_CACHE_INSTANCE, tokenStore);
        }
        return tokenStore;
    }
}
 
Example 2
Source File: KerberosTokenInterceptorProvider.java    From steady with Apache License 2.0 6 votes vote down vote up
static final TokenStore getTokenStore(Message message) {
    EndpointInfo info = message.getExchange().get(Endpoint.class).getEndpointInfo();
    synchronized (info) {
        TokenStore tokenStore = 
            (TokenStore)message.getContextualProperty(SecurityConstants.TOKEN_STORE_CACHE_INSTANCE);
        if (tokenStore == null) {
            tokenStore = (TokenStore)info.getProperty(SecurityConstants.TOKEN_STORE_CACHE_INSTANCE);
        }
        if (tokenStore == null) {
            TokenStoreFactory tokenStoreFactory = TokenStoreFactory.newInstance();
            String cacheKey = SecurityConstants.TOKEN_STORE_CACHE_INSTANCE;
            if (info.getName() != null) {
                cacheKey += "-" + info.getName().toString().hashCode();
            }
            tokenStore = tokenStoreFactory.newTokenStore(cacheKey, message);
            info.setProperty(SecurityConstants.TOKEN_STORE_CACHE_INSTANCE, tokenStore);
        }
        return tokenStore;
    }
}
 
Example 3
Source File: PolicyBasedWSS4JInInterceptor.java    From steady with Apache License 2.0 6 votes vote down vote up
private Crypto getSignatureCrypto(Object s, SoapMessage message) throws WSSecurityException {
    Crypto signCrypto = null;
    if (s instanceof Crypto) {
        signCrypto = (Crypto)s;
    } else if (s != null) {
        URL propsURL = getPropertiesFileURL(s, message);
        String propsKey = s.toString();
        if (propsURL != null) {
            propsKey = propsURL.getPath();
        }
        Properties props = getProps(s, propsKey, propsURL, message);
        signCrypto = CryptoFactory.getInstance(props);
        
        EndpointInfo info = message.getExchange().get(Endpoint.class).getEndpointInfo();
        synchronized (info) {
            info.setProperty(SecurityConstants.SIGNATURE_CRYPTO, signCrypto);
        }
    }
    return signCrypto;
}
 
Example 4
Source File: NegotiationUtils.java    From steady with Apache License 2.0 6 votes vote down vote up
static TokenStore getTokenStore(Message message) {
    EndpointInfo info = message.getExchange().get(Endpoint.class).getEndpointInfo();
    synchronized (info) {
        TokenStore tokenStore = 
            (TokenStore)message.getContextualProperty(SecurityConstants.TOKEN_STORE_CACHE_INSTANCE);
        if (tokenStore == null) {
            tokenStore = (TokenStore)info.getProperty(SecurityConstants.TOKEN_STORE_CACHE_INSTANCE);
        }
        if (tokenStore == null) {
            TokenStoreFactory tokenStoreFactory = TokenStoreFactory.newInstance();
            String cacheKey = SecurityConstants.TOKEN_STORE_CACHE_INSTANCE;
            if (info.getName() != null) {
                cacheKey += "-" + info.getName().toString().hashCode();
            }
            tokenStore = tokenStoreFactory.newTokenStore(cacheKey, message);
            info.setProperty(SecurityConstants.TOKEN_STORE_CACHE_INSTANCE, tokenStore);
        }
        return tokenStore;
    }
}
 
Example 5
Source File: STSTokenValidator.java    From steady with Apache License 2.0 6 votes vote down vote up
static final TokenStore getTokenStore(Message message) {
    EndpointInfo info = message.getExchange().get(Endpoint.class).getEndpointInfo();
    synchronized (info) {
        TokenStore tokenStore = 
            (TokenStore)message.getContextualProperty(SecurityConstants.TOKEN_STORE_CACHE_INSTANCE);
        if (tokenStore == null) {
            tokenStore = (TokenStore)info.getProperty(SecurityConstants.TOKEN_STORE_CACHE_INSTANCE);
        }
        if (tokenStore == null) {
            TokenStoreFactory tokenStoreFactory = TokenStoreFactory.newInstance();
            String cacheKey = SecurityConstants.TOKEN_STORE_CACHE_INSTANCE;
            if (info.getName() != null) {
                cacheKey += "-" + info.getName().toString().hashCode();
            }
            tokenStore = tokenStoreFactory.newTokenStore(cacheKey, message);
            info.setProperty(SecurityConstants.TOKEN_STORE_CACHE_INSTANCE, tokenStore);
        }
        return tokenStore;
    }
}
 
Example 6
Source File: PolicyEngineImpl.java    From cxf with Apache License 2.0 6 votes vote down vote up
EndpointPolicy createEndpointPolicyInfo(EndpointInfo ei,
                                            boolean isRequestor,
                                            Assertor assertor,
                                            Message m) {
    EndpointPolicy ep = (EndpointPolicy)ei.getProperty(isRequestor
                                                       ? POLICY_INFO_ENDPOINT_CLIENT : POLICY_INFO_ENDPOINT_SERVER);
    if (ep == null) {
        synchronized (ei) {
            ep = (EndpointPolicy)ei.getProperty(isRequestor
                ? POLICY_INFO_ENDPOINT_CLIENT : POLICY_INFO_ENDPOINT_SERVER);
            if (ep == null) {
                EndpointPolicyImpl epi = new EndpointPolicyImpl(ei, this, isRequestor, assertor);
                epi.initialize(m);
                if (m != null) {
                    ei.setProperty(isRequestor ? POLICY_INFO_ENDPOINT_CLIENT : POLICY_INFO_ENDPOINT_SERVER, epi);
                }
                ep = epi;
            }
        }
    }
    return ep;
}
 
Example 7
Source File: CryptoLoader.java    From cxf with Apache License 2.0 6 votes vote down vote up
public final Map<Object, Crypto> getCryptoCache(Message message) {
    Endpoint endpoint = message.getExchange().getEndpoint();
    if (endpoint != null) {
        EndpointInfo info = endpoint.getEndpointInfo();
        synchronized (info) {
            Map<Object, Crypto> o =
                CastUtils.cast((Map<?, ?>)info.getProperty(CRYPTO_CACHE));
            if (o == null) {
                o = new ConcurrentHashMap<>();
                info.setProperty(CRYPTO_CACHE, o);
            }
            return o;
        }
    }
    return null;
}
 
Example 8
Source File: IssuedTokenInterceptorProvider.java    From steady with Apache License 2.0 6 votes vote down vote up
static final TokenStore createTokenStore(Message message) {
    EndpointInfo info = message.getExchange().get(Endpoint.class).getEndpointInfo();
    synchronized (info) {
        TokenStore tokenStore = 
            (TokenStore)message.getContextualProperty(SecurityConstants.TOKEN_STORE_CACHE_INSTANCE);
        if (tokenStore == null) {
            tokenStore = (TokenStore)info.getProperty(SecurityConstants.TOKEN_STORE_CACHE_INSTANCE);
        }
        if (tokenStore == null) {
            TokenStoreFactory tokenStoreFactory = TokenStoreFactory.newInstance();
            String cacheKey = SecurityConstants.TOKEN_STORE_CACHE_INSTANCE;
            if (info.getName() != null) {
                cacheKey += "-" + info.getName().toString().hashCode();
            }
            tokenStore = tokenStoreFactory.newTokenStore(cacheKey, message);
            info.setProperty(SecurityConstants.TOKEN_STORE_CACHE_INSTANCE, tokenStore);
        }
        return tokenStore;
    }
}
 
Example 9
Source File: STSTokenValidator.java    From steady with Apache License 2.0 6 votes vote down vote up
static final TokenStore getTokenStore(Message message) {
    EndpointInfo info = message.getExchange().get(Endpoint.class).getEndpointInfo();
    synchronized (info) {
        TokenStore tokenStore = 
            (TokenStore)message.getContextualProperty(SecurityConstants.TOKEN_STORE_CACHE_INSTANCE);
        if (tokenStore == null) {
            tokenStore = (TokenStore)info.getProperty(SecurityConstants.TOKEN_STORE_CACHE_INSTANCE);
        }
        if (tokenStore == null) {
            TokenStoreFactory tokenStoreFactory = TokenStoreFactory.newInstance();
            String cacheKey = SecurityConstants.TOKEN_STORE_CACHE_INSTANCE;
            if (info.getName() != null) {
                cacheKey += "-" + info.getName().toString().hashCode();
            }
            tokenStore = tokenStoreFactory.newTokenStore(cacheKey, message);
            info.setProperty(SecurityConstants.TOKEN_STORE_CACHE_INSTANCE, tokenStore);
        }
        return tokenStore;
    }
}
 
Example 10
Source File: WSS4JUtils.java    From steady with Apache License 2.0 5 votes vote down vote up
/**
 * Get a ReplayCache instance. It first checks to see whether caching has been explicitly 
 * enabled or disabled via the booleanKey argument. If it has been set to false then no
 * replay caching is done (for this booleanKey). If it has not been specified, then caching
 * is enabled only if we are not the initiator of the exchange. If it has been specified, then
 * caching is enabled.
 * 
 * It tries to get an instance of ReplayCache via the instanceKey argument from a 
 * contextual property, and failing that the message exchange. If it can't find any, then it
 * defaults to using an EH-Cache instance and stores that on the message exchange.
 */
public static ReplayCache getReplayCache(
    SoapMessage message, String booleanKey, String instanceKey
) {
    boolean specified = false;
    Object o = message.getContextualProperty(booleanKey);
    if (o != null) {
        if (!MessageUtils.isTrue(o)) {
            return null;
        }
        specified = true;
    }

    if (!specified && MessageUtils.isRequestor(message)) {
        return null;
    }
    Endpoint ep = message.getExchange().get(Endpoint.class);
    if (ep != null && ep.getEndpointInfo() != null) {
        EndpointInfo info = ep.getEndpointInfo();
        synchronized (info) {
            ReplayCache replayCache = 
                    (ReplayCache)message.getContextualProperty(instanceKey);
            if (replayCache == null) {
                replayCache = (ReplayCache)info.getProperty(instanceKey);
            }
            if (replayCache == null) {
                ReplayCacheFactory replayCacheFactory = ReplayCacheFactory.newInstance();
                String cacheKey = instanceKey;
                if (info.getName() != null) {
                    cacheKey += "-" + info.getName().toString().hashCode();
                }
                replayCache = replayCacheFactory.newReplayCache(cacheKey, message);
                info.setProperty(instanceKey, replayCache);
            }
            return replayCache;
        }
    }
    return null;
}
 
Example 11
Source File: JMSEndpointTest.java    From cxf with Apache License 2.0 5 votes vote down vote up
@Test
public void testJaxWsProps() throws Exception {
    EndpointInfo ei = new EndpointInfo();
    ei.setProperty(JMSEndpoint.JAXWS_PROPERTY_PREFIX + "durableSubscriptionName", TEST_VALUE);
    JMSEndpoint endpoint = new JMSEndpoint(ei, "jms:queue:Foo.Bar");
    assertEquals(endpoint.getDurableSubscriptionName(), TEST_VALUE);
}
 
Example 12
Source File: AbstractBindingBuilder.java    From steady with Apache License 2.0 5 votes vote down vote up
protected final Map<Object, Crypto> getCryptoCache() {
    EndpointInfo info = message.getExchange().get(Endpoint.class).getEndpointInfo();
    synchronized (info) {
        Map<Object, Crypto> o = 
            CastUtils.cast((Map<?, ?>)message.getContextualProperty(CRYPTO_CACHE));
        if (o == null) {
            o = new ConcurrentHashMap<Object, Crypto>();
            info.setProperty(CRYPTO_CACHE, o);
        }
        return o;
    }
}
 
Example 13
Source File: AbstractBindingBuilder.java    From cxf with Apache License 2.0 5 votes vote down vote up
protected final Map<Object, Crypto> getCryptoCache() {
    EndpointInfo info = message.getExchange().getEndpoint().getEndpointInfo();
    synchronized (info) {
        Map<Object, Crypto> o =
            CastUtils.cast((Map<?, ?>)message.getContextualProperty(CRYPTO_CACHE));
        if (o == null) {
            o = CastUtils.cast((Map<?, ?>)info.getProperty(CRYPTO_CACHE));
        }
        if (o == null) {
            o = new ConcurrentHashMap<>();
            info.setProperty(CRYPTO_CACHE, o);
        }
        return o;
    }
}
 
Example 14
Source File: WSS4JUtils.java    From steady with Apache License 2.0 5 votes vote down vote up
/**
 * Get a ReplayCache instance. It first checks to see whether caching has been explicitly 
 * enabled or disabled via the booleanKey argument. If it has been set to false then no
 * replay caching is done (for this booleanKey). If it has not been specified, then caching
 * is enabled only if we are not the initiator of the exchange. If it has been specified, then
 * caching is enabled.
 * 
 * It tries to get an instance of ReplayCache via the instanceKey argument from a 
 * contextual property, and failing that the message exchange. If it can't find any, then it
 * defaults to using an EH-Cache instance and stores that on the message exchange.
 */
public static ReplayCache getReplayCache(
    SoapMessage message, String booleanKey, String instanceKey
) {
    boolean specified = false;
    Object o = message.getContextualProperty(booleanKey);
    if (o != null) {
        if (!MessageUtils.isTrue(o)) {
            return null;
        }
        specified = true;
    }

    if (!specified && MessageUtils.isRequestor(message)) {
        return null;
    }
    Endpoint ep = message.getExchange().get(Endpoint.class);
    if (ep != null && ep.getEndpointInfo() != null) {
        EndpointInfo info = ep.getEndpointInfo();
        synchronized (info) {
            ReplayCache replayCache = 
                    (ReplayCache)message.getContextualProperty(instanceKey);
            if (replayCache == null) {
                replayCache = (ReplayCache)info.getProperty(instanceKey);
            }
            if (replayCache == null) {
                ReplayCacheFactory replayCacheFactory = ReplayCacheFactory.newInstance();
                String cacheKey = instanceKey;
                if (info.getName() != null) {
                    cacheKey += "-" + info.getName().toString().hashCode();
                }
                replayCache = replayCacheFactory.newReplayCache(cacheKey, message);
                info.setProperty(instanceKey, replayCache);
            }
            return replayCache;
        }
    }
    return null;
}
 
Example 15
Source File: AbstractBindingBuilder.java    From steady with Apache License 2.0 5 votes vote down vote up
protected final Map<Object, Crypto> getCryptoCache() {
    EndpointInfo info = message.getExchange().get(Endpoint.class).getEndpointInfo();
    synchronized (info) {
        Map<Object, Crypto> o = 
            CastUtils.cast((Map<?, ?>)message.getContextualProperty(CRYPTO_CACHE));
        if (o == null) {
            o = new ConcurrentHashMap<Object, Crypto>();
            info.setProperty(CRYPTO_CACHE, o);
        }
        return o;
    }
}
 
Example 16
Source File: TokenStoreUtils.java    From cxf with Apache License 2.0 5 votes vote down vote up
public static TokenStore getTokenStore(Message message) throws TokenStoreException {
    EndpointInfo info = message.getExchange().getEndpoint().getEndpointInfo();
    synchronized (info) {
        TokenStore tokenStore =
            (TokenStore)message.getContextualProperty(SecurityConstants.TOKEN_STORE_CACHE_INSTANCE);
        if (tokenStore == null) {
            tokenStore = (TokenStore)info.getProperty(SecurityConstants.TOKEN_STORE_CACHE_INSTANCE);
        }
        if (tokenStore == null) {
            TokenStoreFactory tokenStoreFactory = TokenStoreFactory.newInstance();
            StringBuilder cacheKey = new StringBuilder(SecurityConstants.TOKEN_STORE_CACHE_INSTANCE);
            String cacheIdentifier =
                (String)message.getContextualProperty(SecurityConstants.CACHE_IDENTIFIER);
            if (cacheIdentifier != null) {
                cacheKey.append('-').append(cacheIdentifier);
            }
            if (info.getName() != null) {
                int hashcode = info.getName().toString().hashCode();
                if (hashcode >= 0) {
                    cacheKey.append('-');
                }
                cacheKey.append(hashcode);
            }

            tokenStore = tokenStoreFactory.newTokenStore(cacheKey.toString(), message);
            info.setProperty(SecurityConstants.TOKEN_STORE_CACHE_INSTANCE, tokenStore);
        }
        return tokenStore;
    }
}
 
Example 17
Source File: SecurityPolicyTest.java    From cxf with Apache License 2.0 4 votes vote down vote up
@Test
public void testCXF4122() throws Exception {
    Bus epBus = BusFactory.newInstance().createBus();
    BusFactory.setDefaultBus(epBus);
    URL wsdl = SecurityPolicyTest.class.getResource("DoubleIt.wsdl");
    EndpointImpl ep = (EndpointImpl)Endpoint.create(new DoubleItImpl());
    ep.setEndpointName(
        new QName("http://www.example.org/contract/DoubleIt", "DoubleItPortCXF4122")
    );
    ep.setWsdlLocation(wsdl.getPath());
    ep.setAddress(POLICY_CXF4122_ADDRESS);
    ep.publish();
    EndpointInfo ei = ep.getServer().getEndpoint().getEndpointInfo();
    setCryptoProperties(ei, "bob.properties", "revocation.properties");
    ei.setProperty(SecurityConstants.ENABLE_REVOCATION, Boolean.TRUE);

    SpringBusFactory bf = new SpringBusFactory();

    Bus bus = bf.createBus();
    BusFactory.setDefaultBus(bus);
    BusFactory.setThreadDefaultBus(bus);
    Service service = Service.create(wsdl, SERVICE_QNAME);

    QName portQName = new QName(NAMESPACE, "DoubleItPortCXF4122");
    DoubleItPortType pt = service.getPort(portQName, DoubleItPortType.class);
    updateAddressPort(pt, PORT);
    ((BindingProvider)pt).getRequestContext().put(SecurityConstants.CALLBACK_HANDLER,
                                                  new KeystorePasswordCallback());
    ((BindingProvider)pt).getRequestContext().put(SecurityConstants.SIGNATURE_PROPERTIES,
                                                  "revocation.properties");
    ((BindingProvider)pt).getRequestContext().put(SecurityConstants.ENCRYPT_PROPERTIES,
                                                  "bob.properties");
    // DOM
    try {
        pt.doubleIt(5);
        fail("should fail on server side when do signature validation due the revoked certificates");
    } catch (Exception ex) {
        // expected
    }

    // TODO See WSS-464
    /*
    SecurityTestUtil.enableStreaming(pt);
    try {
        pt.doubleIt(5);
        fail("should fail on server side when do signature validation due the revoked certificates");
    } catch (Exception ex) {
        String errorMessage = ex.getMessage();
        // Different errors using different JDKs...
        System.out.println("ERR1: " + errorMessage);
    }
    */
    ((java.io.Closeable)pt).close();
    ep.stop();
    epBus.shutdown(true);
    bus.shutdown(true);
}
 
Example 18
Source File: JaxWsServerFactoryBean.java    From cxf with Apache License 2.0 4 votes vote down vote up
@Override
protected BindingInfo createBindingInfo() {
    JaxWsServiceFactoryBean sf = (JaxWsServiceFactoryBean)getServiceFactory();

    JaxWsImplementorInfo implInfo = sf.getJaxWsImplementorInfo();
    String jaxBid = implInfo.getBindingType();
    String binding = getBindingId();
    if (binding == null) {
        binding = jaxBid;
        setBindingId(binding);
    }

    if (binding.equals(SOAPBinding.SOAP11HTTP_BINDING)
        || binding.equals(SOAPBinding.SOAP11HTTP_MTOM_BINDING)) {
        binding = "http://schemas.xmlsoap.org/wsdl/soap/";
        setBindingId(binding);
        if (getBindingConfig() == null) {
            setBindingConfig(new JaxWsSoapBindingConfiguration(sf));
        }
    } else if (binding.equals(SOAPBinding.SOAP12HTTP_MTOM_BINDING)) {
        binding = SOAPBinding.SOAP12HTTP_BINDING;
        setBindingId(binding);
        if (getBindingConfig() == null) {
            setBindingConfig(new JaxWsSoapBindingConfiguration(sf));
        }
    }

    if (getBindingConfig() instanceof JaxWsSoapBindingConfiguration) {
        JaxWsSoapBindingConfiguration conf = (JaxWsSoapBindingConfiguration)getBindingConfig();

        if (jaxBid.equals(SOAPBinding.SOAP12HTTP_BINDING)) {
            conf.setVersion(Soap12.getInstance());
        }

        if (jaxBid.equals(SOAPBinding.SOAP12HTTP_MTOM_BINDING)) {
            conf.setVersion(Soap12.getInstance());
            conf.setMtomEnabled(true);
        }
        if (jaxBid.equals(SOAPBinding.SOAP11HTTP_MTOM_BINDING)) {
            conf.setMtomEnabled(true);
        }

        if (transportId != null) {
            conf.setTransportURI(transportId);
        }
        conf.setJaxWsServiceFactoryBean(sf);

    }

    BindingInfo bindingInfo = super.createBindingInfo();

    if (implInfo.isWebServiceProvider()) {
        bindingInfo.getService().setProperty("soap.force.doclit.bare", Boolean.TRUE);
        if (this.getServiceFactory().isPopulateFromClass()) {
            for (EndpointInfo ei : bindingInfo.getService().getEndpoints()) {
                ei.setProperty("soap.no.validate.parts", Boolean.TRUE);
            }
            //Provider, but no wsdl.  Synthetic ops
            for (BindingOperationInfo op : bindingInfo.getOperations()) {
                op.setProperty("operation.is.synthetic", Boolean.TRUE);
                op.getOperationInfo().setProperty("operation.is.synthetic", Boolean.TRUE);
            }
        }
    }

    return bindingInfo;
}
 
Example 19
Source File: EndpointImpl.java    From cxf with Apache License 2.0 4 votes vote down vote up
/**
 * Performs the publication action by setting up a {@link Server}
 * instance based on this endpoint's configuration.
 *
 * @param addr the optional endpoint address.
 *
 * @throws IllegalStateException if the endpoint cannot be published/republished
 * @throws SecurityException if permission checking is enabled and policy forbids publishing
 * @throws WebServiceException if there is an error publishing the endpoint
 *
 * @see #checkPublishPermission()
 * @see #checkPublishable()
 * @see #getServer(String)
 */
protected void doPublish(String addr) {
    checkPublishPermission();
    checkPublishable();

    ServerImpl serv = null;

    ClassLoaderHolder loader = null;
    try {
        if (bus != null) {
            ClassLoader newLoader = bus.getExtension(ClassLoader.class);
            if (newLoader != null) {
                loader = ClassLoaderUtils.setThreadContextClassloader(newLoader);
            }
        }
        serv = getServer(addr);
        if (addr != null) {
            EndpointInfo endpointInfo = serv.getEndpoint().getEndpointInfo();
            if (endpointInfo.getAddress() == null || !endpointInfo.getAddress().contains(addr)) {
                endpointInfo.setAddress(addr);
            }
            if (publishedEndpointUrl != null) {
                endpointInfo.setProperty(WSDLGetUtils.PUBLISHED_ENDPOINT_URL, publishedEndpointUrl);
            }
            if (publishedEndpointUrl != null && wsdlLocation != null) {
                //early update the publishedEndpointUrl so that endpoints in the same app sharing the same wsdl
                //do not require all of them to be queried for wsdl before the wsdl is finally fully updated
                Definition def = endpointInfo.getService()
                    .getProperty(WSDLServiceBuilder.WSDL_DEFINITION, Definition.class);
                if (def == null) {
                    def = bus.getExtension(WSDLManager.class).getDefinition(wsdlLocation);
                }
                new WSDLGetUtils().updateWSDLPublishedEndpointAddress(def, endpointInfo);
            }

            if (null != properties) {
                for (Entry<String, Object> entry : properties.entrySet()) {
                    endpointInfo.setProperty(entry.getKey(), entry.getValue());
                }
            }

            this.address = endpointInfo.getAddress();
        }
        serv.start();
        publishable = false;
    } catch (Exception ex) {
        try {
            stop();
        } catch (Exception e) {
            // Nothing we can do.
        }

        throw new WebServiceException(ex);
    } finally {
        if (loader != null) {
            loader.reset();
        }
    }
}
 
Example 20
Source File: PolicyEngineImpl.java    From cxf with Apache License 2.0 4 votes vote down vote up
public void setServerEndpointPolicy(EndpointInfo ei, EndpointPolicy ep) {
    ei.setProperty(POLICY_INFO_ENDPOINT_SERVER, ep);
}