Search in sources :

Example 51 with SampleClientResult

use of org.apache.synapse.samples.framework.SampleClientResult in project wso2-synapse by wso2.

the class Sample0 method testSynapseAsHTTPProxy.

public void testSynapseAsHTTPProxy() {
    String addUrl = "http://localhost:9000/services/SimpleStockQuoteService";
    String prxUrl = "http://localhost:8280/";
    log.info("Running test: Using Synapse as a HTTP Proxy");
    SampleClientResult result = getStockQuoteClient().requestStandardQuote(addUrl, null, prxUrl, "IBM", null);
    assertResponseReceived(result);
}
Also used : SampleClientResult(org.apache.synapse.samples.framework.SampleClientResult)

Example 52 with SampleClientResult

use of org.apache.synapse.samples.framework.SampleClientResult in project wso2-synapse by wso2.

the class Sample1 method testDumbClientMode.

public void testDumbClientMode() {
    String trpUrl = "http://localhost:8280/services/StockQuote";
    StockQuoteSampleClient client = getStockQuoteClient();
    log.info("Running test: Dumb Client mode");
    SampleClientResult result = client.requestStandardQuote(null, trpUrl, null, "IBM", null);
    assertResponseReceived(result);
}
Also used : SampleClientResult(org.apache.synapse.samples.framework.SampleClientResult) StockQuoteSampleClient(org.apache.synapse.samples.framework.clients.StockQuoteSampleClient)

Example 53 with SampleClientResult

use of org.apache.synapse.samples.framework.SampleClientResult in project wso2-synapse by wso2.

the class Sample50 method testRestToPox.

public void testRestToPox() {
    String trpUrl = "http://localhost:8280/services/StockQuote";
    log.info("Running test: HTTP REST request ");
    StockQuoteSampleClient client = getStockQuoteClient();
    SampleClientResult result = client.requestRestQuote(null, trpUrl, null, "IBM");
    assertResponseReceived(result);
}
Also used : SampleClientResult(org.apache.synapse.samples.framework.SampleClientResult) StockQuoteSampleClient(org.apache.synapse.samples.framework.clients.StockQuoteSampleClient)

Example 54 with SampleClientResult

use of org.apache.synapse.samples.framework.SampleClientResult in project wso2-synapse by wso2.

the class Sample52 method testSessionLessLB.

public void testSessionLessLB() {
    String addUrl = "http://localhost:8280/services/LBService1";
    StockQuoteSampleClient client = getStockQuoteClient();
    log.info("Running test: Session-less load balancing between 3 endpoints");
    SampleClientResult result = client.sessionlessClient(addUrl, null, 100);
    assertResponseReceived(result);
}
Also used : SampleClientResult(org.apache.synapse.samples.framework.SampleClientResult) StockQuoteSampleClient(org.apache.synapse.samples.framework.clients.StockQuoteSampleClient)

Example 55 with SampleClientResult

use of org.apache.synapse.samples.framework.SampleClientResult in project wso2-synapse by wso2.

the class Sample10 method testDynamicEndPoints.

public void testDynamicEndPoints() {
    String trpUrl = "http://localhost:8280/";
    StockQuoteSampleClient client = getStockQuoteClient();
    log.info("Running test: Dynamic EndPoints with Registry");
    SampleClientResult result = client.requestStandardQuote(null, trpUrl, null, "IBM", null);
    assertResponseReceived(result);
}
Also used : SampleClientResult(org.apache.synapse.samples.framework.SampleClientResult) StockQuoteSampleClient(org.apache.synapse.samples.framework.clients.StockQuoteSampleClient)

Aggregations

SampleClientResult (org.apache.synapse.samples.framework.SampleClientResult)64 StockQuoteSampleClient (org.apache.synapse.samples.framework.clients.StockQuoteSampleClient)45 OMElement (org.apache.axiom.om.OMElement)5 AxisFault (org.apache.axis2.AxisFault)5 QName (javax.xml.namespace.QName)4 File (java.io.File)2 FileOutputStream (java.io.FileOutputStream)2 DataHandler (javax.activation.DataHandler)2 FileDataSource (javax.activation.FileDataSource)2 SOAPEnvelope (org.apache.axiom.soap.SOAPEnvelope)2 EndpointReference (org.apache.axis2.addressing.EndpointReference)2 OperationClient (org.apache.axis2.client.OperationClient)2 Options (org.apache.axis2.client.Options)2 ServiceClient (org.apache.axis2.client.ServiceClient)2 ConfigurationContext (org.apache.axis2.context.ConfigurationContext)2 MessageContext (org.apache.axis2.context.MessageContext)2 MTOMSwASampleClient (org.apache.synapse.samples.framework.clients.MTOMSwASampleClient)2 BufferedOutputStream (java.io.BufferedOutputStream)1 InputStream (java.io.InputStream)1 Attachments (org.apache.axiom.attachments.Attachments)1