當前位置: 首頁>>代碼示例>>Java>>正文


Java JaxWsProxyFactoryBean類代碼示例

本文整理匯總了Java中org.apache.cxf.jaxws.JaxWsProxyFactoryBean的典型用法代碼示例。如果您正苦於以下問題:Java JaxWsProxyFactoryBean類的具體用法?Java JaxWsProxyFactoryBean怎麽用?Java JaxWsProxyFactoryBean使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


JaxWsProxyFactoryBean類屬於org.apache.cxf.jaxws包,在下文中一共展示了JaxWsProxyFactoryBean類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: helloWorldjaxWsProxyFactoryBean

import org.apache.cxf.jaxws.JaxWsProxyFactoryBean; //導入依賴的package包/類
@Bean(name = "helloWorldJaxWsProxyBean")
public HelloWorldPortType helloWorldjaxWsProxyFactoryBean() {
    JaxWsProxyFactoryBean jaxWsProxyFactoryBean = new JaxWsProxyFactoryBean();
    jaxWsProxyFactoryBean.setServiceClass(HelloWorldPortType.class);
    jaxWsProxyFactoryBean.setAddress(environment
            .getProperty("helloworld.address"));
    jaxWsProxyFactoryBean.setBus(bus());

    // set the user name for basic authentication
    jaxWsProxyFactoryBean.setUsername(environment
            .getProperty("client.username"));
    // set the password for basic authentication
    jaxWsProxyFactoryBean.setPassword(environment
            .getProperty("client.password"));

    return (HelloWorldPortType) jaxWsProxyFactoryBean.create();
}
 
開發者ID:code-not-found,項目名稱:jaxws-cxf,代碼行數:18,代碼來源:CxfClient.java

示例2: init

import org.apache.cxf.jaxws.JaxWsProxyFactoryBean; //導入依賴的package包/類
@Before
public void init() {

	Map<String, Object> props = new HashMap<String, Object>();
	props.put("mtom-enabled", Boolean.TRUE);

	JaxWsProxyFactoryBean factory = new JaxWsProxyFactoryBean();
	factory.setServiceClass(SoapDocumentSignatureService.class);
	factory.setProperties(props);
	factory.setAddress(getBaseCxf() + CXFConfig.SOAP_SIGNATURE_ONE_DOCUMENT);
	soapClient = (SoapDocumentSignatureService) factory.create();

	JaxWsProxyFactoryBean factory2 = new JaxWsProxyFactoryBean();
	factory2.setServiceClass(SoapMultipleDocumentsSignatureService.class);
	factory2.setProperties(props);
	factory2.setAddress(getBaseCxf() + CXFConfig.SOAP_SIGNATURE_MULTIPLE_DOCUMENTS);
	soapMultiDocsClient = (SoapMultipleDocumentsSignatureService) factory2.create();
}
 
開發者ID:esig,項目名稱:dss-demonstrations,代碼行數:19,代碼來源:SignatureSoapServiceIT.java

示例3: ticketAgentProxy

import org.apache.cxf.jaxws.JaxWsProxyFactoryBean; //導入依賴的package包/類
@Bean(name = "ticketAgentProxy")
public TicketAgent ticketAgentProxy() {
  JaxWsProxyFactoryBean jaxWsProxyFactoryBean =
      new JaxWsProxyFactoryBean();
  jaxWsProxyFactoryBean.setServiceClass(TicketAgent.class);
  jaxWsProxyFactoryBean.setAddress(address);

  // add an interceptor to log the outgoing request messages
  jaxWsProxyFactoryBean.getOutInterceptors()
      .add(loggingOutInterceptor());
  // add an interceptor to log the incoming response messages
  jaxWsProxyFactoryBean.getInInterceptors()
      .add(loggingInInterceptor());
  // add an interceptor to log the incoming fault messages
  jaxWsProxyFactoryBean.getInFaultInterceptors()
      .add(loggingInInterceptor());

  return (TicketAgent) jaxWsProxyFactoryBean.create();
}
 
