Forum Discussion

Murat_ÇOLAK's avatar
16 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  );

1 Reply

  • omatzura's avatar
    omatzura
    Super Contributor
    Hi!

    you will have to manipulate the generated requestContent using standard string-related methods in java.

    regards,

    /Ole
    eviware.com