SmartSoapUI
8 years agoOccasional Contributor
The type com.eviware.soapui.config.WsdlRequestConfig cannot be resolved.
Following is my code and I'm getting a compilation error(The type com.eviware.soapui.config.WsdlRequestConfig cannot be resolved. It is indirectly referenced from required .class files) at
WsdlSubmit submit = (WsdlSubmit) request.submit( new WsdlSubmitContext(request), false );
Could any one help me by resolving the error.
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.testng.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 SoapUI_Request2 { 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); } }