本文整理汇总了Java中org.apache.cxf.jaxws.JaxWsProxyFactoryBean.setAddress方法的典型用法代码示例。如果您正苦于以下问题:Java JaxWsProxyFactoryBean.setAddress方法的具体用法?Java JaxWsProxyFactoryBean.setAddress怎么用?Java JaxWsProxyFactoryBean.setAddress使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.cxf.jaxws.JaxWsProxyFactoryBean
的用法示例。
在下文中一共展示了JaxWsProxyFactoryBean.setAddress方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: 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();
}
示例2: 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();
}
示例3: 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();
}
示例4: 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);
}
示例5: 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();
}
示例6: testCluster
import org.apache.cxf.jaxws.JaxWsProxyFactoryBean; //导入方法依赖的package包/类
@Test
@RunAsClient
public void testCluster() throws Exception
{
List<String> serviceList = new ArrayList<String>();
serviceList.add(baseURL.toExternalForm() + "/ClusetrService");
RandomStrategy strategy = new RandomStrategy();
strategy.setAlternateAddresses(serviceList);
FailoverFeature ff = new FailoverFeature();
ff.setStrategy(strategy);
JaxWsProxyFactoryBean factory = new JaxWsProxyFactoryBean();
factory.setAddress("http://localhost:8080/notExist/NotExistPort");
factory.getFeatures().add(ff);
factory.setServiceClass(Endpoint.class);
Endpoint proxy = factory.create(Endpoint.class);
assertEquals("Unexpected resposne", "cluster", proxy.echo("cluster"));
URL wsdlURL = new URL(baseURL.toExternalForm() + "/ClusetrService?wsdl");
QName qname = new QName("http://org.jboss.ws/jaxws/cxf/endpoint", "EndpointService");
Service service = Service.create(wsdlURL, qname);
Endpoint endpoint = service.getPort(Endpoint.class, ff);
((BindingProvider)endpoint).getRequestContext().put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY, "http://localhost:8080/notExist/NotExistPort");
assertEquals("Unexpected resposne", "cluster", endpoint.echo("cluster"));
}
示例7: 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(logIn());
jaxWsProxyFactoryBean.getOutInterceptors().add(logOut());
return (TicketAgent) jaxWsProxyFactoryBean.create();
}
示例8: HelloWorldClientImpl
import org.apache.cxf.jaxws.JaxWsProxyFactoryBean; //导入方法依赖的package包/类
public HelloWorldClientImpl() throws IOException {
// load the CXF properties file that contains the endpoint address
Properties cxfProperties = loadProperties("/cxf.properties");
/* create a Java proxy to call the Hello World service */
// create a JaxWsProxyFactoryBean
JaxWsProxyFactoryBean jaxWsProxyFactoryBean = new JaxWsProxyFactoryBean();
// set the Hello World service class
jaxWsProxyFactoryBean.setServiceClass(HelloWorldPortType.class);
// set the endpoint address
jaxWsProxyFactoryBean.setAddress(cxfProperties
.getProperty("helloworld.address"));
// create the Java proxy
this.helloWorldJaxWsProxy = (HelloWorldPortType) jaxWsProxyFactoryBean
.create();
}
示例9: shouldSendMessage
import org.apache.cxf.jaxws.JaxWsProxyFactoryBean; //导入方法依赖的package包/类
@Test
public void shouldSendMessage() {
ActiveMQConnectionFactory connectionFactory = new ActiveMQConnectionFactory();
connectionFactory.setBrokerURL("tcp://localhost:61616");
JMSConfiguration jmsConfig = new JMSConfiguration();
jmsConfig.setTargetDestination("cxf.queue");
jmsConfig.setConnectionFactory(connectionFactory);
JMSConfigFeature jmsFeature = new JMSConfigFeature();
jmsFeature.setJmsConfig(jmsConfig);
JaxWsProxyFactoryBean client = new JaxWsProxyFactoryBean();
client.setAddress("jms://");
client.getFeatures().add(jmsFeature);
//call service
OrderProcess orderProcess = client.create(OrderProcess.class);
Order order = new Order(1l, "przodownik");
String s = orderProcess.processOrder(order);
System.out.println(s);
order = new Order(2l, "ala");
s = orderProcess.processOrder(order);
System.out.println(s);
}
示例10: getService
import org.apache.cxf.jaxws.JaxWsProxyFactoryBean; //导入方法依赖的package包/类
public Object getService() {
try {
clientFactory = new JaxWsProxyFactoryBean();
clientFactory.setServiceClass(Class.forName("org.kuali.ole.service.OleUuidCheckWebService"));
} catch (ClassNotFoundException e) {
LOG.error("Failed to connect to soap service because failed to load interface class: ", e);
}
QName namespaceURI = new QName("http://service.select.ole.kuali.org/", "oleUuidCheckWebService");
clientFactory.setServiceName(namespaceURI);
String serviceURL = "";//ConfigContext.getCurrentContextConfig().getProperty("uuidCheckServiceURL");
LOG.info(" uuidCheckServiceURL --------> " + serviceURL);
clientFactory.setAddress(serviceURL);
Object service = clientFactory.create();
LOG.info("<<<< service >>>> " + service);
return service;
}
示例11: setUp
import org.apache.cxf.jaxws.JaxWsProxyFactoryBean; //导入方法依赖的package包/类
@Before
public void setUp() {
JaxWsProxyFactoryBean factory = new JaxWsProxyFactoryBean();
Map<String, Object> props = new HashMap<String, Object>();
List<String> list = new ArrayList<String>();
list.add(People.class.getName());
list.add(Boy.class.getName());
list.add(Person.class.getName());
props.put("writeXsiType", Boolean.TRUE);
props.put("overrideTypesList", list);
factory.getServiceFactory().setProperties(props);
factory.setDataBinding(new AegisDatabinding());
factory.setAddress(ENDPOINT);
personService = (PersonServiceWithBaseClass)factory.create(PersonServiceWithBaseClass.class);
// bind the outbound interceptor to the client proxy
Client proxy = ClientProxy.getClient(personService);
proxy.getOutInterceptors().add(new SystemTokenClientInterceptor(SYSTEM_NIC, SYSTEM_NIC_PW));
}
示例12: 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);
}
示例13: sendRequest
import org.apache.cxf.jaxws.JaxWsProxyFactoryBean; //导入方法依赖的package包/类
public void sendRequest() throws Exception {
JaxWsProxyFactoryBean factory = new JaxWsProxyFactoryBean();
factory.setServiceClass(HelloWorld.class);
factory.setAddress("http://localhost:8181/cxf/HelloWorldSecurity");
HelloWorld client = (HelloWorld) factory.create();
Map<String, Object> outProps = new HashMap<String, Object>();
outProps.put("action", "UsernameToken");
//add a CustomerSecurityInterceptor for client side to init wss4j staff
//retrieve and set user/password, users can easily add this interceptor
//through spring configuration also
ClientProxy.getClient(client).getOutInterceptors().add(new CustomerSecurityInterceptor());
ClientProxy.getClient(client).getOutInterceptors().add(new WSS4JOutInterceptor());
String ret = client.sayHi("ffang");
System.out.println(ret);
}
示例14: testDecoupledEndpoint
import org.apache.cxf.jaxws.JaxWsProxyFactoryBean; //导入方法依赖的package包/类
@Test
public void testDecoupledEndpoint() throws Exception {
JaxWsServerFactoryBean serverFactory = new JaxWsServerFactoryBean();
serverFactory.setAddress("zmq:(tcp://*:" + ZMQ_TEST_PORT + "?socketOperation=bind&socketType=pull)");
serverFactory.setServiceClass(HelloWorldImpl.class);
Server server = serverFactory.create();
JaxWsProxyFactoryBean clientFactory = new JaxWsProxyFactoryBean();
clientFactory.setServiceClass(HelloWorldPortType.class);
clientFactory.setAddress("zmq:(tcp://localhost:" + ZMQ_TEST_PORT + "?socketOperation=connect&socketType=push)");
clientFactory.getFeatures().add(new WSAddressingFeature());
HelloWorldPortType client = (HelloWorldPortType) clientFactory.create();
ClientProxy.getClient(client).getEndpoint()
.getEndpointInfo()
.setProperty("org.apache.cxf.ws.addressing.replyto",
"zmq:(tcp://127.0.0.1:5555?socketOperation=connect&socketType=push)");
String reply = client.sayHello("Claude");
server.stop();
assertEquals("Hello Claude", reply);
}
示例15: connect
import org.apache.cxf.jaxws.JaxWsProxyFactoryBean; //导入方法依赖的package包/类
public void connect(TokenHolder tokenHolder) {
for (Class<? extends PublicInterface> interface1 : interfaces) {
JaxWsProxyFactoryBean cpfb = new JaxWsProxyFactoryBean();
cpfb.setServiceClass(interface1);
cpfb.setAddress(address + "/" + interface1.getSimpleName());
Map<String, Object> properties = new HashMap<String, Object>();
properties.put("mtom-enabled", Boolean.TRUE);
cpfb.setProperties(properties);
PublicInterface serviceInterface = (PublicInterface) cpfb.create();
client = ClientProxy.getClient(serviceInterface);
HTTPConduit http = (HTTPConduit) client.getConduit();
http.getClient().setConnectionTimeout(360000);
http.getClient().setAllowChunking(false);
http.getClient().setReceiveTimeout(320000);
if (!useSoapHeaderSessions) {
((BindingProvider) serviceInterface).getRequestContext().put(BindingProvider.SESSION_MAINTAIN_PROPERTY, Boolean.TRUE);
}
add(interface1.getName(), serviceInterface);
}
tokenHolder.registerTokenChangeListener(this);
notifyOfConnect();
}