package com.xyz.international.clients; import java.io.IOException; import org.apache.commons.httpclient.HttpClient; import org.apache.commons.httpclient.MultiThreadedHttpConnectionManager; import org.apache.commons.httpclient.methods.PostMethod; public class availabilityWebserviceClientNew { public static void main(String[] args) throws IOException { HttpClient client =null; PostMethod method =null; String url="http://59.162.33.102:9301/Avalability"; String response = ""; String request_str = "<AvailRequest> <Trip>ONE</Trip> <Origin>BOM</Origin> <Destination>JFK</Destination> <DepartDate>2014-02-15</DepartDate> <ReturnDate>2014-02-20</ReturnDate> <AdultPax>1</AdultPax> <ChildPax>0</ChildPax> <InfantPax>0</InfantPax> <Currency>INR</Currency> <PreferredClass>E</PreferredClass> <Eticket>true</Eticket> <Clientid>Given by Arzoo</Clientid> <Clientpassword>Given by Arzoo</Clientpassword> <Clienttype>ArzooINTLWS1.0</Clienttype> <PreferredAirline></PreferredAirline> </AvailRequest>"; MultiThreadedHttpConnectionManager connmngr=null; connmngr = new MultiThreadedHttpConnectionManager(); client = new HttpClient(connmngr); method = new PostMethod( url ); method.addParameter("xmlRequest",request_str); client.executeMethod( method ); response=method.getResponseBodyAsString(); System.out.println("response "+response); } }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)