開發者ID:code-not-found,項目名稱:cxf-jaxws,代碼行數:20,代碼來源:ClientConfig.java

示例4: testInvokingServiceFromCXFClient

import org.apache.cxf.jaxws.JaxWsProxyFactoryBean; //導入依賴的package包/類
@Test
public void testInvokingServiceFromCXFClient() throws Exception {
    JaxWsProxyFactoryBean proxyFactory = new JaxWsProxyFactoryBean();
    ClientFactoryBean clientBean = proxyFactory.getClientFactoryBean();
    clientBean.setAddress(ADDRESS);
    clientBean.setServiceClass(MyOrderEndpoint.class);
    
    MyOrderEndpoint client = (MyOrderEndpoint) proxyFactory.create();
    
    Holder<String> strPart = new Holder<String>();
    strPart.value = "parts";
    Holder<String> strCustomer = new Holder<String>();
    strCustomer.value = "";

    String result = client.myOrder(strPart, 2, strCustomer);
    assertEquals("Get a wrong order result", "Ordered ammount 2", result);
    assertEquals("Get a wrong parts", "parts", strPart.value);
    assertEquals("Get a wrong customer", "newCustomer", strCustomer.value);
}
 
開發者ID:HydAu,項目名稱:Camel,代碼行數:20,代碼來源:CxfHolderConsumerTest.java

示例5: executePoll

import org.apache.cxf.jaxws.JaxWsProxyFactoryBean; //導入依賴的package包/類
/**
     * Poll a query using local transport.
     */
    protected QueryResults executePoll(Poll poll) throws ImplementationExceptionResponse,
            QueryTooComplexExceptionResponse, QueryTooLargeExceptionResponse, SecurityExceptionResponse,
            ValidationExceptionResponse, NoSuchNameExceptionResponse, QueryParameterExceptionResponse {
        // we use CXF's local transport feature here
//        EPCglobalEPCISService service = new EPCglobalEPCISService();
//        QName portName = new QName("urn:epcglobal:epcis:wsdl:1", "EPCglobalEPCISServicePortLocal");
//        service.addPort(portName, "http://schemas.xmlsoap.org/soap/", "local://query");
//        EPCISServicePortType servicePort = service.getPort(portName, EPCISServicePortType.class);

        // the same using CXF API
         JaxWsProxyFactoryBean factory = new JaxWsProxyFactoryBean();
         factory.setAddress("local://query");
         factory.setServiceClass(EPCISServicePortType.class);
         EPCISServicePortType servicePort = (EPCISServicePortType)
         factory.create();

        return servicePort.poll(poll);
    }
 
開發者ID:Fosstrak,項目名稱:fosstrak-epcis,代碼行數:22,代碼來源:QuerySubscription.java

示例6: ticketAgent

import org.apache.cxf.jaxws.JaxWsProxyFactoryBean; //導入依賴的package包/類
@Bean(name = "ticketAgentProxyBean")
public TicketAgent ticketAgent() {
  JaxWsProxyFactoryBean jaxWsProxyFactoryBean =
      new JaxWsProxyFactoryBean();
  jaxWsProxyFactoryBean.setServiceClass(TicketAgent.class);
  jaxWsProxyFactoryBean.setAddress(address);

  // add the WSS4J OUT interceptor to sign the request message
  jaxWsProxyFactoryBean.getOutInterceptors().add(clientWssOut());
  // add the WSS4J IN interceptor to verify the signature on the response message
  jaxWsProxyFactoryBean.getInInterceptors().add(clientWssIn());

  // log the request and response messages
  jaxWsProxyFactoryBean.getInInterceptors()
      .add(loggingInInterceptor());
  jaxWsProxyFactoryBean.getOutInterceptors()
      .add(loggingOutInterceptor());

  return (TicketAgent) jaxWsProxyFactoryBean.create();
}
 
開發者ID:code-not-found,項目名稱:cxf-jaxws,代碼行數:21,代碼來源:ClientConfig.java

示例7: main

