JBossWS SVN: r4378 - stack/native/branches/native-2.0/src/test/java/org/jboss/test/ws/jaxrpc/jbws434.
by jbossws-commits@lists.jboss.org
Author: richard_opalka
Date: 2007-08-15 11:20:34 -0400 (Wed, 15 Aug 2007)
New Revision: 4378
Modified:
stack/native/branches/native-2.0/src/test/java/org/jboss/test/ws/jaxrpc/jbws434/JBWS434TestCase.java
Log:
enabling test - it passes on all JBoss servers now
Modified: stack/native/branches/native-2.0/src/test/java/org/jboss/test/ws/jaxrpc/jbws434/JBWS434TestCase.java
===================================================================
--- stack/native/branches/native-2.0/src/test/java/org/jboss/test/ws/jaxrpc/jbws434/JBWS434TestCase.java 2007-08-15 14:58:17 UTC (rev 4377)
+++ stack/native/branches/native-2.0/src/test/java/org/jboss/test/ws/jaxrpc/jbws434/JBWS434TestCase.java 2007-08-15 15:20:34 UTC (rev 4378)
@@ -28,6 +28,7 @@
import javax.naming.InitialContext;
import javax.xml.rpc.Service;
import javax.xml.soap.SOAPElement;
+import javax.xml.soap.SOAPFactory;
import junit.framework.Test;
@@ -65,71 +66,68 @@
public void testWildCardArrayWithOtherNS() throws Exception
{
- System.out.println("FIXME [JBWS-1738]: Regression between jbossxb 1.0.0.GA and 1.0.0.GA-brew");
-// SOAPFactory factory = SOAPFactory.newInstance();
-//
-// SOAPElement el1 = factory.createElement("name", "ns1", "http://somens");
-// el1.setValue("Kermmit");
-// SOAPElement el2 = factory.createElement("product", "ns1", "http://somens");
-// el2.setValue("Ferrari");
-//
-// ArrayOfAny inObj = new ArrayOfAny(new SOAPElement[] { el1, el2 });
-// ArrayOfAny retObj = port.echo(inObj);
-//
-// assertNotNull(retObj);
-// assertNotNull(retObj._any);
-// assertEquals(inObj._any.length, retObj._any.length);
-//
-// for(int i = 0; i < inObj._any.length; ++i)
-// {
-// SOAPElement inE = inObj._any[i];
-// SOAPElement retE = retObj._any[i];
-// assertEquals(inE, retE);
-// }
+ SOAPFactory factory = SOAPFactory.newInstance();
+
+ SOAPElement el1 = factory.createElement("name", "ns1", "http://somens");
+ el1.setValue("Kermmit");
+ SOAPElement el2 = factory.createElement("product", "ns1", "http://somens");
+ el2.setValue("Ferrari");
+
+ ArrayOfAny inObj = new ArrayOfAny(new SOAPElement[] { el1, el2 });
+ ArrayOfAny retObj = port.echo(inObj);
+
+ assertNotNull(retObj);
+ assertNotNull(retObj._any);
+ assertEquals(inObj._any.length, retObj._any.length);
+
+ for(int i = 0; i < inObj._any.length; ++i)
+ {
+ SOAPElement inE = inObj._any[i];
+ SOAPElement retE = retObj._any[i];
+ assertEquals(inE, retE);
+ }
}
public void testWildCardArrayWithAnyNS() throws Exception
{
- System.out.println("FIXME [JBWS-1738]: Regression between jbossxb 1.0.0.GA and 1.0.0.GA-brew");
-// SOAPFactory factory = SOAPFactory.newInstance();
-//
-// SOAPElement el1 = factory.createElement("name", "ns1", "http://somens");
-// el1.setValue("Kermmit");
-// SOAPElement el2 = factory.createElement("product", "ns1", "http://somens");
-// el2.setValue("Ferrari");
-//
-// ArrayOfAny2 inObj = new ArrayOfAny2(new SOAPElement[] { el1, el2 });
-// ArrayOfAny2 retObj = port.echo2(inObj);
-//
-// assertNotNull(retObj);
-// assertNotNull(retObj._any);
-// assertEquals(inObj._any.length, retObj._any.length);
-//
-// for(int i = 0; i < inObj._any.length; ++i)
-// {
-// SOAPElement inE = inObj._any[i];
-// SOAPElement retE = retObj._any[i];
-// assertEquals(inE, retE);
-// }
+ SOAPFactory factory = SOAPFactory.newInstance();
+
+ SOAPElement el1 = factory.createElement("name", "ns1", "http://somens");
+ el1.setValue("Kermmit");
+ SOAPElement el2 = factory.createElement("product", "ns1", "http://somens");
+ el2.setValue("Ferrari");
+
+ ArrayOfAny2 inObj = new ArrayOfAny2(new SOAPElement[] { el1, el2 });
+ ArrayOfAny2 retObj = port.echo2(inObj);
+
+ assertNotNull(retObj);
+ assertNotNull(retObj._any);
+ assertEquals(inObj._any.length, retObj._any.length);
+
+ for(int i = 0; i < inObj._any.length; ++i)
+ {
+ SOAPElement inE = inObj._any[i];
+ SOAPElement retE = retObj._any[i];
+ assertEquals(inE, retE);
+ }
}
public void testWildCardArrayWithMaxOccurance() throws Exception
{
-// SOAPFactory factory = SOAPFactory.newInstance();
-//
-// SOAPElement el1 = factory.createElement("name", "ns1", "http://somens");
-// el1.setValue("Kermmit");
-//
-// TypeOfAny3 inObj = new TypeOfAny3(el1);
-// TypeOfAny3 retObj = port.echo3(inObj);
-//
-// assertNotNull(retObj);
-// assertNotNull(retObj._any);
-//
-// SOAPElement inE = inObj._any;
-// SOAPElement retE = retObj._any;
-// assertEquals(inE, retE);
+ SOAPFactory factory = SOAPFactory.newInstance();
+ SOAPElement el1 = factory.createElement("name", "ns1", "http://somens");
+ el1.setValue("Kermmit");
+
+ TypeOfAny3 inObj = new TypeOfAny3(el1);
+ TypeOfAny3 retObj = port.echo3(inObj);
+
+ assertNotNull(retObj);
+ assertNotNull(retObj._any);
+
+ SOAPElement inE = inObj._any;
+ SOAPElement retE = retObj._any;
+ assertEquals(inE, retE);
}
/**
@@ -138,21 +136,20 @@
*/
public void testWildCardContentsDeclared() throws Exception
{
- System.out.println("FIXME [JBWS-1738]: Regression between jbossxb 1.0.0.GA and 1.0.0.GA-brew");
-// SOAPFactory factory = SOAPFactory.newInstance();
-//
-// SOAPElement el1 = factory.createElement("knownWildcard", "ns1", "http://somens");
-// el1.setValue("Kermmit");
-//
-// TypeOfAny3 inObj = new TypeOfAny3(el1);
-// TypeOfAny3 retObj = port.echo3(inObj);
-//
-// assertNotNull(retObj);
-// assertNotNull(retObj._any);
-//
-// SOAPElement inE = inObj._any;
-// SOAPElement retE = retObj._any;
-// assertEquals(inE, retE);
+ SOAPFactory factory = SOAPFactory.newInstance();
+
+ SOAPElement el1 = factory.createElement("knownWildcard", "ns1", "http://somens");
+ el1.setValue("Kermmit");
+
+ TypeOfAny3 inObj = new TypeOfAny3(el1);
+ TypeOfAny3 retObj = port.echo3(inObj);
+
+ assertNotNull(retObj);
+ assertNotNull(retObj._any);
+
+ SOAPElement inE = inObj._any;
+ SOAPElement retE = retObj._any;
+ assertEquals(inE, retE);
}
private static void assertEquals(SOAPElement myE, SOAPElement otherE)
17 years, 4 months
JBossWS SVN: r4377 - in stack/native/branches/native-2.0/src: main/java/org/jboss/ws/tools/helpers and 4 other directories.
by jbossws-commits@lists.jboss.org
Author: darran.lofthouse(a)jboss.com
Date: 2007-08-15 10:58:17 -0400 (Wed, 15 Aug 2007)
New Revision: 4377
Added:
stack/native/branches/native-2.0/src/test/java/org/jboss/test/ws/tools/jbws1453/
stack/native/branches/native-2.0/src/test/java/org/jboss/test/ws/tools/jbws1453/JBWS1453TestCase.java
stack/native/branches/native-2.0/src/test/resources/tools/jbws1453/
stack/native/branches/native-2.0/src/test/resources/tools/jbws1453/A_Message.java
stack/native/branches/native-2.0/src/test/resources/tools/jbws1453/A_Person.java
stack/native/branches/native-2.0/src/test/resources/tools/jbws1453/Nick_Name.java
stack/native/branches/native-2.0/src/test/resources/tools/jbws1453/PhoneBook.wsdl
stack/native/branches/native-2.0/src/test/resources/tools/jbws1453/PhoneBook_PortType.java
stack/native/branches/native-2.0/src/test/resources/tools/jbws1453/Telephone_Number.java
stack/native/branches/native-2.0/src/test/resources/tools/jbws1453/jaxrpc-mapping.xml
stack/native/branches/native-2.0/src/test/resources/tools/jbws1453/wstools-config.xml
Modified:
stack/native/branches/native-2.0/src/main/java/org/jboss/ws/tools/WSDLToJava.java
stack/native/branches/native-2.0/src/main/java/org/jboss/ws/tools/XSDTypeToJava.java
stack/native/branches/native-2.0/src/main/java/org/jboss/ws/tools/helpers/MappingFileGeneratorHelper.java
Log:
[JBWS-1453] - WSDL To Java - Invalid name for generated class if complex type name contains a period.
Modified: stack/native/branches/native-2.0/src/main/java/org/jboss/ws/tools/WSDLToJava.java
===================================================================
--- stack/native/branches/native-2.0/src/main/java/org/jboss/ws/tools/WSDLToJava.java 2007-08-15 14:47:09 UTC (rev 4376)
+++ stack/native/branches/native-2.0/src/main/java/org/jboss/ws/tools/WSDLToJava.java 2007-08-15 14:58:17 UTC (rev 4377)
@@ -626,6 +626,7 @@
if (className.charAt(0) == '>')
className = className.substring(1);
+ className = ToolsUtils.convertInvalidCharacters(className);
className = utils.firstLetterUpperCase(className);
className = seiPkgName + "." + className + arraySuffix;
@@ -666,9 +667,9 @@
//Check if the portType name conflicts with a service name
if (wsdl.getService(seiName) != null)
seiName += "_PortType";
-
+
seiName = JavaUtils.capitalize(seiName);
-
+
return seiName;
}
@@ -748,6 +749,7 @@
if (className.charAt(0) == '>')
className = className.substring(1);
+ className = ToolsUtils.convertInvalidCharacters(className);
className = utils.firstLetterUpperCase(className);
return seiPkgName + "." + className + arraySuffix;
}
Modified: stack/native/branches/native-2.0/src/main/java/org/jboss/ws/tools/XSDTypeToJava.java
===================================================================
--- stack/native/branches/native-2.0/src/main/java/org/jboss/ws/tools/XSDTypeToJava.java 2007-08-15 14:47:09 UTC (rev 4376)
+++ stack/native/branches/native-2.0/src/main/java/org/jboss/ws/tools/XSDTypeToJava.java 2007-08-15 14:58:17 UTC (rev 4377)
@@ -131,6 +131,8 @@
if (typeMapping == null)
throw new WSException("TypeMapping has not been set");
XSTypeDefinition baseType = type.getBaseType();
+ // Ensure the characters in the name are valid
+ fname = ToolsUtils.convertInvalidCharacters(fname);
//Ensure that the first character is uppercase
fname = utils.firstLetterUpperCase(fname);
List vars = new ArrayList();
@@ -535,13 +537,9 @@
// Handle xsd:any elements
if (xsterm instanceof XSWildcard)
{
- XSWildcard xsw = (XSWildcard)xsterm;
- // if (xsw.getConstraintType() == XSWildcard.NSCONSTRAINT_ANY)
- // {
VAR v = new VAR("_any", "javax.xml.soap.SOAPElement", arrayType);
vars.add(v);
return vars;
- // }
}
// Handle xsd:group
@@ -636,7 +634,7 @@
if (xstypename != null && xstypedef instanceof XSComplexTypeDefinition)
{
- this.fname = utils.firstLetterUpperCase(xstypename);
+ this.fname = ToolsUtils.convertInvalidCharacters(utils.firstLetterUpperCase(xstypename));
if (!generatedFiles.contains(this.fname))
{
generatedFiles.add(this.fname);
@@ -681,7 +679,7 @@
String nsuri = typename.getNamespaceURI();
if (!nsuri.equals(Constants.NS_SCHEMA_XSD))
qualifiedClassName = pkgname + ".";
- String className = wsdlUtils.firstLetterUpperCase(typename.getLocalPart());
+ String className = wsdlUtils.firstLetterUpperCase(ToolsUtils.convertInvalidCharacters(typename.getLocalPart()));
qualifiedClassName += className;
}
else if (qn != null)
Modified: stack/native/branches/native-2.0/src/main/java/org/jboss/ws/tools/helpers/MappingFileGeneratorHelper.java
===================================================================
--- stack/native/branches/native-2.0/src/main/java/org/jboss/ws/tools/helpers/MappingFileGeneratorHelper.java 2007-08-15 14:47:09 UTC (rev 4376)
+++ stack/native/branches/native-2.0/src/main/java/org/jboss/ws/tools/helpers/MappingFileGeneratorHelper.java 2007-08-15 14:58:17 UTC (rev 4377)
@@ -878,6 +878,7 @@
String className = xmlType.getLocalPart();
if (className.charAt(0) == '>')
className = className.substring(1);
+ className = ToolsUtils.convertInvalidCharacters(className);
jtype = packageName + "." + utils.firstLetterUpperCase(className);
}
else
Added: stack/native/branches/native-2.0/src/test/java/org/jboss/test/ws/tools/jbws1453/JBWS1453TestCase.java
===================================================================
--- stack/native/branches/native-2.0/src/test/java/org/jboss/test/ws/tools/jbws1453/JBWS1453TestCase.java (rev 0)
+++ stack/native/branches/native-2.0/src/test/java/org/jboss/test/ws/tools/jbws1453/JBWS1453TestCase.java 2007-08-15 14:58:17 UTC (rev 4377)
@@ -0,0 +1,105 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2007, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.test.ws.tools.jbws1453;
+
+import java.io.File;
+import java.io.FilenameFilter;
+
+import org.jboss.test.ws.tools.fixture.JBossSourceComparator;
+import org.jboss.test.ws.tools.validation.JaxrpcMappingValidator;
+import org.jboss.ws.tools.WSTools;
+import org.jboss.wsf.test.JBossWSTest;
+
+/**
+ * Test case for http://jira.jboss.com/jira/browse/JBWS-1453
+ *
+ * WSDL To Java - Invalid name for generated class
+ * if complex type name contains a period.
+ *
+ * @author darran.lofthouse(a)jboss.com
+ * @since 15 August 2007
+ */
+public class JBWS1453TestCase extends JBossWSTest
+{
+ /**
+ * Test generation of the SEI.
+ *
+ * @throws Exception
+ */
+ public void testGenerate() throws Exception
+ {
+ String resourceDir = "resources/tools/jbws1453";
+ String toolsDir = "tools/jbws1453";
+ String[] args = new String[] { "-dest", toolsDir, "-config", resourceDir + "/wstools-config.xml" };
+ new WSTools().generate(args);
+
+ File resourceDirFile = new File(resourceDir);
+ String[] expectedFiles = resourceDirFile.list(new FilenameFilter() {
+ public boolean accept(File dir, String name)
+ {
+ return name.endsWith(".java");
+ }
+ });
+
+ for (int i = 0; i < expectedFiles.length; i++)
+ {
+ String currentFile = expectedFiles[i];
+
+ try
+ {
+ compareSource(resourceDir + "/" + currentFile, toolsDir + "/org/jboss/test/ws/jbws1453/" + currentFile);
+ }
+ catch (Exception e)
+ {
+ throw new Exception("Validation of '" + currentFile + "' failed.", e);
+ }
+ }
+
+ File packageDir = new File(toolsDir + "/org/jboss/test/ws/jbws1453");
+ String[] generatedFiles = packageDir.list();
+ for (int i = 0; i < generatedFiles.length; i++)
+ {
+ String currentFile = generatedFiles[i];
+
+ boolean matched = "PhoneBookService.java".equals(currentFile);
+
+ for (int j = 0; j < expectedFiles.length && (matched == false); j++)
+ matched = currentFile.equals(expectedFiles[j]);
+
+ assertTrue("File '" + currentFile + "' was not expected to be generated", matched);
+ }
+
+ JaxrpcMappingValidator mappingValidator = new JaxrpcMappingValidator();
+ mappingValidator.validate(resourceDir + "/jaxrpc-mapping.xml", toolsDir + "/jaxrpc-mapping.xml");
+
+ }
+
+ private static void compareSource(final String expectedName, final String generatedName) throws Exception
+ {
+ File expected = new File(expectedName);
+ File generated = new File(generatedName);
+
+ JBossSourceComparator sc = new JBossSourceComparator(expected, generated);
+ sc.validate();
+ sc.validateImports();
+ }
+}
Property changes on: stack/native/branches/native-2.0/src/test/java/org/jboss/test/ws/tools/jbws1453/JBWS1453TestCase.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: stack/native/branches/native-2.0/src/test/resources/tools/jbws1453/A_Message.java
===================================================================
--- stack/native/branches/native-2.0/src/test/resources/tools/jbws1453/A_Message.java (rev 0)
+++ stack/native/branches/native-2.0/src/test/resources/tools/jbws1453/A_Message.java 2007-08-15 14:58:17 UTC (rev 4377)
@@ -0,0 +1,27 @@
+/*
+ * JBossWS WS-Tools Generated Source
+ *
+ * Generation Date: Wed Aug 15 15:16:31 BST 2007
+ *
+ * This generated source code represents a derivative work of the input to
+ * the generator that produced it. Consult the input for the copyright and
+ * terms of use that apply to this source code.
+ */
+
+package org.jboss.test.ws.jbws1453;
+
+
+public class A_Message
+{
+
+protected java.lang.String message;
+public A_Message(){}
+
+public A_Message(java.lang.String message){
+this.message=message;
+}
+public java.lang.String getMessage() { return message ;}
+
+public void setMessage(java.lang.String message){ this.message=message; }
+
+}
Property changes on: stack/native/branches/native-2.0/src/test/resources/tools/jbws1453/A_Message.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: stack/native/branches/native-2.0/src/test/resources/tools/jbws1453/A_Person.java
===================================================================
--- stack/native/branches/native-2.0/src/test/resources/tools/jbws1453/A_Person.java (rev 0)
+++ stack/native/branches/native-2.0/src/test/resources/tools/jbws1453/A_Person.java 2007-08-15 14:58:17 UTC (rev 4377)
@@ -0,0 +1,34 @@
+/*
+ * JBossWS WS-Tools Generated Source
+ *
+ * Generation Date: Wed Aug 15 15:16:31 BST 2007
+ *
+ * This generated source code represents a derivative work of the input to
+ * the generator that produced it. Consult the input for the copyright and
+ * terms of use that apply to this source code.
+ */
+
+package org.jboss.test.ws.jbws1453;
+
+
+public class A_Person
+{
+
+protected java.lang.String surname;
+
+protected org.jboss.test.ws.jbws1453.Nick_Name nickName;
+public A_Person(){}
+
+public A_Person(java.lang.String surname, org.jboss.test.ws.jbws1453.Nick_Name nickName){
+this.surname=surname;
+this.nickName=nickName;
+}
+public java.lang.String getSurname() { return surname ;}
+
+public void setSurname(java.lang.String surname){ this.surname=surname; }
+
+public org.jboss.test.ws.jbws1453.Nick_Name getNickName() { return nickName ;}
+
+public void setNickName(org.jboss.test.ws.jbws1453.Nick_Name nickName){ this.nickName=nickName; }
+
+}
Property changes on: stack/native/branches/native-2.0/src/test/resources/tools/jbws1453/A_Person.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: stack/native/branches/native-2.0/src/test/resources/tools/jbws1453/Nick_Name.java
===================================================================
--- stack/native/branches/native-2.0/src/test/resources/tools/jbws1453/Nick_Name.java (rev 0)
+++ stack/native/branches/native-2.0/src/test/resources/tools/jbws1453/Nick_Name.java 2007-08-15 14:58:17 UTC (rev 4377)
@@ -0,0 +1,27 @@
+/*
+ * JBossWS WS-Tools Generated Source
+ *
+ * Generation Date: Wed Aug 15 15:16:31 BST 2007
+ *
+ * This generated source code represents a derivative work of the input to
+ * the generator that produced it. Consult the input for the copyright and
+ * terms of use that apply to this source code.
+ */
+
+package org.jboss.test.ws.jbws1453;
+
+
+public class Nick_Name
+{
+
+protected java.lang.String name;
+public Nick_Name(){}
+
+public Nick_Name(java.lang.String name){
+this.name=name;
+}
+public java.lang.String getName() { return name ;}
+
+public void setName(java.lang.String name){ this.name=name; }
+
+}
Property changes on: stack/native/branches/native-2.0/src/test/resources/tools/jbws1453/Nick_Name.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: stack/native/branches/native-2.0/src/test/resources/tools/jbws1453/PhoneBook.wsdl
===================================================================
--- stack/native/branches/native-2.0/src/test/resources/tools/jbws1453/PhoneBook.wsdl (rev 0)
+++ stack/native/branches/native-2.0/src/test/resources/tools/jbws1453/PhoneBook.wsdl 2007-08-15 14:58:17 UTC (rev 4377)
@@ -0,0 +1,78 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<definitions name='PhoneBook' targetNamespace='http://test.jboss.org/ws/jbws1453'
+ xmlns='http://schemas.xmlsoap.org/wsdl/'
+ xmlns:ns1='http://test.jboss.org/ws/jbws1453/types'
+ xmlns:soap='http://schemas.xmlsoap.org/wsdl/soap/'
+ xmlns:tns='http://test.jboss.org/ws/jbws1453'
+ xmlns:xsd='http://www.w3.org/2001/XMLSchema'>
+
+ <types>
+ <schema targetNamespace='http://test.jboss.org/ws/jbws1453/types'
+ xmlns='http://www.w3.org/2001/XMLSchema'
+ xmlns:soap11-enc='http://schemas.xmlsoap.org/soap/encoding/'
+ xmlns:tns='http://test.jboss.org/ws/jbws1453/types'
+ xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'>
+
+ <complexType name='A.Person'>
+ <sequence>
+ <element name='surname' nillable='true' type='string'/>
+ <element name='nickName' nillable='true' type='tns:Nick.Name'/>
+ </sequence>
+ </complexType>
+
+ <complexType name='Nick.Name'>
+ <sequence>
+ <element name='name' nillable='true' type='string'/>
+ </sequence>
+ </complexType>
+
+ <complexType name='A.Message'>
+ <sequence>
+ <element name='message' nillable='true' type='string'/>
+ </sequence>
+ </complexType>
+
+ <complexType name='Telephone.Number'>
+ <sequence>
+ <element name='number' nillable='true' type='string'/>
+ <element name='message' nillable='true' type='tns:A.Message'/>
+ </sequence>
+ </complexType>
+
+ <element name='lookup' type='tns:A.Person'/>
+ <element name='lookupResponse' type='tns:Telephone.Number'/>
+
+ </schema>
+ </types>
+
+ <message name='PhoneBook_lookup'>
+ <part element='ns1:lookup' name='parameters'/>
+ </message>
+ <message name='PhoneBook_lookupResponse'>
+ <part element='ns1:lookupResponse' name='result'/>
+ </message>
+
+ <portType name='PhoneBook'>
+ <operation name='lookup'>
+ <input message='tns:PhoneBook_lookup'/>
+ <output message='tns:PhoneBook_lookupResponse'/>
+ </operation>
+ </portType>
+ <binding name='PhoneBookBinding' type='tns:PhoneBook'>
+ <soap:binding style='document' transport='http://schemas.xmlsoap.org/soap/http'/>
+ <operation name='lookup'>
+ <soap:operation soapAction=''/>
+ <input>
+ <soap:body use='literal'/>
+ </input>
+ <output>
+ <soap:body use='literal'/>
+ </output>
+ </operation>
+ </binding>
+ <service name='PhoneBook'>
+ <port binding='tns:PhoneBookBinding' name='PhoneBookPort'>
+ <soap:address location='REPLACE_WITH_ACTUAL_URL'/>
+ </port>
+ </service>
+</definitions>
Property changes on: stack/native/branches/native-2.0/src/test/resources/tools/jbws1453/PhoneBook.wsdl
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: stack/native/branches/native-2.0/src/test/resources/tools/jbws1453/PhoneBook_PortType.java
===================================================================
--- stack/native/branches/native-2.0/src/test/resources/tools/jbws1453/PhoneBook_PortType.java (rev 0)
+++ stack/native/branches/native-2.0/src/test/resources/tools/jbws1453/PhoneBook_PortType.java 2007-08-15 14:58:17 UTC (rev 4377)
@@ -0,0 +1,15 @@
+/*
+ * JBossWS WS-Tools Generated Source
+ *
+ * Generation Date: Wed Aug 15 15:16:31 BST 2007
+ *
+ * This generated source code represents a derivative work of the input to
+ * the generator that produced it. Consult the input for the copyright and
+ * terms of use that apply to this source code.
+ */
+package org.jboss.test.ws.jbws1453;
+public interface PhoneBook_PortType extends java.rmi.Remote
+{
+
+ public org.jboss.test.ws.jbws1453.Telephone_Number lookup(org.jboss.test.ws.jbws1453.A_Person lookup) throws java.rmi.RemoteException;
+}
Property changes on: stack/native/branches/native-2.0/src/test/resources/tools/jbws1453/PhoneBook_PortType.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: stack/native/branches/native-2.0/src/test/resources/tools/jbws1453/Telephone_Number.java
===================================================================
--- stack/native/branches/native-2.0/src/test/resources/tools/jbws1453/Telephone_Number.java (rev 0)
+++ stack/native/branches/native-2.0/src/test/resources/tools/jbws1453/Telephone_Number.java 2007-08-15 14:58:17 UTC (rev 4377)
@@ -0,0 +1,34 @@
+/*
+ * JBossWS WS-Tools Generated Source
+ *
+ * Generation Date: Wed Aug 15 15:16:31 BST 2007
+ *
+ * This generated source code represents a derivative work of the input to
+ * the generator that produced it. Consult the input for the copyright and
+ * terms of use that apply to this source code.
+ */
+
+package org.jboss.test.ws.jbws1453;
+
+
+public class Telephone_Number
+{
+
+protected java.lang.String number;
+
+protected org.jboss.test.ws.jbws1453.A_Message message;
+public Telephone_Number(){}
+
+public Telephone_Number(java.lang.String number, org.jboss.test.ws.jbws1453.A_Message message){
+this.number=number;
+this.message=message;
+}
+public java.lang.String getNumber() { return number ;}
+
+public void setNumber(java.lang.String number){ this.number=number; }
+
+public org.jboss.test.ws.jbws1453.A_Message getMessage() { return message ;}
+
+public void setMessage(org.jboss.test.ws.jbws1453.A_Message message){ this.message=message; }
+
+}
Property changes on: stack/native/branches/native-2.0/src/test/resources/tools/jbws1453/Telephone_Number.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: stack/native/branches/native-2.0/src/test/resources/tools/jbws1453/jaxrpc-mapping.xml
===================================================================
--- stack/native/branches/native-2.0/src/test/resources/tools/jbws1453/jaxrpc-mapping.xml (rev 0)
+++ stack/native/branches/native-2.0/src/test/resources/tools/jbws1453/jaxrpc-mapping.xml 2007-08-15 14:58:17 UTC (rev 4377)
@@ -0,0 +1,85 @@
+<?xml version='1.0' encoding='UTF-8'?><java-wsdl-mapping version='1.1' xmlns='http://java.sun.com/xml/ns/j2ee' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xsi:schemaLocation='http://java.sun.com/xml/ns/j2ee http://www.ibm.com/webservices/xsd/j2ee_jaxrpc_mapping_1_1.xsd'>
+ <package-mapping>
+ <package-type>org.jboss.test.ws.jbws1453</package-type>
+ <namespaceURI>http://test.jboss.org/ws/jbws1453/types</namespaceURI>
+ </package-mapping>
+ <package-mapping>
+ <package-type>org.jboss.test.ws.jbws1453</package-type>
+ <namespaceURI>http://test.jboss.org/ws/jbws1453</namespaceURI>
+ </package-mapping>
+ <java-xml-type-mapping>
+ <java-type>org.jboss.test.ws.jbws1453.A_Person</java-type>
+ <root-type-qname xmlns:typeNS='http://test.jboss.org/ws/jbws1453/types'>typeNS:A.Person</root-type-qname>
+ <qname-scope>complexType</qname-scope>
+ <variable-mapping>
+ <java-variable-name>surname</java-variable-name>
+ <xml-element-name>surname</xml-element-name>
+ </variable-mapping>
+ <variable-mapping>
+ <java-variable-name>nickName</java-variable-name>
+ <xml-element-name>nickName</xml-element-name>
+ </variable-mapping>
+ </java-xml-type-mapping>
+ <java-xml-type-mapping>
+ <java-type>org.jboss.test.ws.jbws1453.Nick_Name</java-type>
+ <root-type-qname xmlns:typeNS='http://test.jboss.org/ws/jbws1453/types'>typeNS:Nick.Name</root-type-qname>
+ <qname-scope>complexType</qname-scope>
+ <variable-mapping>
+ <java-variable-name>name</java-variable-name>
+ <xml-element-name>name</xml-element-name>
+ </variable-mapping>
+ </java-xml-type-mapping>
+ <java-xml-type-mapping>
+ <java-type>org.jboss.test.ws.jbws1453.Telephone_Number</java-type>
+ <root-type-qname xmlns:typeNS='http://test.jboss.org/ws/jbws1453/types'>typeNS:Telephone.Number</root-type-qname>
+ <qname-scope>complexType</qname-scope>
+ <variable-mapping>
+ <java-variable-name>number</java-variable-name>
+ <xml-element-name>number</xml-element-name>
+ </variable-mapping>
+ <variable-mapping>
+ <java-variable-name>message</java-variable-name>
+ <xml-element-name>message</xml-element-name>
+ </variable-mapping>
+ </java-xml-type-mapping>
+ <java-xml-type-mapping>
+ <java-type>org.jboss.test.ws.jbws1453.A_Message</java-type>
+ <root-type-qname xmlns:typeNS='http://test.jboss.org/ws/jbws1453/types'>typeNS:A.Message</root-type-qname>
+ <qname-scope>complexType</qname-scope>
+ <variable-mapping>
+ <java-variable-name>message</java-variable-name>
+ <xml-element-name>message</xml-element-name>
+ </variable-mapping>
+ </java-xml-type-mapping>
+ <service-interface-mapping>
+ <service-interface>org.jboss.test.ws.jbws1453.PhoneBook_Service</service-interface>
+ <wsdl-service-name xmlns:serviceNS='http://test.jboss.org/ws/jbws1453'>serviceNS:PhoneBook</wsdl-service-name>
+ <port-mapping>
+ <port-name>PhoneBookPort</port-name>
+ <java-port-name>PhoneBookPort</java-port-name>
+ </port-mapping>
+ </service-interface-mapping>
+ <service-endpoint-interface-mapping>
+ <service-endpoint-interface>org.jboss.test.ws.jbws1453.PhoneBook_PortType</service-endpoint-interface>
+ <wsdl-port-type xmlns:portTypeNS='http://test.jboss.org/ws/jbws1453'>portTypeNS:PhoneBook</wsdl-port-type>
+ <wsdl-binding xmlns:bindingNS='http://test.jboss.org/ws/jbws1453'>bindingNS:PhoneBookBinding</wsdl-binding>
+ <service-endpoint-method-mapping>
+ <java-method-name>lookup</java-method-name>
+ <wsdl-operation>lookup</wsdl-operation>
+ <method-param-parts-mapping>
+ <param-position>0</param-position>
+ <param-type>org.jboss.test.ws.jbws1453.A_Person</param-type>
+ <wsdl-message-mapping>
+ <wsdl-message xmlns:wsdlMsgNS='http://test.jboss.org/ws/jbws1453'>wsdlMsgNS:PhoneBook_lookup</wsdl-message>
+ <wsdl-message-part-name>parameters</wsdl-message-part-name>
+ <parameter-mode>IN</parameter-mode>
+ </wsdl-message-mapping>
+ </method-param-parts-mapping>
+ <wsdl-return-value-mapping>
+ <method-return-value>org.jboss.test.ws.jbws1453.Telephone_Number</method-return-value>
+ <wsdl-message xmlns:wsdlMsgNS='http://test.jboss.org/ws/jbws1453'>wsdlMsgNS:PhoneBook_lookupResponse</wsdl-message>
+ <wsdl-message-part-name>result</wsdl-message-part-name>
+ </wsdl-return-value-mapping>
+ </service-endpoint-method-mapping>
+ </service-endpoint-interface-mapping>
+</java-wsdl-mapping>
\ No newline at end of file
Property changes on: stack/native/branches/native-2.0/src/test/resources/tools/jbws1453/jaxrpc-mapping.xml
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: stack/native/branches/native-2.0/src/test/resources/tools/jbws1453/wstools-config.xml
===================================================================
--- stack/native/branches/native-2.0/src/test/resources/tools/jbws1453/wstools-config.xml (rev 0)
+++ stack/native/branches/native-2.0/src/test/resources/tools/jbws1453/wstools-config.xml 2007-08-15 14:58:17 UTC (rev 4377)
@@ -0,0 +1,5 @@
+<configuration>
+ <wsdl-java location="resources/tools/jbws1453/PhoneBook.wsdl" parameter-style="bare">
+ <mapping file="jaxrpc-mapping.xml"/>
+ </wsdl-java>
+</configuration>
Property changes on: stack/native/branches/native-2.0/src/test/resources/tools/jbws1453/wstools-config.xml
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
17 years, 4 months
JBossWS SVN: r4376 - stack/native/trunk/ant-import-tests.
by jbossws-commits@lists.jboss.org
Author: mageshbk(a)jboss.com
Date: 2007-08-15 10:47:09 -0400 (Wed, 15 Aug 2007)
New Revision: 4376
Modified:
stack/native/trunk/ant-import-tests/build-samples-jaxws.xml
Log:
[JBWS-1766] UsernameToken ignores BindingProvider.USERNAME_PROPERTY - added TestCase - Merged from branches\native-2.0
Modified: stack/native/trunk/ant-import-tests/build-samples-jaxws.xml
===================================================================
--- stack/native/trunk/ant-import-tests/build-samples-jaxws.xml 2007-08-15 14:45:18 UTC (rev 4375)
+++ stack/native/trunk/ant-import-tests/build-samples-jaxws.xml 2007-08-15 14:47:09 UTC (rev 4376)
@@ -162,6 +162,18 @@
<include name="wsse.truststore"/>
</webinf>
</war>
+
+ <!-- jaxws-samples-wssecurity-username -->
+ <war warfile="${tests.output.dir}/libs/jaxws-samples-wssecurity-username.war" webxml="${tests.output.dir}/resources/jaxws/samples/wssecurity/simple-username/WEB-INF/web.xml">
+ <classes dir="${tests.output.dir}/classes">
+ <include name="org/jboss/test/ws/jaxws/samples/wssecurity/UsernameEndpoint.class"/>
+ <include name="org/jboss/test/ws/jaxws/samples/wssecurity/UsernameBean.class"/>
+ </classes>
+ <webinf dir="${tests.output.dir}/resources/jaxws/samples/wssecurity/simple-username/WEB-INF">
+ <include name="jboss-web.xml"/>
+ <include name="jboss-wsse-server.xml"/>
+ </webinf>
+ </war>
<!-- jaxws-samples-wssecurityAnnotatedpolicy-encrypt -->
<war warfile="${tests.output.dir}/libs/jaxws-samples-wssecurityAnnotatedpolicy-encrypt.war" webxml="${tests.output.dir}/resources/jaxws/samples/wssecurityAnnotatedpolicy/WEB-INF/web.xml">
17 years, 4 months
JBossWS SVN: r4375 - in stack/native/trunk/src/test: resources/jaxws/samples/wssecurity and 4 other directories.
by jbossws-commits@lists.jboss.org
Author: mageshbk(a)jboss.com
Date: 2007-08-15 10:45:18 -0400 (Wed, 15 Aug 2007)
New Revision: 4375
Added:
stack/native/trunk/src/test/java/org/jboss/test/ws/jaxws/samples/wssecurity/SimpleUsernameTestCase.java
stack/native/trunk/src/test/java/org/jboss/test/ws/jaxws/samples/wssecurity/UsernameBean.java
stack/native/trunk/src/test/java/org/jboss/test/ws/jaxws/samples/wssecurity/UsernameEndpoint.java
stack/native/trunk/src/test/resources/jaxws/samples/wssecurity/simple-username/
stack/native/trunk/src/test/resources/jaxws/samples/wssecurity/simple-username/META-INF/
stack/native/trunk/src/test/resources/jaxws/samples/wssecurity/simple-username/META-INF/jboss-wsse-client.xml
stack/native/trunk/src/test/resources/jaxws/samples/wssecurity/simple-username/META-INF/wsdl/
stack/native/trunk/src/test/resources/jaxws/samples/wssecurity/simple-username/META-INF/wsdl/UsernameService.wsdl
stack/native/trunk/src/test/resources/jaxws/samples/wssecurity/simple-username/WEB-INF/
stack/native/trunk/src/test/resources/jaxws/samples/wssecurity/simple-username/WEB-INF/jboss-web.xml
stack/native/trunk/src/test/resources/jaxws/samples/wssecurity/simple-username/WEB-INF/jboss-wsse-server.xml
stack/native/trunk/src/test/resources/jaxws/samples/wssecurity/simple-username/WEB-INF/web.xml
Log:
[JBWS-1766] UsernameToken ignores BindingProvider.USERNAME_PROPERTY - added TestCase - Merged from branches\native-2.0
Added: stack/native/trunk/src/test/java/org/jboss/test/ws/jaxws/samples/wssecurity/SimpleUsernameTestCase.java
===================================================================
--- stack/native/trunk/src/test/java/org/jboss/test/ws/jaxws/samples/wssecurity/SimpleUsernameTestCase.java (rev 0)
+++ stack/native/trunk/src/test/java/org/jboss/test/ws/jaxws/samples/wssecurity/SimpleUsernameTestCase.java 2007-08-15 14:45:18 UTC (rev 4375)
@@ -0,0 +1,90 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.test.ws.jaxws.samples.wssecurity;
+
+import java.io.File;
+import java.net.URL;
+import java.util.Map;
+
+import javax.xml.namespace.QName;
+import javax.xml.ws.BindingProvider;
+import javax.xml.ws.Service;
+
+import junit.framework.Test;
+
+import org.jboss.ws.core.StubExt;
+import org.jboss.wsf.test.JBossWSTest;
+import org.jboss.wsf.test.JBossWSTestSetup;
+
+/**
+ * Test WS-Security for Username Token
+ *
+ * @author <a href="mailto:mageshbk@jboss.com">Magesh Kumar B</a>
+ * @since 15-Aug-2007
+ * @version $Revision$
+ */
+public class SimpleUsernameTestCase extends JBossWSTest
+{
+ /** Construct the test case with a given name
+ */
+
+ /** Deploy the test */
+ public static Test suite() throws Exception
+ {
+ return new JBossWSTestSetup(SimpleUsernameTestCase.class, "jaxws-samples-wssecurity-username.war");
+ }
+
+ /**
+ * Test SOAP Envelope for Username Token
+ */
+ public void testUsernameToken() throws Exception
+ {
+ UsernameEndpoint username = getPort();
+
+ String retObj = username.getUsernameToken();
+ assertTrue(retObj.indexOf("UsernameToken") > 0);
+ }
+
+ private UsernameEndpoint getPort() throws Exception
+ {
+ URL wsdlURL = new File("resources/jaxws/samples/wssecurity/simple-username/META-INF/wsdl/UsernameService.wsdl").toURL();
+ URL securityURL = new File("resources/jaxws/samples/wssecurity/simple-username/META-INF/jboss-wsse-client.xml").toURL();
+ QName serviceName = new QName("http://org.jboss.ws/samples/wssecurity", "UsernameService");
+
+ Service service = Service.create(wsdlURL, serviceName);
+
+ UsernameEndpoint port = (UsernameEndpoint)service.getPort(UsernameEndpoint.class);
+ ((StubExt)port).setSecurityConfig(securityURL.toExternalForm());
+ ((StubExt)port).setConfigName("Standard WSSecurity Client");
+
+ Map<String, Object> reqContext = ((BindingProvider)port).getRequestContext();
+ reqContext.put(BindingProvider.USERNAME_PROPERTY, "kermit");
+ reqContext.put(BindingProvider.PASSWORD_PROPERTY, "thefrog");
+ // If these below parameters are set it appears in the log, but the test fails as another
+ // request for the getHeader() returns empty <env:Header></env:Header>
+ //reqContext.put("javax.xml.rpc.security.auth.username", "kermit");
+ //reqContext.put("javax.xml.rpc.security.auth.password", "thefrog");
+ reqContext.put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY, "http://" + getServerHost() + ":8080/jaxws-samples-wssecurity-username");
+
+ return port;
+ }
+}
\ No newline at end of file
Property changes on: stack/native/trunk/src/test/java/org/jboss/test/ws/jaxws/samples/wssecurity/SimpleUsernameTestCase.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: stack/native/trunk/src/test/java/org/jboss/test/ws/jaxws/samples/wssecurity/UsernameBean.java
===================================================================
--- stack/native/trunk/src/test/java/org/jboss/test/ws/jaxws/samples/wssecurity/UsernameBean.java (rev 0)
+++ stack/native/trunk/src/test/java/org/jboss/test/ws/jaxws/samples/wssecurity/UsernameBean.java 2007-08-15 14:45:18 UTC (rev 4375)
@@ -0,0 +1,108 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.test.ws.jaxws.samples.wssecurity;
+
+import java.io.ByteArrayOutputStream;
+import java.io.IOException;
+import java.io.StringWriter;
+import java.util.Iterator;
+
+import javax.annotation.Resource;
+import javax.jws.WebMethod;
+import javax.jws.WebParam;
+import javax.jws.WebService;
+import javax.jws.soap.SOAPBinding;
+import javax.xml.namespace.QName;
+import javax.xml.soap.SOAPEnvelope;
+import javax.xml.soap.SOAPException;
+import javax.xml.soap.SOAPHeader;
+import javax.xml.soap.SOAPMessage;
+import javax.xml.soap.SOAPPart;
+import javax.xml.ws.handler.MessageContext;
+import javax.xml.ws.handler.soap.SOAPMessageContext;
+import javax.xml.ws.WebServiceContext;
+
+import org.jboss.logging.Logger;
+import org.jboss.ws.annotation.EndpointConfig;
+import org.jboss.ws.extensions.security.Constants;
+import org.jboss.ws.extensions.security.Util;
+import org.jboss.ws.core.soap.SOAPElementImpl;
+import org.jboss.ws.core.soap.SOAPEnvelopeImpl;
+import org.jboss.ws.core.soap.SOAPHeaderImpl;
+import org.w3c.dom.Element;
+
+/**
+ * The SEI implementation used by the SimpleUsernameTestCase
+ *
+ * @author <a href="mailto:mageshbk@jboss.com">Magesh Kumar B</a>
+ * @since 15-Aug-2007
+ * @version $Revision$
+ */
+@WebService(name = "UsernameEndpoint", serviceName = "UsernameService", targetNamespace = "http://org.jboss.ws/samples/wssecurity")
+@EndpointConfig(configName = "Standard WSSecurity Endpoint")
+@SOAPBinding(style = SOAPBinding.Style.RPC)
+public class UsernameBean
+{
+ private Logger log = Logger.getLogger(UsernameBean.class);
+
+ @Resource
+ WebServiceContext wsCtx;
+
+ @WebMethod
+ public String getUsernameToken()
+ {
+ String retObj = "";
+ try
+ {
+ MessageContext jaxwsContext = (MessageContext)wsCtx.getMessageContext();
+ SOAPMessage soapMessage = ((SOAPMessageContext)jaxwsContext).getMessage();
+ ByteArrayOutputStream stream = new ByteArrayOutputStream();
+ soapMessage.writeTo(stream);
+ log.info(stream.toString());
+
+ SOAPPart soapPart = soapMessage.getSOAPPart();
+ SOAPEnvelope soapEnvelope = soapPart.getEnvelope();
+ StringWriter strw = new StringWriter();
+ ((SOAPEnvelopeImpl)soapEnvelope).writeElement(strw);
+ log.info(strw.toString());
+
+ SOAPHeader soapHeader = soapEnvelope.getHeader();
+ strw = new StringWriter();
+ ((SOAPHeaderImpl)soapHeader).writeElement(strw);
+ retObj = strw.toString();
+ log.info(retObj);
+
+ QName secQName = new QName(Constants.WSSE_NS, "Security");
+ Element secHeaderElement = Util.findElement(soapHeader, secQName);
+ log.info(secHeaderElement);
+ }
+ catch (SOAPException se)
+ {
+ log.error(se.getMessage());
+ }
+ catch (IOException ioe)
+ {
+ log.error(ioe.getMessage());
+ }
+ return retObj;
+ }
+}
Property changes on: stack/native/trunk/src/test/java/org/jboss/test/ws/jaxws/samples/wssecurity/UsernameBean.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: stack/native/trunk/src/test/java/org/jboss/test/ws/jaxws/samples/wssecurity/UsernameEndpoint.java
===================================================================
--- stack/native/trunk/src/test/java/org/jboss/test/ws/jaxws/samples/wssecurity/UsernameEndpoint.java (rev 0)
+++ stack/native/trunk/src/test/java/org/jboss/test/ws/jaxws/samples/wssecurity/UsernameEndpoint.java 2007-08-15 14:45:18 UTC (rev 4375)
@@ -0,0 +1,31 @@
+
+package org.jboss.test.ws.jaxws.samples.wssecurity;
+
+import javax.jws.WebMethod;
+import javax.jws.WebParam;
+import javax.jws.WebResult;
+import javax.jws.WebService;
+import javax.jws.soap.SOAPBinding;
+import javax.jws.soap.SOAPBinding.Style;
+
+/**
+ * The SEI
+ *
+ * @author <a href="mailto:mageshbk@jboss.com">Magesh Kumar B</a>
+ * @since 15-Aug-2007
+ * @version $Revision$
+ */
+@WebService(name = "UsernameEndpoint", targetNamespace = "http://org.jboss.ws/samples/wssecurity")
+@SOAPBinding(style = SOAPBinding.Style.RPC)
+public interface UsernameEndpoint {
+
+ /**
+ *
+ * @return
+ * returns java.lang.String
+ */
+ @WebMethod
+ @WebResult(partName = "return")
+ public String getUsernameToken();
+
+}
Property changes on: stack/native/trunk/src/test/java/org/jboss/test/ws/jaxws/samples/wssecurity/UsernameEndpoint.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: stack/native/trunk/src/test/resources/jaxws/samples/wssecurity/simple-username/META-INF/jboss-wsse-client.xml
===================================================================
--- stack/native/trunk/src/test/resources/jaxws/samples/wssecurity/simple-username/META-INF/jboss-wsse-client.xml (rev 0)
+++ stack/native/trunk/src/test/resources/jaxws/samples/wssecurity/simple-username/META-INF/jboss-wsse-client.xml 2007-08-15 14:45:18 UTC (rev 4375)
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<jboss-ws-security xmlns="http://www.jboss.com/ws-security/config" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://www.jboss.com/ws-security/config http://www.jboss.com/ws-security/schema/jboss-ws-security_1_0.xsd">
+ <config>
+ <username/>
+ </config>
+</jboss-ws-security>
\ No newline at end of file
Property changes on: stack/native/trunk/src/test/resources/jaxws/samples/wssecurity/simple-username/META-INF/jboss-wsse-client.xml
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: stack/native/trunk/src/test/resources/jaxws/samples/wssecurity/simple-username/META-INF/wsdl/UsernameService.wsdl
===================================================================
--- stack/native/trunk/src/test/resources/jaxws/samples/wssecurity/simple-username/META-INF/wsdl/UsernameService.wsdl (rev 0)
+++ stack/native/trunk/src/test/resources/jaxws/samples/wssecurity/simple-username/META-INF/wsdl/UsernameService.wsdl 2007-08-15 14:45:18 UTC (rev 4375)
@@ -0,0 +1,30 @@
+<definitions name='UsernameService' targetNamespace='http://org.jboss.ws/samples/wssecurity' xmlns='http://schemas.xmlsoap.org/wsdl/' xmlns:soap='http://schemas.xmlsoap.org/wsdl/soap/' xmlns:tns='http://org.jboss.ws/samples/wssecurity' xmlns:xsd='http://www.w3.org/2001/XMLSchema'>
+ <types/>
+ <message name='UsernameEndpoint_getUsernameToken'></message>
+ <message name='UsernameEndpoint_getUsernameTokenResponse'>
+ <part name='return' type='xsd:string'/>
+ </message>
+ <portType name='UsernameEndpoint'>
+ <operation name='getUsernameToken'>
+ <input message='tns:UsernameEndpoint_getUsernameToken'/>
+ <output message='tns:UsernameEndpoint_getUsernameTokenResponse'/>
+ </operation>
+ </portType>
+ <binding name='UsernameEndpointBinding' type='tns:UsernameEndpoint'>
+ <soap:binding style='rpc' transport='http://schemas.xmlsoap.org/soap/http'/>
+ <operation name='getUsernameToken'>
+ <soap:operation soapAction=''/>
+ <input>
+ <soap:body namespace='http://org.jboss.ws/samples/wssecurity' use='literal'/>
+ </input>
+ <output>
+ <soap:body namespace='http://org.jboss.ws/samples/wssecurity' use='literal'/>
+ </output>
+ </operation>
+ </binding>
+ <service name='UsernameService'>
+ <port binding='tns:UsernameEndpointBinding' name='UsernameEndpointPort'>
+ <soap:address location='REPLACE_WITH_ACTUAL_URL'/>
+ </port>
+ </service>
+</definitions>
\ No newline at end of file
Property changes on: stack/native/trunk/src/test/resources/jaxws/samples/wssecurity/simple-username/META-INF/wsdl/UsernameService.wsdl
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: stack/native/trunk/src/test/resources/jaxws/samples/wssecurity/simple-username/WEB-INF/jboss-web.xml
===================================================================
--- stack/native/trunk/src/test/resources/jaxws/samples/wssecurity/simple-username/WEB-INF/jboss-web.xml (rev 0)
+++ stack/native/trunk/src/test/resources/jaxws/samples/wssecurity/simple-username/WEB-INF/jboss-web.xml 2007-08-15 14:45:18 UTC (rev 4375)
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<jboss-web>
+ <security-domain>java:/jaas/JBossWS</security-domain>
+</jboss-web>
\ No newline at end of file
Property changes on: stack/native/trunk/src/test/resources/jaxws/samples/wssecurity/simple-username/WEB-INF/jboss-web.xml
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: stack/native/trunk/src/test/resources/jaxws/samples/wssecurity/simple-username/WEB-INF/jboss-wsse-server.xml
===================================================================
--- stack/native/trunk/src/test/resources/jaxws/samples/wssecurity/simple-username/WEB-INF/jboss-wsse-server.xml (rev 0)
+++ stack/native/trunk/src/test/resources/jaxws/samples/wssecurity/simple-username/WEB-INF/jboss-wsse-server.xml 2007-08-15 14:45:18 UTC (rev 4375)
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<jboss-ws-security xmlns="http://www.jboss.com/ws-security/config" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://www.jboss.com/ws-security/config http://www.jboss.com/ws-security/schema/jboss-ws-security_1_0.xsd">
+</jboss-ws-security>
\ No newline at end of file
Property changes on: stack/native/trunk/src/test/resources/jaxws/samples/wssecurity/simple-username/WEB-INF/jboss-wsse-server.xml
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: stack/native/trunk/src/test/resources/jaxws/samples/wssecurity/simple-username/WEB-INF/web.xml
===================================================================
--- stack/native/trunk/src/test/resources/jaxws/samples/wssecurity/simple-username/WEB-INF/web.xml (rev 0)
+++ stack/native/trunk/src/test/resources/jaxws/samples/wssecurity/simple-username/WEB-INF/web.xml 2007-08-15 14:45:18 UTC (rev 4375)
@@ -0,0 +1,39 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<web-app xmlns="http://java.sun.com/xml/ns/j2ee"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"
+ version="2.4">
+
+ <servlet>
+ <servlet-name>UsernameService</servlet-name>
+ <servlet-class>org.jboss.test.ws.jaxws.samples.wssecurity.UsernameBean</servlet-class>
+ </servlet>
+ <servlet-mapping>
+ <servlet-name>UsernameService</servlet-name>
+ <url-pattern>/*</url-pattern>
+ </servlet-mapping>
+
+ <security-constraint>
+ <web-resource-collection>
+ <web-resource-name>UsernameService</web-resource-name>
+ <url-pattern>/*</url-pattern>
+ <http-method>GET</http-method>
+ <http-method>POST</http-method>
+ </web-resource-collection>
+ <auth-constraint>
+ <role-name>friend</role-name>
+ </auth-constraint>
+ </security-constraint>
+
+ <login-config>
+ <auth-method>BASIC</auth-method>
+ <realm-name>JBossWS</realm-name>
+ </login-config>
+
+ <security-role>
+ <role-name>friend</role-name>
+ </security-role>
+
+</web-app>
+
Property changes on: stack/native/trunk/src/test/resources/jaxws/samples/wssecurity/simple-username/WEB-INF/web.xml
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
17 years, 4 months
JBossWS SVN: r4374 - stack/native/branches/native-2.0/ant-import-tests.
by jbossws-commits@lists.jboss.org
Author: mageshbk(a)jboss.com
Date: 2007-08-15 10:11:38 -0400 (Wed, 15 Aug 2007)
New Revision: 4374
Modified:
stack/native/branches/native-2.0/ant-import-tests/build-samples-jaxws.xml
Log:
[JBWS-1766] UsernameToken ignores BindingProvider.USERNAME_PROPERTY - added TestCase
Modified: stack/native/branches/native-2.0/ant-import-tests/build-samples-jaxws.xml
===================================================================
--- stack/native/branches/native-2.0/ant-import-tests/build-samples-jaxws.xml 2007-08-15 14:10:27 UTC (rev 4373)
+++ stack/native/branches/native-2.0/ant-import-tests/build-samples-jaxws.xml 2007-08-15 14:11:38 UTC (rev 4374)
@@ -162,6 +162,18 @@
<include name="wsse.truststore"/>
</webinf>
</war>
+
+ <!-- jaxws-samples-wssecurity-username -->
+ <war warfile="${tests.output.dir}/libs/jaxws-samples-wssecurity-username.war" webxml="${tests.output.dir}/resources/jaxws/samples/wssecurity/simple-username/WEB-INF/web.xml">
+ <classes dir="${tests.output.dir}/classes">
+ <include name="org/jboss/test/ws/jaxws/samples/wssecurity/UsernameEndpoint.class"/>
+ <include name="org/jboss/test/ws/jaxws/samples/wssecurity/UsernameBean.class"/>
+ </classes>
+ <webinf dir="${tests.output.dir}/resources/jaxws/samples/wssecurity/simple-username/WEB-INF">
+ <include name="jboss-web.xml"/>
+ <include name="jboss-wsse-server.xml"/>
+ </webinf>
+ </war>
<!-- jaxws-samples-wssecurityAnnotatedpolicy-encrypt -->
<war warfile="${tests.output.dir}/libs/jaxws-samples-wssecurityAnnotatedpolicy-encrypt.war" webxml="${tests.output.dir}/resources/jaxws/samples/wssecurityAnnotatedpolicy/WEB-INF/web.xml">
17 years, 4 months
JBossWS SVN: r4373 - in stack/native/branches/native-2.0/src/test: resources/jaxws/samples/wssecurity and 4 other directories.
by jbossws-commits@lists.jboss.org
Author: mageshbk(a)jboss.com
Date: 2007-08-15 10:10:27 -0400 (Wed, 15 Aug 2007)
New Revision: 4373
Added:
stack/native/branches/native-2.0/src/test/java/org/jboss/test/ws/jaxws/samples/wssecurity/SimpleUsernameTestCase.java
stack/native/branches/native-2.0/src/test/java/org/jboss/test/ws/jaxws/samples/wssecurity/UsernameBean.java
stack/native/branches/native-2.0/src/test/java/org/jboss/test/ws/jaxws/samples/wssecurity/UsernameEndpoint.java
stack/native/branches/native-2.0/src/test/resources/jaxws/samples/wssecurity/simple-username/
stack/native/branches/native-2.0/src/test/resources/jaxws/samples/wssecurity/simple-username/META-INF/
stack/native/branches/native-2.0/src/test/resources/jaxws/samples/wssecurity/simple-username/META-INF/jboss-wsse-client.xml
stack/native/branches/native-2.0/src/test/resources/jaxws/samples/wssecurity/simple-username/META-INF/wsdl/
stack/native/branches/native-2.0/src/test/resources/jaxws/samples/wssecurity/simple-username/META-INF/wsdl/UsernameService.wsdl
stack/native/branches/native-2.0/src/test/resources/jaxws/samples/wssecurity/simple-username/WEB-INF/
stack/native/branches/native-2.0/src/test/resources/jaxws/samples/wssecurity/simple-username/WEB-INF/jboss-web.xml
stack/native/branches/native-2.0/src/test/resources/jaxws/samples/wssecurity/simple-username/WEB-INF/jboss-wsse-server.xml
stack/native/branches/native-2.0/src/test/resources/jaxws/samples/wssecurity/simple-username/WEB-INF/web.xml
Log:
[JBWS-1766] UsernameToken ignores BindingProvider.USERNAME_PROPERTY - added TestCase
Added: stack/native/branches/native-2.0/src/test/java/org/jboss/test/ws/jaxws/samples/wssecurity/SimpleUsernameTestCase.java
===================================================================
--- stack/native/branches/native-2.0/src/test/java/org/jboss/test/ws/jaxws/samples/wssecurity/SimpleUsernameTestCase.java (rev 0)
+++ stack/native/branches/native-2.0/src/test/java/org/jboss/test/ws/jaxws/samples/wssecurity/SimpleUsernameTestCase.java 2007-08-15 14:10:27 UTC (rev 4373)
@@ -0,0 +1,90 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.test.ws.jaxws.samples.wssecurity;
+
+import java.io.File;
+import java.net.URL;
+import java.util.Map;
+
+import javax.xml.namespace.QName;
+import javax.xml.ws.BindingProvider;
+import javax.xml.ws.Service;
+
+import junit.framework.Test;
+
+import org.jboss.ws.core.StubExt;
+import org.jboss.wsf.test.JBossWSTest;
+import org.jboss.wsf.test.JBossWSTestSetup;
+
+/**
+ * Test WS-Security for Username Token
+ *
+ * @author <a href="mailto:mageshbk@jboss.com">Magesh Kumar B</a>
+ * @since 15-Aug-2007
+ * @version $Revision$
+ */
+public class SimpleUsernameTestCase extends JBossWSTest
+{
+ /** Construct the test case with a given name
+ */
+
+ /** Deploy the test */
+ public static Test suite() throws Exception
+ {
+ return new JBossWSTestSetup(SimpleUsernameTestCase.class, "jaxws-samples-wssecurity-username.war");
+ }
+
+ /**
+ * Test SOAP Envelope for Username Token
+ */
+ public void testUsernameToken() throws Exception
+ {
+ UsernameEndpoint username = getPort();
+
+ String retObj = username.getUsernameToken();
+ assertTrue(retObj.indexOf("UsernameToken") > 0);
+ }
+
+ private UsernameEndpoint getPort() throws Exception
+ {
+ URL wsdlURL = new File("resources/jaxws/samples/wssecurity/simple-username/META-INF/wsdl/UsernameService.wsdl").toURL();
+ URL securityURL = new File("resources/jaxws/samples/wssecurity/simple-username/META-INF/jboss-wsse-client.xml").toURL();
+ QName serviceName = new QName("http://org.jboss.ws/samples/wssecurity", "UsernameService");
+
+ Service service = Service.create(wsdlURL, serviceName);
+
+ UsernameEndpoint port = (UsernameEndpoint)service.getPort(UsernameEndpoint.class);
+ ((StubExt)port).setSecurityConfig(securityURL.toExternalForm());
+ ((StubExt)port).setConfigName("Standard WSSecurity Client");
+
+ Map<String, Object> reqContext = ((BindingProvider)port).getRequestContext();
+ reqContext.put(BindingProvider.USERNAME_PROPERTY, "kermit");
+ reqContext.put(BindingProvider.PASSWORD_PROPERTY, "thefrog");
+ // If these below parameters are set it appears in the log, but the test fails as another
+ // request for the getHeader() returns empty <env:Header></env:Header>
+ //reqContext.put("javax.xml.rpc.security.auth.username", "kermit");
+ //reqContext.put("javax.xml.rpc.security.auth.password", "thefrog");
+ reqContext.put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY, "http://" + getServerHost() + ":8080/jaxws-samples-wssecurity-username");
+
+ return port;
+ }
+}
\ No newline at end of file
Property changes on: stack/native/branches/native-2.0/src/test/java/org/jboss/test/ws/jaxws/samples/wssecurity/SimpleUsernameTestCase.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: stack/native/branches/native-2.0/src/test/java/org/jboss/test/ws/jaxws/samples/wssecurity/UsernameBean.java
===================================================================
--- stack/native/branches/native-2.0/src/test/java/org/jboss/test/ws/jaxws/samples/wssecurity/UsernameBean.java (rev 0)
+++ stack/native/branches/native-2.0/src/test/java/org/jboss/test/ws/jaxws/samples/wssecurity/UsernameBean.java 2007-08-15 14:10:27 UTC (rev 4373)
@@ -0,0 +1,108 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.test.ws.jaxws.samples.wssecurity;
+
+import java.io.ByteArrayOutputStream;
+import java.io.IOException;
+import java.io.StringWriter;
+import java.util.Iterator;
+
+import javax.annotation.Resource;
+import javax.jws.WebMethod;
+import javax.jws.WebParam;
+import javax.jws.WebService;
+import javax.jws.soap.SOAPBinding;
+import javax.xml.namespace.QName;
+import javax.xml.soap.SOAPEnvelope;
+import javax.xml.soap.SOAPException;
+import javax.xml.soap.SOAPHeader;
+import javax.xml.soap.SOAPMessage;
+import javax.xml.soap.SOAPPart;
+import javax.xml.ws.handler.MessageContext;
+import javax.xml.ws.handler.soap.SOAPMessageContext;
+import javax.xml.ws.WebServiceContext;
+
+import org.jboss.logging.Logger;
+import org.jboss.ws.annotation.EndpointConfig;
+import org.jboss.ws.extensions.security.Constants;
+import org.jboss.ws.extensions.security.Util;
+import org.jboss.ws.core.soap.SOAPElementImpl;
+import org.jboss.ws.core.soap.SOAPEnvelopeImpl;
+import org.jboss.ws.core.soap.SOAPHeaderImpl;
+import org.w3c.dom.Element;
+
+/**
+ * The SEI implementation used by the SimpleUsernameTestCase
+ *
+ * @author <a href="mailto:mageshbk@jboss.com">Magesh Kumar B</a>
+ * @since 15-Aug-2007
+ * @version $Revision$
+ */
+@WebService(name = "UsernameEndpoint", serviceName = "UsernameService", targetNamespace = "http://org.jboss.ws/samples/wssecurity")
+@EndpointConfig(configName = "Standard WSSecurity Endpoint")
+@SOAPBinding(style = SOAPBinding.Style.RPC)
+public class UsernameBean
+{
+ private Logger log = Logger.getLogger(UsernameBean.class);
+
+ @Resource
+ WebServiceContext wsCtx;
+
+ @WebMethod
+ public String getUsernameToken()
+ {
+ String retObj = "";
+ try
+ {
+ MessageContext jaxwsContext = (MessageContext)wsCtx.getMessageContext();
+ SOAPMessage soapMessage = ((SOAPMessageContext)jaxwsContext).getMessage();
+ ByteArrayOutputStream stream = new ByteArrayOutputStream();
+ soapMessage.writeTo(stream);
+ log.info(stream.toString());
+
+ SOAPPart soapPart = soapMessage.getSOAPPart();
+ SOAPEnvelope soapEnvelope = soapPart.getEnvelope();
+ StringWriter strw = new StringWriter();
+ ((SOAPEnvelopeImpl)soapEnvelope).writeElement(strw);
+ log.info(strw.toString());
+
+ SOAPHeader soapHeader = soapEnvelope.getHeader();
+ strw = new StringWriter();
+ ((SOAPHeaderImpl)soapHeader).writeElement(strw);
+ retObj = strw.toString();
+ log.info(retObj);
+
+ QName secQName = new QName(Constants.WSSE_NS, "Security");
+ Element secHeaderElement = Util.findElement(soapHeader, secQName);
+ log.info(secHeaderElement);
+ }
+ catch (SOAPException se)
+ {
+ log.error(se.getMessage());
+ }
+ catch (IOException ioe)
+ {
+ log.error(ioe.getMessage());
+ }
+ return retObj;
+ }
+}
Property changes on: stack/native/branches/native-2.0/src/test/java/org/jboss/test/ws/jaxws/samples/wssecurity/UsernameBean.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: stack/native/branches/native-2.0/src/test/java/org/jboss/test/ws/jaxws/samples/wssecurity/UsernameEndpoint.java
===================================================================
--- stack/native/branches/native-2.0/src/test/java/org/jboss/test/ws/jaxws/samples/wssecurity/UsernameEndpoint.java (rev 0)
+++ stack/native/branches/native-2.0/src/test/java/org/jboss/test/ws/jaxws/samples/wssecurity/UsernameEndpoint.java 2007-08-15 14:10:27 UTC (rev 4373)
@@ -0,0 +1,31 @@
+
+package org.jboss.test.ws.jaxws.samples.wssecurity;
+
+import javax.jws.WebMethod;
+import javax.jws.WebParam;
+import javax.jws.WebResult;
+import javax.jws.WebService;
+import javax.jws.soap.SOAPBinding;
+import javax.jws.soap.SOAPBinding.Style;
+
+/**
+ * The SEI
+ *
+ * @author <a href="mailto:mageshbk@jboss.com">Magesh Kumar B</a>
+ * @since 15-Aug-2007
+ * @version $Revision$
+ */
+@WebService(name = "UsernameEndpoint", targetNamespace = "http://org.jboss.ws/samples/wssecurity")
+@SOAPBinding(style = SOAPBinding.Style.RPC)
+public interface UsernameEndpoint {
+
+ /**
+ *
+ * @return
+ * returns java.lang.String
+ */
+ @WebMethod
+ @WebResult(partName = "return")
+ public String getUsernameToken();
+
+}
Property changes on: stack/native/branches/native-2.0/src/test/java/org/jboss/test/ws/jaxws/samples/wssecurity/UsernameEndpoint.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: stack/native/branches/native-2.0/src/test/resources/jaxws/samples/wssecurity/simple-username/META-INF/jboss-wsse-client.xml
===================================================================
--- stack/native/branches/native-2.0/src/test/resources/jaxws/samples/wssecurity/simple-username/META-INF/jboss-wsse-client.xml (rev 0)
+++ stack/native/branches/native-2.0/src/test/resources/jaxws/samples/wssecurity/simple-username/META-INF/jboss-wsse-client.xml 2007-08-15 14:10:27 UTC (rev 4373)
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<jboss-ws-security xmlns="http://www.jboss.com/ws-security/config" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://www.jboss.com/ws-security/config http://www.jboss.com/ws-security/schema/jboss-ws-security_1_0.xsd">
+ <config>
+ <username/>
+ </config>
+</jboss-ws-security>
\ No newline at end of file
Property changes on: stack/native/branches/native-2.0/src/test/resources/jaxws/samples/wssecurity/simple-username/META-INF/jboss-wsse-client.xml
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: stack/native/branches/native-2.0/src/test/resources/jaxws/samples/wssecurity/simple-username/META-INF/wsdl/UsernameService.wsdl
===================================================================
--- stack/native/branches/native-2.0/src/test/resources/jaxws/samples/wssecurity/simple-username/META-INF/wsdl/UsernameService.wsdl (rev 0)
+++ stack/native/branches/native-2.0/src/test/resources/jaxws/samples/wssecurity/simple-username/META-INF/wsdl/UsernameService.wsdl 2007-08-15 14:10:27 UTC (rev 4373)
@@ -0,0 +1,30 @@
+<definitions name='UsernameService' targetNamespace='http://org.jboss.ws/samples/wssecurity' xmlns='http://schemas.xmlsoap.org/wsdl/' xmlns:soap='http://schemas.xmlsoap.org/wsdl/soap/' xmlns:tns='http://org.jboss.ws/samples/wssecurity' xmlns:xsd='http://www.w3.org/2001/XMLSchema'>
+ <types/>
+ <message name='UsernameEndpoint_getUsernameToken'></message>
+ <message name='UsernameEndpoint_getUsernameTokenResponse'>
+ <part name='return' type='xsd:string'/>
+ </message>
+ <portType name='UsernameEndpoint'>
+ <operation name='getUsernameToken'>
+ <input message='tns:UsernameEndpoint_getUsernameToken'/>
+ <output message='tns:UsernameEndpoint_getUsernameTokenResponse'/>
+ </operation>
+ </portType>
+ <binding name='UsernameEndpointBinding' type='tns:UsernameEndpoint'>
+ <soap:binding style='rpc' transport='http://schemas.xmlsoap.org/soap/http'/>
+ <operation name='getUsernameToken'>
+ <soap:operation soapAction=''/>
+ <input>
+ <soap:body namespace='http://org.jboss.ws/samples/wssecurity' use='literal'/>
+ </input>
+ <output>
+ <soap:body namespace='http://org.jboss.ws/samples/wssecurity' use='literal'/>
+ </output>
+ </operation>
+ </binding>
+ <service name='UsernameService'>
+ <port binding='tns:UsernameEndpointBinding' name='UsernameEndpointPort'>
+ <soap:address location='REPLACE_WITH_ACTUAL_URL'/>
+ </port>
+ </service>
+</definitions>
\ No newline at end of file
Property changes on: stack/native/branches/native-2.0/src/test/resources/jaxws/samples/wssecurity/simple-username/META-INF/wsdl/UsernameService.wsdl
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: stack/native/branches/native-2.0/src/test/resources/jaxws/samples/wssecurity/simple-username/WEB-INF/jboss-web.xml
===================================================================
--- stack/native/branches/native-2.0/src/test/resources/jaxws/samples/wssecurity/simple-username/WEB-INF/jboss-web.xml (rev 0)
+++ stack/native/branches/native-2.0/src/test/resources/jaxws/samples/wssecurity/simple-username/WEB-INF/jboss-web.xml 2007-08-15 14:10:27 UTC (rev 4373)
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<jboss-web>
+ <security-domain>java:/jaas/JBossWS</security-domain>
+</jboss-web>
\ No newline at end of file
Property changes on: stack/native/branches/native-2.0/src/test/resources/jaxws/samples/wssecurity/simple-username/WEB-INF/jboss-web.xml
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: stack/native/branches/native-2.0/src/test/resources/jaxws/samples/wssecurity/simple-username/WEB-INF/jboss-wsse-server.xml
===================================================================
--- stack/native/branches/native-2.0/src/test/resources/jaxws/samples/wssecurity/simple-username/WEB-INF/jboss-wsse-server.xml (rev 0)
+++ stack/native/branches/native-2.0/src/test/resources/jaxws/samples/wssecurity/simple-username/WEB-INF/jboss-wsse-server.xml 2007-08-15 14:10:27 UTC (rev 4373)
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<jboss-ws-security xmlns="http://www.jboss.com/ws-security/config" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://www.jboss.com/ws-security/config http://www.jboss.com/ws-security/schema/jboss-ws-security_1_0.xsd">
+</jboss-ws-security>
\ No newline at end of file
Property changes on: stack/native/branches/native-2.0/src/test/resources/jaxws/samples/wssecurity/simple-username/WEB-INF/jboss-wsse-server.xml
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: stack/native/branches/native-2.0/src/test/resources/jaxws/samples/wssecurity/simple-username/WEB-INF/web.xml
===================================================================
--- stack/native/branches/native-2.0/src/test/resources/jaxws/samples/wssecurity/simple-username/WEB-INF/web.xml (rev 0)
+++ stack/native/branches/native-2.0/src/test/resources/jaxws/samples/wssecurity/simple-username/WEB-INF/web.xml 2007-08-15 14:10:27 UTC (rev 4373)
@@ -0,0 +1,39 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<web-app xmlns="http://java.sun.com/xml/ns/j2ee"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"
+ version="2.4">
+
+ <servlet>
+ <servlet-name>UsernameService</servlet-name>
+ <servlet-class>org.jboss.test.ws.jaxws.samples.wssecurity.UsernameBean</servlet-class>
+ </servlet>
+ <servlet-mapping>
+ <servlet-name>UsernameService</servlet-name>
+ <url-pattern>/*</url-pattern>
+ </servlet-mapping>
+
+ <security-constraint>
+ <web-resource-collection>
+ <web-resource-name>UsernameService</web-resource-name>
+ <url-pattern>/*</url-pattern>
+ <http-method>GET</http-method>
+ <http-method>POST</http-method>
+ </web-resource-collection>
+ <auth-constraint>
+ <role-name>friend</role-name>
+ </auth-constraint>
+ </security-constraint>
+
+ <login-config>
+ <auth-method>BASIC</auth-method>
+ <realm-name>JBossWS</realm-name>
+ </login-config>
+
+ <security-role>
+ <role-name>friend</role-name>
+ </security-role>
+
+</web-app>
+
Property changes on: stack/native/branches/native-2.0/src/test/resources/jaxws/samples/wssecurity/simple-username/WEB-INF/web.xml
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
17 years, 4 months
JBossWS SVN: r4372 - stack/native/branches/native-2.0/src/test/java/org/jboss/test/ws/jaxws/endpoint.
by jbossws-commits@lists.jboss.org
Author: richard_opalka
Date: 2007-08-15 08:00:40 -0400 (Wed, 15 Aug 2007)
New Revision: 4372
Modified:
stack/native/branches/native-2.0/src/test/java/org/jboss/test/ws/jaxws/endpoint/EndpointTestCase.java
Log:
[JBWS-1770] enabling the test for JBoss5 because it passes now
Modified: stack/native/branches/native-2.0/src/test/java/org/jboss/test/ws/jaxws/endpoint/EndpointTestCase.java
===================================================================
--- stack/native/branches/native-2.0/src/test/java/org/jboss/test/ws/jaxws/endpoint/EndpointTestCase.java 2007-08-15 11:50:36 UTC (rev 4371)
+++ stack/native/branches/native-2.0/src/test/java/org/jboss/test/ws/jaxws/endpoint/EndpointTestCase.java 2007-08-15 12:00:40 UTC (rev 4372)
@@ -77,12 +77,6 @@
public void testWSDLAccess() throws MalformedURLException
{
- if (isTargetJBoss50())
- {
- System.out.println("FIXME: [JBWEB-1770] Fix Endpoint API for jboss-5.0.0.Beta3");
- return;
- }
-
URL wsdlURL = new URL("http://" + getServerHost() + ":8080/jaxws-endpoint?wsdl");
WSDLDefinitionsFactory factory = WSDLDefinitionsFactory.newInstance();
WSDLDefinitions wsdlDefinitions = factory.parse(wsdlURL);
@@ -91,12 +85,6 @@
public void testClientAccess() throws Exception
{
- if (isTargetJBoss50())
- {
- System.out.println("FIXME: [JBWEB-1770] Fix Endpoint API for jboss-5.0.0.Beta3");
- return;
- }
-
// Create the port
URL wsdlURL = new File("resources/jaxws/endpoint/WEB-INF/wsdl/TestService.wsdl").toURL();
QName qname = new QName("http://org.jboss.ws/jaxws/endpoint", "TestService");
@@ -110,15 +98,8 @@
public void testServletAccess() throws Exception
{
- if (isTargetJBoss50())
- {
- System.out.println("FIXME: [JBWEB-1770] Fix Endpoint API for jboss-5.0.0.Beta3");
- return;
- }
-
URL url = new URL("http://" + getServerHost() + ":8080/jaxws-endpoint-servlet?param=hello-world");
BufferedReader br = new BufferedReader(new InputStreamReader(url.openStream()));
assertEquals("hello-world", br.readLine());
-
}
}
17 years, 4 months
JBossWS SVN: r4371 - framework/branches/framework-2.0/src/test/java/org/jboss/test/ws/jaxws/samples/serviceref.
by jbossws-commits@lists.jboss.org
Author: richard_opalka
Date: 2007-08-15 07:50:36 -0400 (Wed, 15 Aug 2007)
New Revision: 4371
Modified:
framework/branches/framework-2.0/src/test/java/org/jboss/test/ws/jaxws/samples/serviceref/ServiceRefClientTestCase.java
Log:
test source code beautification
Modified: framework/branches/framework-2.0/src/test/java/org/jboss/test/ws/jaxws/samples/serviceref/ServiceRefClientTestCase.java
===================================================================
--- framework/branches/framework-2.0/src/test/java/org/jboss/test/ws/jaxws/samples/serviceref/ServiceRefClientTestCase.java 2007-08-15 11:48:43 UTC (rev 4370)
+++ framework/branches/framework-2.0/src/test/java/org/jboss/test/ws/jaxws/samples/serviceref/ServiceRefClientTestCase.java 2007-08-15 11:50:36 UTC (rev 4371)
@@ -28,6 +28,8 @@
import javax.naming.InitialContext;
import javax.xml.namespace.QName;
import javax.xml.ws.Service;
+import javax.xml.ws.BindingProvider;
+import javax.xml.ws.soap.SOAPBinding;
import junit.framework.Test;
@@ -87,8 +89,8 @@
TestEndpoint port = service.getPort(TestEndpoint.class);
assertNotNull(port);
- javax.xml.ws.BindingProvider bp = (javax.xml.ws.BindingProvider)port;
- boolean mtomEnabled = ((javax.xml.ws.soap.SOAPBinding)bp.getBinding()).isMTOMEnabled();
+ BindingProvider bp = (BindingProvider)port;
+ boolean mtomEnabled = ((SOAPBinding)bp.getBinding()).isMTOMEnabled();
assertTrue("MTOM should be enabled on port", mtomEnabled);
String request = "testApplicationClient";
17 years, 4 months
JBossWS SVN: r4370 - framework/branches/framework-2.0/src/test/java/org/jboss/test/ws/jaxws/samples/serviceref.
by jbossws-commits@lists.jboss.org
Author: richard_opalka
Date: 2007-08-15 07:48:43 -0400 (Wed, 15 Aug 2007)
New Revision: 4370
Modified:
framework/branches/framework-2.0/src/test/java/org/jboss/test/ws/jaxws/samples/serviceref/ServiceRefClientTestCase.java
Log:
[JBWS-1736] enabling the test, there is already no FIXME necessary
Modified: framework/branches/framework-2.0/src/test/java/org/jboss/test/ws/jaxws/samples/serviceref/ServiceRefClientTestCase.java
===================================================================
--- framework/branches/framework-2.0/src/test/java/org/jboss/test/ws/jaxws/samples/serviceref/ServiceRefClientTestCase.java 2007-08-15 07:24:42 UTC (rev 4369)
+++ framework/branches/framework-2.0/src/test/java/org/jboss/test/ws/jaxws/samples/serviceref/ServiceRefClientTestCase.java 2007-08-15 11:48:43 UTC (rev 4370)
@@ -87,16 +87,13 @@
TestEndpoint port = service.getPort(TestEndpoint.class);
assertNotNull(port);
- System.out.println("FIXME [JBWS-1736]: MTOM property at service-ref level");
+ javax.xml.ws.BindingProvider bp = (javax.xml.ws.BindingProvider)port;
+ boolean mtomEnabled = ((javax.xml.ws.soap.SOAPBinding)bp.getBinding()).isMTOMEnabled();
+ assertTrue("MTOM should be enabled on port", mtomEnabled);
- //BindingProvider bp = (BindingProvider)port;
- //boolean mtomEnabled = ((SOAPBinding)bp.getBinding()).isMTOMEnabled();
- //assertTrue("MTOM should be enabled on port", mtomEnabled);
-
String request = "testApplicationClient";
String response = port.echo(request);
assertEquals(response, request);
-
}
}
17 years, 4 months
JBossWS SVN: r4369 - stack/native/branches/native-2.0/src/test/resources.
by jbossws-commits@lists.jboss.org
Author: richard_opalka
Date: 2007-08-15 03:24:42 -0400 (Wed, 15 Aug 2007)
New Revision: 4369
Modified:
stack/native/branches/native-2.0/src/test/resources/test-excludes-jboss40.txt
Log:
removing useless excludes
Modified: stack/native/branches/native-2.0/src/test/resources/test-excludes-jboss40.txt
===================================================================
--- stack/native/branches/native-2.0/src/test/resources/test-excludes-jboss40.txt 2007-08-15 06:44:50 UTC (rev 4368)
+++ stack/native/branches/native-2.0/src/test/resources/test-excludes-jboss40.txt 2007-08-15 07:24:42 UTC (rev 4369)
@@ -1,14 +1,9 @@
# JBossAS-4.0 excludes
org/jboss/test/ws/jaxrpc/jbws723/**
-# benchmark tests
-org/jboss/test/ws/benchmark/**
-
# EJB3/Injection excludes
org/jboss/test/ws/jaxws/jbws1581/**
org/jboss/test/ws/jaxws/samples/context/WebServiceContextEJBTestCase*
-org/jboss/test/ws/jaxws/samples/handlerchain/HandlerChainClientTestCase*
org/jboss/test/ws/jaxws/samples/retail/**
-org/jboss/test/ws/jaxws/samples/serviceref/**
org/jboss/test/ws/jaxws/samples/webserviceref/**
org/jboss/test/ws/jaxws/webserviceref/**
17 years, 4 months