This file contains 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 characters
package i.am.koman.wsclients; | |
import com.sun.jersey.api.client.Client; | |
import com.sun.jersey.api.client.ClientResponse; | |
import com.sun.jersey.api.client.WebResource; | |
import javax.ws.rs.core.MediaType; | |
public class Jersey_Client { | |
public static void main(String args[]) { |
This file contains 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 characters
package i.am.koman.wsclients; | |
import org.jboss.resteasy.client.ClientRequest; | |
import org.jboss.resteasy.client.ClientResponse; | |
import javax.ws.rs.core.MediaType; | |
public class RESTEasy_Client { | |
public static void main(String args[]) throws Exception { |
This file contains 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 characters
package i.am.koman.wsclients; | |
import org.apache.http.HttpResponse; | |
import org.apache.http.client.methods.HttpGet; | |
import org.apache.http.impl.client.DefaultHttpClient; | |
import java.io.BufferedReader; | |
import java.io.IOException; | |
import java.io.InputStreamReader; | |
public class ApacheHTTP_Client { |
This file contains 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 characters
final byte[] hashedPassword = PasswordUtil.getHashedPassword(password, user.getSalt()); | |
String encodedPassword = Base64.encodeBase64String(hashedPassword); | |
if (user.getPassword() == null || !user.getPassword().equals(encodedPassword)) { | |
throw new SmartDevicesSalesSecurityException("Incorrect password entered"); | |
} |
This file contains 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 characters
package za.co.fnb.cbs.plexus.business.service.ejb.adeptra; | |
import javax.ejb.Stateless; | |
import za.co.fnb.cbs.plexus.business.service.ws.adeptra.artefacts.Adeptra; | |
import za.co.fnb.cbs.plexus.business.service.ws.adeptra.artefacts.Adeptra_Service; | |
import za.co.fnb.cbs.plexus.business.service.ws.adeptra.artefacts.CaseData; | |
import za.co.fnb.cbs.plexus.business.service.ws.adeptra.artefacts.CaseResponseType; | |
import za.co.fnb.cbs.plexus.business.service.ws.adeptra.artefacts.CaseResponseType1; | |
/** |
This file contains 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 characters
If the above "wsdlLocation" doesn't work add "classpath:" before wsdl/adpetra.wsdl. | |
The above plugin creates the atrefact as below | |
@WebServiceClient(name = "Adeptra", | |
wsdlLocation = "wsdl/adeptra.wsdl", | |
targetNamespace = "http://www.adeptra.net/Adeptra/") | |
public class Adeptra_Service extends Service { | |
public final static URL WSDL_LOCATION; |
This file contains 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 characters
<system-properties> | |
<property name="adeptra.endpoint.url" value="https://gateway1-cqa.adeptra.eu/fnb/fnbZAFRMOriginations"/> | |
</system-properties> |
This file contains 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 characters
https://developer.jboss.org/blogs/donnamishelly/2011/04/29/jboss-java-ee-api-specs-project |
This file contains 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 characters
Add the log4j.properties file to the src/test/resources folder |
This file contains 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 characters
List<JacksonJsonProvider> providers = new ArrayList<>(); | |
JacksonJsonProvider provider = new JacksonJsonProvider(); | |
provider.addUntouchable(Response.class); | |
providers.add(provider); | |
WebClient client = WebClient.create("http://<hostname>/path/to/service", providers); | |
client.type(MediaType.APPLICATION_JSON).accept(MediaType.APPLICATION_JSON); | |
client.post(myCustomDTO); | |
//MyCustomDTO will be an object (basic POJO) that can be JSON'd as required | |
<--Maven Dependencies--> |
OlderNewer