import org.apache.cxf.jaxws.JaxWsProxyFactoryBean; //導入依賴的package包/類
public static void main(String[] args){
    // You just need to set the address with JMS URI
    String address = "jms:jndi:dynamicQueues/EmployeeQueue"
            + "?jndiInitialContextFactory=org.apache.activemq.jndi.ActiveMQInitialContextFactory"
            + "&jndiConnectionFactoryName=ConnectionFactory"
            + "&jndiURL=tcp://localhost:61616";
    JaxWsProxyFactoryBean factory = new JaxWsProxyFactoryBean();
    // And specify the transport ID with SOAP over JMS specification
    factory.setTransportId(JMSSpecConstants.SOAP_JMS_SPECIFICATION_TRANSPORTID);
    factory.setServiceClass(EmployeeWebService.class);
    factory.setAddress(address);
    EmployeeWebService client = (EmployeeWebService)factory.create();
    client.changePositionAsync(1,1);
    System.out.println("changed");
    System.exit(0);
}
 
開發者ID:Witerium,項目名稱:stuffEngine,代碼行數:17,代碼來源:Main2.java

示例8: getServiceProxy

import org.apache.cxf.jaxws.JaxWsProxyFactoryBean; //導入依賴的package包/類
public static JaxWsProxyFactoryBean getServiceProxy(BindingProvider servicePort, String serviceAddr) {
		JaxWsProxyFactoryBean proxyFactory = new JaxWsProxyFactoryBean();
		if(serviceAddr != null)
			proxyFactory.setAddress(serviceAddr);
		proxyFactory.setServiceClass(servicePort.getClass());
		proxyFactory.getOutInterceptors().add(new LoggingOutInterceptor());  
		SoapBindingConfiguration config = new SoapBindingConfiguration();  
		config.setVersion(Soap12.getInstance());
		proxyFactory.setBindingConfig(config);
		Client deviceClient = ClientProxy.getClient(servicePort);

		HTTPConduit http = (HTTPConduit) deviceClient.getConduit();

//		AuthorizationPolicy authPolicy = new AuthorizationPolicy();
//		authPolicy.setUserName(username);
//		authPolicy.setPassword(password);
//		authPolicy.setAuthorizationType("Basic");
//		http.setAuthorization(authPolicy);
		
		HTTPClientPolicy httpClientPolicy = http.getClient();
		httpClientPolicy.setConnectionTimeout(36000);  
		httpClientPolicy.setReceiveTimeout(32000);
		httpClientPolicy.setAllowChunking(false);
		return proxyFactory;
	}
 
開發者ID:fpompermaier,項目名稱:onvif,代碼行數:26,代碼來源:OnvifDevice.java

示例9: createCXFClient

import org.apache.cxf.jaxws.JaxWsProxyFactoryBean; //導入依賴的package包/類
protected static ReportIncidentEndpoint createCXFClient(String url) {
    List<Interceptor<? extends Message>> outInterceptors = new ArrayList<Interceptor<? extends Message>>();

    // Define WSS4j properties for flow outgoing
    Map<String, Object> outProps = new HashMap<String, Object>();
    outProps.put("action", "UsernameToken Timestamp");

    outProps.put("passwordType", "PasswordDigest");
    outProps.put("user", "charles");
    outProps.put("passwordCallbackClass", "org.apache.camel.example.reportincident.UTPasswordCallback");

    WSS4JOutInterceptor wss4j = new WSS4JOutInterceptor(outProps);

    // Add LoggingOutInterceptor
    LoggingOutInterceptor loggingOutInterceptor = new LoggingOutInterceptor();

    outInterceptors.add(wss4j);
    outInterceptors.add(loggingOutInterceptor);

    // we use CXF to create a client for us as its easier than JAXWS and works
    JaxWsProxyFactoryBean factory = new JaxWsProxyFactoryBean();
    factory.setOutInterceptors(outInterceptors);
    factory.setServiceClass(ReportIncidentEndpoint.class);
    factory.setAddress(url);
    return (ReportIncidentEndpoint) factory.create();
}
 
