@Test( groups = {"wso2.brs"}, enabled = true) public void testAddProduct() throws XMLStreamException, AxisFault { ClientConnectionUtil.waitForPort(9763); ServiceClient serviceClient = new ServiceClient(); Options options = new Options(); options.setTo(new EndpointReference("http://localhost:9763/services/ShoppingService")); options.setAction("urn:addProduct"); serviceClient.setOptions(options); serviceClient.sendRobust(createAddProductPayload()); }
private void sendRobust(String trpUrl, String symbol) throws AxisFault { ServiceClient sender; Options options; sender = new ServiceClient(); options = new Options(); options.setProperty(org.apache.axis2.transport.http.HTTPConstants.CHUNKED, Boolean.FALSE); options.setAction("urn:placeOrder"); if (trpUrl != null && !"null".equals(trpUrl)) { options.setProperty(Constants.Configuration.TRANSPORT_URL, trpUrl); } sender.setOptions(options); sender.sendRobust(getPlaceOrderPayload(symbol)); }