Hi,
I finally got it to work .. Made some changes .. Here's the code
import java.io.IOException;
import com.eviware.soapui.impl.wsdl.WsdlProject;
import com.eviware.soapui.impl.wsdl.WsdlInterface;
import com.eviware.soapui.impl.WsdlInterfaceFactory;
import com.eviware.soapui.impl.wsdl.WsdlOperation;
import com.eviware.soapui.impl.wsdl.WsdlRequest;
import com.eviware.soapui.impl.wsdl.WsdlSubmit;
import com.eviware.soapui.impl.wsdl.WsdlSubmitContext;
import org.apache.xmlbeans.XmlException;
import org.junit.Assert;
import com.eviware.soapui.impl.wsdl.submit.transports.http.support.attachments.WsdlSinglePartHttpResponse;
import com.eviware.soapui.model.iface.Request.SubmitException;
import com.eviware.soapui.support.SoapUIException;
public class basic {
public static void main(String[] args) throws SubmitException, XmlException, IOException, SoapUIException{
// create new project
WsdlProject project = new WsdlProject();
// import service
WsdlInterface iface = WsdlInterfaceFactory.importWsdl( project, "
http://192.168.0.153:8080/axis2/services/Calculator?wsdl", true )[0];
// get "GetPage" operation
WsdlOperation operation = (WsdlOperation) iface.getOperationByName( "add" );
// create a new empty request for that operation
WsdlRequest request = operation.addNewRequest( "My request" );
// generate the request content from the schema
request.setRequestContent(operation.createRequest(true));
// submit the request
WsdlSubmit submit = (WsdlSubmit) request.submit( new WsdlSubmitContext(request), false );
// wait for the response
WsdlSinglePartHttpResponse response = (WsdlSinglePartHttpResponse) submit.getResponse();
// print the response
String content = response.getContentAsString();
System.out.println(content);
Assert.assertNotNull(content);
Assert.assertTrue(content.indexOf("404 Not Found") > 0);
}
}
My question is :- Now what if i want to send parameters along with the request .. (the add operation takes 2 numbers)
Help !!!!!!!!!!!!!
Thank you !!