0

Here is my code public class xmlreq extends TestBase {

@Test
public void buildRequest()
{
    logger.info("starting");
    RestAssured.baseURI="http://webservices.oorsprong.org/websamples.countryinfo";
    
    httpRequest=    RestAssured.given();
    String b= "<soapenv:Envelope xmlns:soapenv=\"http://schemas.xmlsoap.org/soap/envelope/\" xmlns:web=\"http://www.oorsprong.org/websamples.countryinfo\">\r\n" + 
            "   <soapenv:Header/>\r\n" + 
            "   <soapenv:Body>\r\n" + 
            "      <web:CapitalCity>\r\n" + 
            "         <web:sCountryISOCode>IND</web:sCountryISOCode>\r\n" + 
            "      </web:CapitalCity>\r\n" + 
            "   </soapenv:Body>\r\n" + 
            "</soapenv:Envelope>";
    httpRequest.header("Content-Type","text/xml");
    httpRequest.body(b);
    
    
    
    response=   httpRequest.request(Method.POST, "/CountryInfoService.wso?wsdl");
    
    Assert.assertTrue(response.getBody().asString()!=null);
    System.out.println(response.getBody().asString());
    
}

@Test(enabled=true)
public void validate()
{
    String a = response.getBody().asString();
    Assert.assertTrue(a.contains("New Delhi"));     
}

}

  • Please add the error message you are getting. – Mate Mrše Oct 9 at 12:25
  • No its working fine but curious can rest assured API handle wsdl – Sumeet Oct 10 at 14:07