17 years ago
how to send value with java code
Hello everone,
I see there is a code Integrating soapUI on soap.org how can I add a value to the request
WsdlProject project = new WsdlProject();
// import amazon wsdl
WsdlInterface iface = project.importWsdl( "http://localhost:8082/soapui-tests/test1/TestService.wsdl", true )[0];
// get "GetPage" operation
WsdlOperation operation = (WsdlOperation) iface.getOperationByName( "GetPage" );
// 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(), false );
// wait for the response
Response response = submit.getResponse();
// print the response
String content = response.getContentAsString();
System.out.println( content );
assertNotNull( content );
assertTrue( content.indexOf( "404 Not Found" ) > 0 );
I see there is a code Integrating soapUI on soap.org how can I add a value to the request
WsdlProject project = new WsdlProject();
// import amazon wsdl
WsdlInterface iface = project.importWsdl( "http://localhost:8082/soapui-tests/test1/TestService.wsdl", true )[0];
// get "GetPage" operation
WsdlOperation operation = (WsdlOperation) iface.getOperationByName( "GetPage" );
// 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(), false );
// wait for the response
Response response = submit.getResponse();
// print the response
String content = response.getContentAsString();
System.out.println( content );
assertNotNull( content );
assertTrue( content.indexOf( "404 Not Found" ) > 0 );