開發者ID:HydAu,項目名稱:Camel,代碼行數:27,代碼來源:ReportIncidentRoutesTest.java

示例10: testWSAddressing

import org.apache.cxf.jaxws.JaxWsProxyFactoryBean; //導入依賴的package包/類
@Test
public void testWSAddressing() throws Exception {
    JaxWsProxyFactoryBean proxyFactory = new  JaxWsProxyFactoryBean();
    ClientFactoryBean clientBean = proxyFactory.getClientFactoryBean();
    clientBean.setAddress(getClientAddress());
    clientBean.setServiceClass(Greeter.class);
    SpringBusFactory bf = new SpringBusFactory();
    URL cxfConfig = null;

    if (getCxfClientConfig() != null) {
        cxfConfig = ClassLoaderUtils.getResource(getCxfClientConfig(), this.getClass());
    }
    proxyFactory.setBus(bf.createBus(cxfConfig));
    Greeter client = (Greeter) proxyFactory.create();
    String result = client.greetMe("world!");
    assertEquals("Get a wrong response", "Hello world!", result);
}
 
開發者ID:HydAu,項目名稱:Camel,代碼行數:18,代碼來源:WSAddressingTest.java

示例11: testWSAddressing

import org.apache.cxf.jaxws.JaxWsProxyFactoryBean; //導入依賴的package包/類
@Test
public void testWSAddressing() throws Exception {
    JaxWsProxyFactoryBean proxyFactory = new  JaxWsProxyFactoryBean();
    ClientFactoryBean clientBean = proxyFactory.getClientFactoryBean();
    clientBean.setAddress(getClientAddress());
    clientBean.setServiceClass(HelloWorld.class);
    clientBean.setWsdlURL(WSRMTest.class.getResource("/HelloWorld.wsdl").toString());
    SpringBusFactory bf = new SpringBusFactory();
    URL cxfConfig = null;

    if (getCxfClientConfig() != null) {
        cxfConfig = ClassLoaderUtils.getResource(getCxfClientConfig(), this.getClass());
    }
    proxyFactory.setBus(bf.createBus(cxfConfig));
    proxyFactory.getOutInterceptors().add(new MessageLossSimulator());
    HelloWorld client = (HelloWorld) proxyFactory.create();
    String result = client.sayHi("world!");
    assertEquals("Get a wrong response", "Hello world!", result);
}
 
開發者ID:HydAu,項目名稱:Camel,代碼行數:20,代碼來源:WSRMTest.java

示例12: testInvokingServiceFromCXFClient

import org.apache.cxf.jaxws.JaxWsProxyFactoryBean; //導入依賴的package包/類
@Test
public void testInvokingServiceFromCXFClient() throws Exception {
    JaxWsProxyFactoryBean proxyFactory = new JaxWsProxyFactoryBean();
    ClientFactoryBean clientBean = proxyFactory.getClientFactoryBean();
    clientBean.setAddress(ROUTER_ADDRESS);
    clientBean.setServiceClass(Greeter.class);

    Greeter client = (Greeter) proxyFactory.create();

    try {
        client.pingMe();
        fail("Expect to get an exception here");
    } catch (PingMeFault expected) {
        assertEquals(MESSAGE, expected.getMessage());
    } catch (Throwable t) {
        t.printStackTrace();
        fail("The CXF client did not manage to map the client exception "
            + t.getClass().getName() + " to a " + PingMeFault.class.getName()
            + ": " + t.getMessage());
    }

}
 
開發者ID:HydAu,項目名稱:Camel,代碼行數:23,代碼來源:JaxWsWebFaultAnnotationToFaultTest.java

示例13: initializeRemoteServiceRegistry

