Skip to content

Instantly share code, notes, and snippets.

@jrgleason
Created February 19, 2014 16:10
Show Gist options
  • Save jrgleason/9095243 to your computer and use it in GitHub Desktop.
Save jrgleason/9095243 to your computer and use it in GitHub Desktop.
package com.gleason.banks.resource;
import java.net.Authenticator;
import java.net.MalformedURLException;
import java.net.PasswordAuthentication;
import java.rmi.RemoteException;
import javax.ws.rs.GET;
import javax.ws.rs.Path;
import javax.xml.rpc.ServiceException;
import com.gleason.stdadd.Ping;
import com.gleason.stdadd.PingResponse;
import com.gleason.stdadd.PostalAddress;
import com.gleason.stdadd.StandardizeAddress_Service;
import com.gleason.stdadd.StandardizePostalAddress;
import com.gleason.stdadd.StandardizePostalAddressResponse;
import com.gleason.stdadd.StdAddFault;
import com.gleason.stdadd.StdAddPortType;
import com.gleason.stdadd.SystemInfo;
import com.gleason.banks.util.SSLUtilities;
@Path("/test")
public class TestResource {
static {
SSLUtilities.trustAllHostnames();
SSLUtilities.trustAllHttpsCertificates();
Authenticator.setDefault(new Authenticator() {
@Override
protected PasswordAuthentication getPasswordAuthentication() {
return new PasswordAuthentication(
"",
"".toCharArray());
}
});
}
@GET
public String getMessage() throws MalformedURLException, RemoteException, ServiceException, StdAddFault{
StandardizeAddress_Service service = new StandardizeAddress_Service();
StdAddPortType standardizeAdd = service.getStdAddPort();
StandardizePostalAddress address = new StandardizePostalAddress();
PostalAddress pa = new PostalAddress();
pa.setAddressLine1("450 Fourth");
pa.setCity("Columbus");
pa.setRegion("OH");
SystemInfo si = new SystemInfo();
si.setFunctionMode("Y");
address.setPostalAddress(pa);
address.setSystemInfo(si);
Ping p = new Ping();
StandardizePostalAddressResponse res = standardizeAdd.standardizePostalAddress(address);
return "Hello world";
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment