Hi IWAB0489E Error when deploying Web service to Axis runtime
do we need any extra jar files to be added in
Tomcat or in the App
Below class is using some jars and for this class iam trying to create a webservice.
so that it will act as middle layer so that any one can access this method in the application so it will responce the GeoCode.
Can i use like this.Am i right to use like this any changes i have to make?
please help me on this.....
package com.deCarta.geoCode;
import com.telcontar.openls.xml.GeocodeRequest;
import com.telcontar.openls.xml.XLSMessage;
public class ReqGeoCode extends AbstractExample{
public String getGeoCode(String Countrycode,String Street,String BuildingNo,String Pincode) throws Exception{
try{
GeocodeRequest params = factory.createGeocodeRequest();
java.util.List addresses = params.getAddress();
addresses.add(newStructuredAddress(Countrycode,Street,BuildingNo,Pincode));
//System.out.println("------------------req");
XLSMessage msg = newXLSMessage(params, "GeocodeRequest");
//show what gets sent to server
marshaller.marshal( msg, System.out );
//post to http server
XLSMessage resp = (XLSMessage) dataSource.executeRequest(msg);
//System.out.println("------------------res");
//show what was returned from server
marshaller.marshal( resp, System.out );
Object obj=resp;
String response=obj.toString();
return response;
}finally{
super.close(); //release resources, in this case, the dataSource
}
}
}
for this method iam extending one class which has some methods as metioned below......
package com.deCarta.geoCode;
import javax.xml.bind.JAXBContext;
import javax.xml.bind.JAXBException;
import javax.xml.bind.Marshaller;
import com.telcontar.openls.client.DataSource;
import com.telcontar.openls.client.DataSourceFactory;
import com.telcontar.openls.client.OpenlsDataSourceFactory;
import com.telcontar.openls.xml.AbstractRequestParametersType;
import com.telcontar.openls.xml.Address;
import com.telcontar.openls.xml.Building;
import com.telcontar.openls.xml.ObjectFactory;
import com.telcontar.openls.xml.Request;
import com.telcontar.openls.xml.RequestHeader;
import com.telcontar.openls.xml.StreetAddressType;
import com.telcontar.openls.xml.StreetNameType;
import com.telcontar.openls.xml.XLSMessage;
/**
*
* @author ghendrey
*/
public abstract class AbstractExample {
protected DataSource dataSource;
protected ObjectFactory factory = new ObjectFactory();
protected Marshaller marshaller;
/** Creates a new instance of AbstractExample */
public AbstractExample() {
dataSource = newDataSource();
dataSource.setHeader(newHeader());
marshaller = newMarshaller();
}
private DataSource newDataSource(){
//these properties will configure the DataSource
java.util.Properties props = new java.util.Properties();
//allow the DataSource to be configured via System.properties
//default to HttpDataSource
String dataSourceClassname= System.getProperties().getProperty("com.telcontar.openls.properties.DataSourceClass", "com.telcontar.openls.client.HttpDataSource");
props.setProperty("com.telcontar.openls.properties.DataSourceClass", dataSourceClassname);
System.setProperty("http.proxyHost", "proxy.cognizant.com");
System.setProperty("http.proxyPort", "6050");
//get url from System.properties, default to localhost if not in System.properties
props.setProperty("url", System.getProperty("url","http://wsdds2.dz.decarta.com/openls/openls")); //fixme
DataSourceFactory dsFactory = new OpenlsDataSourceFactory(props);
//get a DataSource with the specified Properties
return dsFactory.newDataSource();
}
private Marshaller newMarshaller(){
try{
JAXBContext jc = JAXBContext.newInstance("com.telcontar.openls.xml");
marshaller = jc.createMarshaller();
marshaller.setProperty( Marshaller.JAXB_FORMATTED_OUTPUT, Boolean.TRUE );
return marshaller;
}catch(JAXBException jaxbe){
throw new RuntimeException(jaxbe.getMessage());
}
}
private RequestHeader newHeader(){
try{
RequestHeader header = factory.createRequestHeader();
//header.setConfiguration(System.getProperties().getProperty("serviceConfiguration", "blue-steel"));
header.setClientName(System.getProperties().getProperty("clientName","cognizant-vg")); //fixme
header.setClientPassword(System.getProperties().getProperty("clientPassword","hg77t4"));//fixme
header.setSessionID("999");
return header;
}catch(JAXBException jaxbe){
throw new RuntimeException(jaxbe.getMessage());
}
}
@SuppressWarnings("unchecked")
protected XLSMessage newXLSMessage(AbstractRequestParametersType params, String methodName){
try{
Request request = factory.createRequest();
request.setRequestParameters(params);
request.setMethodName(methodName);
request.setMaximumResponses(new java.math.BigInteger("25"));
request.setRequestID("10");
request.setVersion("1.0");
XLSMessage msg = factory.createXLSMessage();
msg.getBody().add(request);
msg.setVersion(new java.math.BigDecimal("1.0"));
msg.setLang("en");
msg.setHeader(newHeader());
return msg;
}catch(JAXBException jaxbe){
throw new RuntimeException(jaxbe.getMessage());
}
}
protected Address newStructuredAddress(String Countrycode,String Street,String BuildingNo,String Pincode) throws Exception{
Address address = factory.createAddress();
address.setCountryCode(Countrycode);
StreetAddressType streetAddress = factory.createStreetAddress();
address.setStreetAddress(streetAddress);
StreetNameType street = factory.createStreet();
streetAddress.setStreet(street);
street.setValue(Street);
Building building = factory.createBuilding();
building.setNumber(BuildingNo);
streetAddress.setStreetLocation(building);
address.setPostalCode(Pincode); //the zipcode of fictional "Stickville"
return address;
}
protected void close(){
dataSource.close();
}
}
all this work fine but when i was creating client by eclipse it was stopping at
[ November 12, 2008: Message edited by: prasanth duggirala ]