import org.apache.cxf.jaxws.JaxWsProxyFactoryBean; //導入依賴的package包/類
protected ServiceRegistry initializeRemoteServiceRegistry() {
	String registryBootstrapUrl = ConfigContext.getCurrentContextConfig().getProperty(KSBConstants.Config.REGISTRY_SERVICE_URL);
	if (StringUtils.isBlank(registryBootstrapUrl)) {
		throw new RiceRuntimeException("Failed to load registry bootstrap service from url: " + registryBootstrapUrl);
	}
	ClientProxyFactoryBean clientFactory = new JaxWsProxyFactoryBean();
	clientFactory.setServiceClass(ServiceRegistry.class);
	clientFactory.setBus(cxfBus);
	clientFactory.setAddress(registryBootstrapUrl);

       boolean registrySecurity = ConfigContext.getCurrentContextConfig().getBooleanProperty(SERVICE_REGISTRY_SECURITY_CONFIG, true);

	// Set security interceptors
	clientFactory.getOutInterceptors().add(new CXFWSS4JOutInterceptor(registrySecurity));
	clientFactory.getInInterceptors().add(new CXFWSS4JInInterceptor(registrySecurity));

       //Set transformation interceptors
       clientFactory.getInInterceptors().add(new ImmutableCollectionsInInterceptor());
	
	Object service = clientFactory.create();
	if (!(service instanceof ServiceRegistry)) {
		throw new RiceRuntimeException("Endpoint to service registry at URL '" + registryBootstrapUrl + "' was not an instance of ServiceRegistry, instead was: " + service);
	}
	return (ServiceRegistry)service;
}
 
開發者ID:kuali,項目名稱:kc-rice,代碼行數:26,代碼來源:LazyRemoteServiceRegistryConnector.java

示例14: createCXFClient

import org.apache.cxf.jaxws.JaxWsProxyFactoryBean; //導入依賴的package包/類
protected static OrderEndpoint createCXFClient(String url, String user, String passwordCallbackClass) {
    List<Interceptor<? extends Message>> outInterceptors = new ArrayList();

    // Define WSS4j properties for flow outgoing
    Map<String, Object> outProps = new HashMap<String, Object>();
    outProps.put("action", "UsernameToken Timestamp");
    outProps.put("user", user);
    outProps.put("passwordCallbackClass", passwordCallbackClass);

    WSS4JOutInterceptor wss4j = new WSS4JOutInterceptor(outProps);
    // Add LoggingOutInterceptor
    LoggingOutInterceptor loggingOutInterceptor = new LoggingOutInterceptor();

    outInterceptors.add(wss4j);
    outInterceptors.add(loggingOutInterceptor);

    // we use CXF to create a client for us as its easier than JAXWS and works
    JaxWsProxyFactoryBean factory = new JaxWsProxyFactoryBean();
    factory.setOutInterceptors(outInterceptors);
    factory.setServiceClass(OrderEndpoint.class);
    factory.setAddress(url);
    return (OrderEndpoint) factory.create();
}
 
開發者ID:camelinaction,項目名稱:camelinaction2,代碼行數:24,代碼來源:WssAuthTest.java

示例15: getProxy

import org.apache.cxf.jaxws.JaxWsProxyFactoryBean; //導入依賴的package包/類
/**
 * @return the proxy object. if null, display the connect dialog.
 */
protected Object getProxy() throws FosstrakAleClientException {
	if (null == m_proxy) {
		// display the connect dialog
		String address = FosstrakAleClient.instance().showConnectDialog(m_endpointKey);
		
		// create the proxy object.
		JaxWsProxyFactoryBean factory = new JaxWsProxyFactoryBean();
		factory.setServiceClass(m_clzz);
		factory.setAddress(address);
		m_proxy = factory.create();
		
		// we try to perform a test method call.
		// if that call fails, we assume the connection to be daad.
		try {
			m_testMethod.invoke(m_proxy, m_testMethodParameter);
		} catch (Exception e) {
			m_proxy = null;
			throw new FosstrakAleClientServiceDownException(e);
		}
	}
	return m_proxy;
}
 
開發者ID:Auto-ID-Lab-Japan,項目名稱:fosstrak-fc,代碼行數:26,代碼來源:AbstractTab.java


注:本文中的org.apache.cxf.jaxws.JaxWsProxyFactoryBean類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。