Skip to content

Instantly share code, notes, and snippets.

@zubairov
Created February 3, 2011 14:34
Show Gist options
  • Save zubairov/809533 to your computer and use it in GitHub Desktop.
Save zubairov/809533 to your computer and use it in GitHub Desktop.
package org.talend.test;
import javax.xml.soap.SOAPMessage;
import javax.xml.ws.Provider;
import org.apache.cxf.frontend.ServerFactoryBean;
import org.sopera.talend.provider.QueuedProvider;
import org.sopera.talend.provider.QueuedRequest;
public class ProviderTest {
/**
* @param args
* @throws Exception
*/
public static void main(String[] args) throws Exception {
ServerFactoryBean sf = new ServerFactoryBean();
QueuedProvider<SOAPMessage> handler = new QueuedProvider<SOAPMessage>();
sf.setServiceClass(Provider.class);
sf.setServiceBean(handler);
sf.setAddress("http://localhost:8080/MyService");
sf.create();
QueuedRequest<SOAPMessage> next = null;
int i = 0;
while (i < 10) {
next = handler.next();
SOAPMessage message = next.getMessage();
System.err.println("Got it!!! " + ++i);
next.release();
}
System.exit(0);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment