Skip to content

Instantly share code, notes, and snippets.

View ggdio's full-sized avatar
:octocat:
Learning something new

Guilherme Dio ggdio

:octocat:
Learning something new
View GitHub Profile
@ggdio
ggdio / MyServiceWs.java
Last active December 23, 2015 09:09
Webservice implementation based on 'br.com.ggdio.gists.ws.service.structure.MyService'
package br.com.ggdio.gists.ws.service;
import javax.jws.WebService;
import br.com.ggdio.gists.ws.service.structure.MyService;
/**
* Webservice implementation based on the Service - {@link MyService}
* @author Guilherme Dio
*/
@ggdio
ggdio / MyService.java
Created September 18, 2013 17:06
Service Interface
package br.com.gists.ws.service.structure;
import javax.jws.WebMethod;
import javax.jws.WebService;
/**
* Webservice structure definition
* @author Guilherme Dio
*/
@WebService
@ggdio
ggdio / MyServiceClient.java
Last active December 23, 2015 09:09
A client class to MyServiceWs.java
package br.com.ggdio.gists.ws.service.client;
import java.net.MalformedURLException;
import java.net.URL;
import javax.xml.namespace.QName;
import javax.xml.ws.Service;
import javax.xml.ws.WebServiceClient;
import br.com.ggdio.ws.service.structure.MyService;
@ggdio
ggdio / web.xml
Last active December 23, 2015 09:19
Jax-WS mapping for web.xml OBS: JAXWS-RT.jar is necessary on classpath
<web-app>
<listener>
<listener-class>
com.sun.xml.ws.transport.http.servlet.WSServletContextListener
</listener-class>
</listener>
<servlet>
<servlet-name>jaxws-servlet</servlet-name>
<servlet-class>com.sun.xml.ws.transport.http.servlet.WSServlet</servlet-class>
@ggdio
ggdio / web.xml
Last active December 24, 2015 02:49
Jersey servlet mapping
<web-app>
<servlet>
<servlet-name>jersey-servlet</servlet-name>
<servlet-class>com.sun.jersey.spi.container.servlet.ServletContainer</servlet-class>
<init-param>
<param-name>com.sun.jersey.config.property.packages</param-name>
<param-value>br.com.ggdio.estoque.rest</param-value>
</init-param>
<load-on-startup>1</load-on-startup>
</servlet>
@ggdio
ggdio / settings.xml
Created September 27, 2013 23:01
M2 Plugin settings.xml Place it inside: Linux: ~/.m2/ Windows: C:\Users\[PROFILE]\.m2\
<?xml version="1.0" encoding="UTF-8"?>
<!--
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at
@ggdio
ggdio / NAMESPACE CONVENTION
Last active December 24, 2015 04:09
Namespace Conventions
Pattern:
http://[mydomain]/[module]/[context]/[type]/[version]
Examples Below.
AUTHENTICATION-MODULE-DOMAIN
_User Domain Model:
@ggdio
ggdio / REST URL CONVENTION
Last active December 24, 2015 04:09
REST URL CONVENTION
Pattern:
LIST:
http://[domain]/[context]/[main-resource]/
IDENTIFY:
http://[domain]/[context]/[main-resource]/[identifier]
RESOURCE:
http://[domain]/[context]/[main-resource]/[identifier]/[sub-resource]
@ggdio
ggdio / DaoTestExample.java
Created September 30, 2013 16:08
Integration TEST for DAOs and SQLs - JUnit
//Imports
public class DaoTestExample {
//The class fields to be used
private Session session;
private MyDao dao;
//Before each test
@Before
public void before(){
@ggdio
ggdio / JBoss Deploy - Maven
Last active December 24, 2015 08:39
POM.xml configuration to auto-deploy war, using maven, to JBoss AS Run Command: jboss-as:deploy
<build>
<plugins>
<plugin>
<artifactId>maven-war-plugin</artifactId>
<version>2.1.1</version>
<configuration>
<!-- Java EE 6 doesnt require web.xml -->
<failOnMissingWebXml>false</failOnMissingWebXml>
</configuration>
</plugin>