Skip to content

Instantly share code, notes, and snippets.

:octocat:

K. Siva Prasad Reddy sivaprasadreddy

:octocat:
Block or report user

Report or block sivaprasadreddy

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@sivaprasadreddy
sivaprasadreddy / AuthenticationTokenInjectHandler.java
Created Apr 30, 2012
JAX-WS WSI Authentication using UserName & Password Security Headers
View AuthenticationTokenInjectHandler.java
import java.io.IOException;
import java.util.Set;
import javax.xml.namespace.QName;
import javax.xml.soap.SOAPConstants;
import javax.xml.soap.SOAPElement;
import javax.xml.soap.SOAPEnvelope;
import javax.xml.soap.SOAPException;
import javax.xml.soap.SOAPFactory;
import javax.xml.soap.SOAPHeader;
@sivaprasadreddy
sivaprasadreddy / RESTEasy-Maven-POM.xml
Created Jun 6, 2012
RESTEasy Maven Configuration
View RESTEasy-Maven-POM.xml
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.sivalabs</groupId>
<artifactId>resteasy-demo</artifactId>
<version>0.1</version>
<packaging>war</packaging>
View RESTEasy-Web.xml
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd"
id="WebApp_ID" version="3.0">
<listener>
<listener-class>org.jboss.resteasy.plugins.server.servlet.ResteasyBootstrap</listener-class>
</listener>
View RESTEasy-Sample-Code.java
package com.sivalabs.resteasydemo;
import java.util.Date;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlRootElement;
@XmlRootElement
@XmlAccessorType(XmlAccessType.FIELD)
View UserResource-JUnit-TestCase.java
package com.sivalabs.resteasydemo;
import java.util.List;
import org.jboss.resteasy.client.ClientRequest;
import org.jboss.resteasy.client.ClientResponse;
import org.jboss.resteasy.util.GenericType;
import org.junit.Assert;
import org.junit.Test;
View RESTEasy+Spring-Web.xml
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd"
id="WebApp_ID" version="3.0">
<listener>
<listener-class>org.jboss.resteasy.plugins.server.servlet.ResteasyBootstrap</listener-class>
</listener>
@sivaprasadreddy
sivaprasadreddy / XMLUtils.java
Created Jun 7, 2012
XMLUtils to print XML Document Object as String
View XMLUtils.java
import java.io.StringReader;
import java.io.StringWriter;
import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;
import javax.xml.transform.OutputKeys;
import javax.xml.transform.Transformer;
import javax.xml.transform.TransformerFactory;
import javax.xml.transform.dom.DOMSource;
import javax.xml.transform.stream.StreamResult;
View RESTEasy+Spring-Sample-Code.java
package com.sivalabs.resteasydemo;
import java.util.List;
import org.springframework.stereotype.Service;
import com.sivalabs.resteasydemo.MockUserTable;
@Service
public class UserService
{
@sivaprasadreddy
sivaprasadreddy / RESTEasy+Spring-pom.xml
Created Jun 12, 2012
RESTEasy+Spring Maven Configuration
View RESTEasy+Spring-pom.xml
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.sivalabs</groupId>
<artifactId>resteasy-demo</artifactId>
<version>0.1</version>
<packaging>war</packaging>
View RESTEasyDemo-Custom-Exceptions.java
/**
* ResourceNotFoundException.java
*/
package com.sivalabs.resteasydemo;
public class ResourceNotFoundException extends RuntimeException
{
private static final long serialVersionUID = 1L;
public ResourceNotFoundException(String msg)
You can’t perform that action at this time.