Created
May 22, 2012 04:38
Revisions
-
djangofan revised this gist
May 22, 2012 . 1 changed file with 2 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -27,11 +27,11 @@ public static void main(String[] args) { "</soap12:Envelope>"; Map<String, String> authhdrs = new HashMap<String, String>(); authhdrs.put("SOAPAction", "Define"); //authhdrs.put("Content-Length", Integer.toString( myEnvelope.length() ) ); String xml = given().request().headers(authhdrs) .contentType("application/soap+xml; charset=UTF-8;").body( myEnvelope ) .when().post( "/DictService/DictService.asmx" ).andReturn().asString(); String prettyXML = with(xml).prettyPrint(); System.out.println( prettyXML ); -
djangofan revised this gist
May 22, 2012 . 1 changed file with 1 addition and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -11,6 +11,7 @@ public class SOAPDictionary { public static void main(String[] args) { // http://services.aonaware.com/DictService/DictService.asmx?op=Define // http://services.aonaware.com/DictService/DictService.asmx?wsdl baseURI = "http://services.aonaware.com"; port = 80; -
djangofan created this gist
May 22, 2012 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,38 @@ package test.ra; import static com.jayway.restassured.RestAssured.*; import static com.jayway.restassured.path.xml.XmlPath.*; import java.util.HashMap; import java.util.Map; public class SOAPDictionary { public static void main(String[] args) { // http://services.aonaware.com/DictService/DictService.asmx?op=Define baseURI = "http://services.aonaware.com"; port = 80; String word = "hand"; String myEnvelope = "<soap12:Envelope xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" " + "xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" xmlns:soap12=\"http://www.w3.org/2003/05/soap-envelope\">" + "<soap12:Body>" + "<Define xmlns=\"http://services.aonaware.com/webservices/\">" + "<word>" + word + "</word>" + "</Define>" + "</soap12:Body>" + "</soap12:Envelope>"; Map<String, String> authhdrs = new HashMap<String, String>(); authhdrs.put("SOAPAction", "authenticate"); //authhdrs.put("Content-Length", Integer.toString( myEnvelope.length() ) ); String xml = given().request().headers(authhdrs) .contentType("application/soap+xml; charset=UTF-8;").body( myEnvelope ) .when().post( "/DictService/DictService.asmx?op=Define" ).andReturn().asString(); String prettyXML = with(xml).prettyPrint(); System.out.println( prettyXML ); } }