JBossWS SVN: r2984 - in branches/JBWS-856: jbossws-core/src/java/org/jboss/ws/extensions/policy/metadata and 5 other directories.
by jbossws-commits@lists.jboss.org
Author: palin
Date: 2007-05-06 17:40:39 -0400 (Sun, 06 May 2007)
New Revision: 2984
Added:
branches/JBWS-856/jbossws-tests/src/java/org/jboss/test/ws/tools/jbws1645/
branches/JBWS-856/jbossws-tests/src/java/org/jboss/test/ws/tools/jbws1645/JBWS1645TestCase.java
branches/JBWS-856/jbossws-tests/src/resources/tools/jbws1645/
branches/JBWS-856/jbossws-tests/src/resources/tools/jbws1645/BindingPolicy.txt
branches/JBWS-856/jbossws-tests/src/resources/tools/jbws1645/PortPolicy.txt
branches/JBWS-856/jbossws-tests/src/resources/tools/jbws1645/PortTypePolicy.txt
branches/JBWS-856/jbossws-tests/src/resources/tools/jbws1645/StandardJavaTypesServiceJBWS1645.wsdl
Modified:
branches/JBWS-856/jbossws-core/src/java/org/jboss/ws/Constants.java
branches/JBWS-856/jbossws-core/src/java/org/jboss/ws/extensions/policy/metadata/PolicyMetaExtension.java
branches/JBWS-856/jbossws-core/src/java/org/jboss/ws/tools/wsdl/WSDLGenerator.java
Log:
Bug fix on WSDLGenerator, new test case added to prove resolution of JBWS-1645.
Modified: branches/JBWS-856/jbossws-core/src/java/org/jboss/ws/Constants.java
===================================================================
--- branches/JBWS-856/jbossws-core/src/java/org/jboss/ws/Constants.java 2007-05-06 20:59:10 UTC (rev 2983)
+++ branches/JBWS-856/jbossws-core/src/java/org/jboss/ws/Constants.java 2007-05-06 21:40:39 UTC (rev 2984)
@@ -302,6 +302,7 @@
static final QName WSDL_ATTRIBUTE_WSE_EVENTSOURCE = new QName(URI_WS_EVENTING, "EventSource");
static final QName WSDL_ATTRIBUTE_WSP_POLICYURIS = new QName(URI_WS_POLICY, "PolicyURIs");
+ static final QName WSDL_ELEMENT_WSP_POLICYREFERENCE = new QName(URI_WS_POLICY, "PolicyReference");
/** WSDL-2.0 exchange patterns */
static final String WSDL20_PATTERN_IN_ONLY = "http://www.w3.org/2004/08/wsdl/in-only";
Modified: branches/JBWS-856/jbossws-core/src/java/org/jboss/ws/extensions/policy/metadata/PolicyMetaExtension.java
===================================================================
--- branches/JBWS-856/jbossws-core/src/java/org/jboss/ws/extensions/policy/metadata/PolicyMetaExtension.java 2007-05-06 20:59:10 UTC (rev 2983)
+++ branches/JBWS-856/jbossws-core/src/java/org/jboss/ws/extensions/policy/metadata/PolicyMetaExtension.java 2007-05-06 21:40:39 UTC (rev 2984)
@@ -37,7 +37,8 @@
public Collection<Policy> getPolicies(PolicyScopeLevel scope)
{
- return policies.get(scope);
+ Collection<Policy> policyCollection = policies.get(scope);
+ return policyCollection == null ? new LinkedList<Policy>() : policyCollection;
}
public Collection<Policy> getAllPolicies()
Modified: branches/JBWS-856/jbossws-core/src/java/org/jboss/ws/tools/wsdl/WSDLGenerator.java
===================================================================
--- branches/JBWS-856/jbossws-core/src/java/org/jboss/ws/tools/wsdl/WSDLGenerator.java 2007-05-06 20:59:10 UTC (rev 2983)
+++ branches/JBWS-856/jbossws-core/src/java/org/jboss/ws/tools/wsdl/WSDLGenerator.java 2007-05-06 21:40:39 UTC (rev 2984)
@@ -402,8 +402,14 @@
protected void addPolicyReference(Policy policy, Extendable extendable)
{
- Element element = DOMUtils.createElement(Constants.WSDL_ELEMENT_POLICYREFERENCE,
- wsdl.getPrefix(Constants.URI_WS_POLICY), Constants.URI_WS_POLICY);
+ QName policyRefQName = Constants.WSDL_ELEMENT_WSP_POLICYREFERENCE;
+ String prefix = wsdl.getPrefix(policyRefQName.getNamespaceURI());
+ if (prefix == null)
+ {
+ prefix = "wsp";
+ wsdl.registerNamespaceURI(policyRefQName.getNamespaceURI(), prefix);
+ }
+ Element element = DOMUtils.createElement(policyRefQName.getLocalPart(), prefix);
element.setAttribute("URI", policy.getPolicyURI());
//TODO!! we need to understand if the policy is local or not...
WSDLExtensibilityElement ext = new WSDLExtensibilityElement(Constants.WSDL_ELEMENT_POLICYREFERENCE, element);
Added: branches/JBWS-856/jbossws-tests/src/java/org/jboss/test/ws/tools/jbws1645/JBWS1645TestCase.java
===================================================================
--- branches/JBWS-856/jbossws-tests/src/java/org/jboss/test/ws/tools/jbws1645/JBWS1645TestCase.java (rev 0)
+++ branches/JBWS-856/jbossws-tests/src/java/org/jboss/test/ws/tools/jbws1645/JBWS1645TestCase.java 2007-05-06 21:40:39 UTC (rev 2984)
@@ -0,0 +1,151 @@
+/*
+ * 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.jbws1645;
+
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.Writer;
+
+import org.apache.ws.policy.Policy;
+import org.apache.ws.policy.util.DOMPolicyReader;
+import org.apache.ws.policy.util.PolicyFactory;
+import org.apache.ws.policy.util.PolicyReader;
+import org.jboss.test.ws.JBossWSTest;
+import org.jboss.test.ws.tools.sei.StandardJavaTypes;
+import org.jboss.test.ws.tools.validation.WSDLValidator;
+import org.jboss.ws.Constants;
+import org.jboss.ws.core.jaxrpc.Style;
+import org.jboss.ws.core.utils.IOUtils;
+import org.jboss.ws.extensions.policy.PolicyScopeLevel;
+import org.jboss.ws.extensions.policy.metadata.PolicyMetaExtension;
+import org.jboss.ws.metadata.umdm.EndpointMetaData;
+import org.jboss.ws.metadata.umdm.ExtensibleMetaData;
+import org.jboss.ws.metadata.umdm.ServiceMetaData;
+import org.jboss.ws.metadata.umdm.UnifiedMetaData;
+import org.jboss.ws.metadata.wsdl.WSDLDefinitions;
+import org.jboss.ws.metadata.wsdl.WSDLUtils;
+import org.jboss.ws.tools.JavaToWSDL;
+import org.jboss.ws.tools.WSToolsConstants;
+import org.jboss.ws.tools.metadata.ToolsUnifiedMetaDataBuilder;
+import org.jboss.ws.tools.wsdl.WSDLDefinitionsFactory;
+import org.jboss.ws.tools.wsdl.WSDLWriter;
+
+/**
+ *
+ * @author Alessio Soldano, <alessio.soldano(a)javalinux.it>
+ * @since 05-May-2007
+ */
+public class JBWS1645TestCase extends JBossWSTest
+{
+ private PolicyReader reader;
+
+ public JBWS1645TestCase()
+ {
+ super();
+ setPolicyReader();
+ }
+
+ public JBWS1645TestCase(String name)
+ {
+ super(name);
+ setPolicyReader();
+ }
+
+ private void setPolicyReader()
+ {
+ reader = (DOMPolicyReader) PolicyFactory.getPolicyReader(PolicyFactory.DOM_POLICY_READER);
+ }
+
+ public void testWSDLGeneratorWithPolicies() throws Exception
+ {
+ Class seiClass = StandardJavaTypes.class;
+ String fixturefile = "resources/tools/jbws1645/StandardJavaTypesServiceJBWS1645.wsdl";
+
+ File wsdlDir = new File("./tools/jbws1645");
+ wsdlDir.mkdirs();
+
+ String sname = WSDLUtils.getJustClassName(seiClass) + "Service";
+ String wsdlPath = wsdlDir + "/" + sname + "JBWS1645.wsdl";
+ String targetNamespace = "http://org.jboss.ws";
+ Style style = Style.DOCUMENT;
+ JavaToWSDL jwsdl = new JavaToWSDL(Constants.NS_WSDL11);
+ jwsdl.setServiceName(sname);
+ jwsdl.setTargetNamespace(targetNamespace);
+ jwsdl.addFeature(WSToolsConstants.WSTOOLS_FEATURE_RESTRICT_TO_TARGET_NS, true);
+ jwsdl.setStyle(style);
+
+ //manually generate the umd using tools
+ UnifiedMetaData umd = new ToolsUnifiedMetaDataBuilder(seiClass, targetNamespace,
+ null, sname, style, null, null).getUnifiedMetaData();
+ jwsdl.setUmd(umd);
+
+ //manually add policies to the umd
+ ServiceMetaData serviceMetaData = umd.getServices().get(0);
+ EndpointMetaData epMetaData = serviceMetaData.getEndpoints().get(0);
+ addPolicy(new File("resources/tools/jbws1645/PortPolicy.txt"), PolicyScopeLevel.WSDL_PORT, epMetaData);
+ addPolicy(new File("resources/tools/jbws1645/PortTypePolicy.txt"), PolicyScopeLevel.WSDL_PORT_TYPE, epMetaData);
+ addPolicy(new File("resources/tools/jbws1645/BindingPolicy.txt"), PolicyScopeLevel.WSDL_BINDING, epMetaData);
+
+ //generate the wsdl definitions and write the wsdl file
+ WSDLDefinitions wsdl = jwsdl.generate(seiClass);
+
+ //performe some trivial checks on wsdl definitions
+ assertEquals(1, wsdl.getServices()[0].getEndpoints()[0].getExtensibilityElements(
+ Constants.WSDL_ELEMENT_POLICYREFERENCE).size());
+ assertNotNull(wsdl.getInterfaces()[0].getProperty(Constants.WSDL_PROPERTY_POLICYURIS));
+ assertEquals(1, wsdl.getBindings()[0].getExtensibilityElements(Constants.WSDL_ELEMENT_POLICYREFERENCE).size());
+ assertEquals(3, wsdl.getExtensibilityElements(Constants.WSDL_ELEMENT_POLICY).size());
+
+ Writer fw = IOUtils.getCharsetFileWriter(new File(wsdlPath), Constants.DEFAULT_XML_CHARSET);
+ new WSDLWriter(wsdl).write(fw, Constants.DEFAULT_XML_CHARSET);
+ fw.close();
+
+ //validate the generated WSDL
+ validateGeneratedWSDL(new File(wsdlPath), new File(fixturefile));
+
+ }
+
+ private void addPolicy(File sourceFile, PolicyScopeLevel scope, ExtensibleMetaData extMetaData) throws Exception
+ {
+ PolicyMetaExtension ext = (PolicyMetaExtension)extMetaData.getExtension(Constants.URI_WS_POLICY);
+ if (ext == null)
+ {
+ ext = new PolicyMetaExtension(Constants.URI_WS_POLICY);
+ extMetaData.addExtension(ext);
+ }
+ FileInputStream fis = new FileInputStream(sourceFile);
+ Policy policy = reader.readPolicy(fis);
+ fis.close();
+ ext.addPolicy(scope, policy);
+ }
+
+ private void validateGeneratedWSDL(File wsdlFile, File expectedWsdlFile) throws Exception
+ {
+ WSDLDefinitionsFactory factory = WSDLDefinitionsFactory.newInstance();
+ WSDLDefinitions wsdl = factory.parse(wsdlFile.toURL());
+ WSDLDefinitions expWsdl = factory.parse(expectedWsdlFile.toURL());
+ assertNotNull(wsdl);
+ assertNotNull(expWsdl);
+ WSDLValidator validator = new WSDLValidator();
+ assertTrue(validator.validate(expWsdl,wsdl));
+ }
+}
Added: branches/JBWS-856/jbossws-tests/src/resources/tools/jbws1645/BindingPolicy.txt
===================================================================
--- branches/JBWS-856/jbossws-tests/src/resources/tools/jbws1645/BindingPolicy.txt (rev 0)
+++ branches/JBWS-856/jbossws-tests/src/resources/tools/jbws1645/BindingPolicy.txt 2007-05-06 21:40:39 UTC (rev 2984)
@@ -0,0 +1,9 @@
+<wsp:Policy wsu:Id="X509EndpointPolicy" xmlns:wsu='http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utilit...' xmlns:wsp='http://schemas.xmlsoap.org/ws/2004/09/policy' xmlns:sp='http://schemas.xmlsoap.org/ws/2005/07/securitypolicy'>
+ <sp:AsymmetricBinding>
+ <wsp:Policy>
+ <!-- Details omitted for readability -->
+ <sp:IncludeTimestamp />
+ <sp:OnlySignEntireHeadersAndBody />
+ </wsp:Policy>
+ </sp:AsymmetricBinding>
+</wsp:Policy>
Added: branches/JBWS-856/jbossws-tests/src/resources/tools/jbws1645/PortPolicy.txt
===================================================================
--- branches/JBWS-856/jbossws-tests/src/resources/tools/jbws1645/PortPolicy.txt (rev 0)
+++ branches/JBWS-856/jbossws-tests/src/resources/tools/jbws1645/PortPolicy.txt 2007-05-06 21:40:39 UTC (rev 2984)
@@ -0,0 +1,3 @@
+<wsp:Policy wsu:Id="uselessPortPolicy" xmlns:wsu='http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utilit...' xmlns:wsp='http://schemas.xmlsoap.org/ws/2004/09/policy' xmlns:fab='http://www.fabrikam123.example.com/stock'>
+ <fab:useless>nothing again</fab:useless>
+</wsp:Policy>
Added: branches/JBWS-856/jbossws-tests/src/resources/tools/jbws1645/PortTypePolicy.txt
===================================================================
--- branches/JBWS-856/jbossws-tests/src/resources/tools/jbws1645/PortTypePolicy.txt (rev 0)
+++ branches/JBWS-856/jbossws-tests/src/resources/tools/jbws1645/PortTypePolicy.txt 2007-05-06 21:40:39 UTC (rev 2984)
@@ -0,0 +1,8 @@
+<wsp:Policy wsu:Id='RmPolicy' xmlns:wsu='http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utilit...' xmlns:rmp='http://schemas.xmlsoap.org/ws/2005/02/rm/policy' xmlns:wsp='http://schemas.xmlsoap.org/ws/2004/09/policy'>
+ <rmp:RMAssertion>
+ <rmp:InactivityTimeout Milliseconds='600000'/>
+ <rmp:BaseRetransmissionInterval Milliseconds='3000'/>
+ <rmp:ExponentialBackoff/>
+ <rmp:AcknowledgementInterval Milliseconds='200'/>
+ </rmp:RMAssertion>
+</wsp:Policy>
Added: branches/JBWS-856/jbossws-tests/src/resources/tools/jbws1645/StandardJavaTypesServiceJBWS1645.wsdl
===================================================================
--- branches/JBWS-856/jbossws-tests/src/resources/tools/jbws1645/StandardJavaTypesServiceJBWS1645.wsdl (rev 0)
+++ branches/JBWS-856/jbossws-tests/src/resources/tools/jbws1645/StandardJavaTypesServiceJBWS1645.wsdl 2007-05-06 21:40:39 UTC (rev 2984)
@@ -0,0 +1,261 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<definitions name='StandardJavaTypesService' targetNamespace='http://org.jboss.ws'
+ xmlns='http://schemas.xmlsoap.org/wsdl/'
+ xmlns:soap='http://schemas.xmlsoap.org/wsdl/soap/'
+ xmlns:tns='http://org.jboss.ws'
+ xmlns:xsd='http://www.w3.org/2001/XMLSchema'
+ xmlns:wsp='http://schemas.xmlsoap.org/ws/2004/09/policy'>
+ <wsp:Policy wsu:Id='RmPolicy' xmlns:wsu='http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utilit...'>
+ <rmp:RMAssertion xmlns:rmp='http://schemas.xmlsoap.org/ws/2005/02/rm/policy'>
+ <rmp:InactivityTimeout Milliseconds='600000' />
+ <rmp:BaseRetransmissionInterval Milliseconds='3000' />
+ <rmp:ExponentialBackoff />
+ <rmp:AcknowledgementInterval Milliseconds='200' />
+ </rmp:RMAssertion>
+ </wsp:Policy>
+ <wsp:Policy wsu:Id='uselessPortPolicy' xmlns:wsu='http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utilit...'>
+ <fab:useless xmlns:fab='http://www.fabrikam123.example.com/stock'>nothing again</fab:useless>
+ </wsp:Policy>
+ <wsp:Policy wsu:Id='X509EndpointPolicy' xmlns:wsu='http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utilit...'>
+ <sp:AsymmetricBinding xmlns:sp='http://schemas.xmlsoap.org/ws/2005/07/securitypolicy'>
+ <wsp:Policy>
+ <!-- Details omitted for readability -->
+ <sp:IncludeTimestamp />
+ <sp:OnlySignEntireHeadersAndBody />
+ </wsp:Policy>
+ </sp:AsymmetricBinding>
+ </wsp:Policy>
+ <types>
+ <schema targetNamespace='http://org.jboss.ws' xmlns='http://www.w3.org/2001/XMLSchema' xmlns:soap11-enc='http://schemas.xmlsoap.org/soap/encoding/' xmlns:tns='http://org.jboss.ws' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'>
+ <complexType name='echoCalendar'>
+ <sequence>
+ <element name='Calendar_1' nillable='true' type='dateTime'/>
+ </sequence>
+ </complexType>
+ <complexType name='echoCalendarResponse'>
+ <sequence>
+ <element name='result' nillable='true' type='dateTime'/>
+ </sequence>
+ </complexType>
+ <complexType name='echoDate'>
+ <sequence>
+ <element name='Date_1' nillable='true' type='dateTime'/>
+ </sequence>
+ </complexType>
+ <complexType name='echoDateResponse'>
+ <sequence>
+ <element name='result' nillable='true' type='dateTime'/>
+ </sequence>
+ </complexType>
+ <complexType name='echoDecimal'>
+ <sequence>
+ <element name='BigDecimal_1' nillable='true' type='decimal'/>
+ </sequence>
+ </complexType>
+ <complexType name='echoDecimalResponse'>
+ <sequence>
+ <element name='result' nillable='true' type='decimal'/>
+ </sequence>
+ </complexType>
+ <complexType name='echoInteger'>
+ <sequence>
+ <element name='BigInteger_1' nillable='true' type='integer'/>
+ </sequence>
+ </complexType>
+ <complexType name='echoIntegerResponse'>
+ <sequence>
+ <element name='result' nillable='true' type='integer'/>
+ </sequence>
+ </complexType>
+ <complexType name='echoQName'>
+ <sequence>
+ <element name='QName_1' nillable='true' type='QName'/>
+ </sequence>
+ </complexType>
+ <complexType name='echoQNameResponse'>
+ <sequence>
+ <element name='result' nillable='true' type='QName'/>
+ </sequence>
+ </complexType>
+ <complexType name='echoString'>
+ <sequence>
+ <element name='String_1' nillable='true' type='string'/>
+ </sequence>
+ </complexType>
+ <complexType name='echoStringResponse'>
+ <sequence>
+ <element name='result' nillable='true' type='string'/>
+ </sequence>
+ </complexType>
+ <complexType name='echoURI'>
+ <sequence>
+ <element name='URI_1' nillable='true' type='anyURI'/>
+ </sequence>
+ </complexType>
+ <complexType name='echoURIResponse'>
+ <sequence>
+ <element name='result' nillable='true' type='anyURI'/>
+ </sequence>
+ </complexType>
+ <element name='echoCalendar' type='tns:echoCalendar'/>
+ <element name='echoCalendarResponse' type='tns:echoCalendarResponse'/>
+ <element name='echoDate' type='tns:echoDate'/>
+ <element name='echoDateResponse' type='tns:echoDateResponse'/>
+ <element name='echoDecimal' type='tns:echoDecimal'/>
+ <element name='echoDecimalResponse' type='tns:echoDecimalResponse'/>
+ <element name='echoInteger' type='tns:echoInteger'/>
+ <element name='echoIntegerResponse' type='tns:echoIntegerResponse'/>
+ <element name='echoQName' type='tns:echoQName'/>
+ <element name='echoQNameResponse' type='tns:echoQNameResponse'/>
+ <element name='echoString' type='tns:echoString'/>
+ <element name='echoStringResponse' type='tns:echoStringResponse'/>
+ <element name='echoURI' type='tns:echoURI'/>
+ <element name='echoURIResponse' type='tns:echoURIResponse'/>
+ </schema>
+ </types>
+ <message name='StandardJavaTypes_echoCalendar' xmlns='http://schemas.xmlsoap.org/wsdl/'>
+ <part element='tns:echoCalendar' name='echoCalendar'/>
+ </message>
+ <message name='StandardJavaTypes_echoCalendarResponse'>
+ <part element='tns:echoCalendarResponse' name='echoCalendarResponse'/>
+ </message>
+ <message name='StandardJavaTypes_echoDate'>
+ <part element='tns:echoDate' name='echoDate'/>
+ </message>
+ <message name='StandardJavaTypes_echoDateResponse'>
+ <part element='tns:echoDateResponse' name='echoDateResponse'/>
+ </message>
+ <message name='StandardJavaTypes_echoDecimal'>
+ <part element='tns:echoDecimal' name='echoDecimal'/>
+ </message>
+ <message name='StandardJavaTypes_echoDecimalResponse'>
+ <part element='tns:echoDecimalResponse' name='echoDecimalResponse'/>
+ </message>
+ <message name='StandardJavaTypes_echoInteger'>
+ <part element='tns:echoInteger' name='echoInteger'/>
+ </message>
+ <message name='StandardJavaTypes_echoIntegerResponse'>
+ <part element='tns:echoIntegerResponse' name='echoIntegerResponse'/>
+ </message>
+ <message name='StandardJavaTypes_echoQName'>
+ <part element='tns:echoQName' name='echoQName'/>
+ </message>
+ <message name='StandardJavaTypes_echoQNameResponse'>
+ <part element='tns:echoQNameResponse' name='echoQNameResponse'/>
+ </message>
+ <message name='StandardJavaTypes_echoString'>
+ <part element='tns:echoString' name='echoString'/>
+ </message>
+ <message name='StandardJavaTypes_echoStringResponse'>
+ <part element='tns:echoStringResponse' name='echoStringResponse'/>
+ </message>
+ <message name='StandardJavaTypes_echoURI'>
+ <part element='tns:echoURI' name='echoURI'/>
+ </message>
+ <message name='StandardJavaTypes_echoURIResponse'>
+ <part element='tns:echoURIResponse' name='echoURIResponse'/>
+ </message>
+ <portType name='StandardJavaTypes' wsp:PolicyURIs='#RmPolicy'>
+ <operation name='echoCalendar' parameterOrder='echoCalendar'>
+ <input message='tns:StandardJavaTypes_echoCalendar'/>
+ <output message='tns:StandardJavaTypes_echoCalendarResponse'/>
+ </operation>
+ <operation name='echoDate' parameterOrder='echoDate'>
+ <input message='tns:StandardJavaTypes_echoDate'/>
+ <output message='tns:StandardJavaTypes_echoDateResponse'/>
+ </operation>
+ <operation name='echoDecimal' parameterOrder='echoDecimal'>
+ <input message='tns:StandardJavaTypes_echoDecimal'/>
+ <output message='tns:StandardJavaTypes_echoDecimalResponse'/>
+ </operation>
+ <operation name='echoInteger' parameterOrder='echoInteger'>
+ <input message='tns:StandardJavaTypes_echoInteger'/>
+ <output message='tns:StandardJavaTypes_echoIntegerResponse'/>
+ </operation>
+ <operation name='echoQName' parameterOrder='echoQName'>
+ <input message='tns:StandardJavaTypes_echoQName'/>
+ <output message='tns:StandardJavaTypes_echoQNameResponse'/>
+ </operation>
+ <operation name='echoString' parameterOrder='echoString'>
+ <input message='tns:StandardJavaTypes_echoString'/>
+ <output message='tns:StandardJavaTypes_echoStringResponse'/>
+ </operation>
+ <operation name='echoURI' parameterOrder='echoURI'>
+ <input message='tns:StandardJavaTypes_echoURI'/>
+ <output message='tns:StandardJavaTypes_echoURIResponse'/>
+ </operation>
+ </portType>
+ <binding name='StandardJavaTypesBinding' type='tns:StandardJavaTypes'>
+ <soap:binding style='document' transport='http://schemas.xmlsoap.org/soap/http'/>
+ <wsp:PolicyReference URI='#X509EndpointPolicy' />
+ <operation name='echoCalendar'>
+ <soap:operation soapAction=''/>
+ <input>
+ <soap:body use='literal'/>
+ </input>
+ <output>
+ <soap:body use='literal'/>
+ </output>
+ </operation>
+ <operation name='echoDate'>
+ <soap:operation soapAction=''/>
+ <input>
+ <soap:body use='literal'/>
+ </input>
+ <output>
+ <soap:body use='literal'/>
+ </output>
+ </operation>
+ <operation name='echoDecimal'>
+ <soap:operation soapAction=''/>
+ <input>
+ <soap:body use='literal'/>
+ </input>
+ <output>
+ <soap:body use='literal'/>
+ </output>
+ </operation>
+ <operation name='echoInteger'>
+ <soap:operation soapAction=''/>
+ <input>
+ <soap:body use='literal'/>
+ </input>
+ <output>
+ <soap:body use='literal'/>
+ </output>
+ </operation>
+ <operation name='echoQName'>
+ <soap:operation soapAction=''/>
+ <input>
+ <soap:body use='literal'/>
+ </input>
+ <output>
+ <soap:body use='literal'/>
+ </output>
+ </operation>
+ <operation name='echoString'>
+ <soap:operation soapAction=''/>
+ <input>
+ <soap:body use='literal'/>
+ </input>
+ <output>
+ <soap:body use='literal'/>
+ </output>
+ </operation>
+ <operation name='echoURI'>
+ <soap:operation soapAction=''/>
+ <input>
+ <soap:body use='literal'/>
+ </input>
+ <output>
+ <soap:body use='literal'/>
+ </output>
+ </operation>
+ </binding>
+ <service name='StandardJavaTypesService'>
+ <port binding='tns:StandardJavaTypesBinding' name='StandardJavaTypesPort'>
+ <soap:address location='REPLACE_WITH_ACTUAL_URL'/>
+ <wsp:PolicyReference URI='#uselessPortPolicy' />
+ </port>
+ </service>
+</definitions>
\ No newline at end of file
17 years, 8 months
JBossWS SVN: r2983 - in branches/JBWS-856/jbossws-tests: ant-import and 2 other directories.
by jbossws-commits@lists.jboss.org
Author: maeste
Date: 2007-05-06 16:59:10 -0400 (Sun, 06 May 2007)
New Revision: 2983
Modified:
branches/JBWS-856/jbossws-tests/ant-import/build-samples-jaxws.xml
branches/JBWS-856/jbossws-tests/build.xml
branches/JBWS-856/jbossws-tests/src/java/org/jboss/test/ws/jaxws/samples/wssecuritypolicy/HelloJavaBean.java
branches/JBWS-856/jbossws-tests/src/java/org/jboss/test/ws/jaxws/samples/wssecuritypolicy/SimpleEncryptTestCase.java
branches/JBWS-856/jbossws-tests/src/resources/jaxws/samples/wssecuritypolicy/WEB-INF/web.xml
Log:
work on samples continuing
Modified: branches/JBWS-856/jbossws-tests/ant-import/build-samples-jaxws.xml
===================================================================
--- branches/JBWS-856/jbossws-tests/ant-import/build-samples-jaxws.xml 2007-05-06 13:14:16 UTC (rev 2982)
+++ branches/JBWS-856/jbossws-tests/ant-import/build-samples-jaxws.xml 2007-05-06 20:59:10 UTC (rev 2983)
@@ -457,6 +457,19 @@
</webinf>
</war>
+ <!-- jaxws-samples-wssecurity-encrypt -->
+ <war warfile="${tests.output.dir}/libs/jaxws-samples-wssecuritypolicy-encrypt.war" webxml="${tests.output.dir}/resources/jaxws/samples/wssecuritypolicy/WEB-INF/web.xml">
+ <classes dir="${tests.output.dir}/classes">
+ <include name="org/jboss/test/ws/jaxws/samples/wssecuritypolicy/Hello.class"/>
+ <include name="org/jboss/test/ws/jaxws/samples/wssecuritypolicy/HelloJavaBean.class"/>
+ <include name="org/jboss/test/ws/jaxws/samples/wssecuritypolicy/UserType.class"/>
+ </classes>
+ <webinf dir="${tests.output.dir}/resources/jaxws/samples/wssecuritypolicy">
+ <include name="wsse.keystore"/>
+ <include name="wsse.truststore"/>
+ <include name="PolicyAttachmetFragment.wsdl"/>
+ </webinf>
+ </war>
<!-- jaxws-samples-xop-doclit -->
<war jarfile="${tests.output.dir}/libs/jaxws-samples-xop-doclit.war" webxml="${tests.output.dir}/resources/jaxws/samples/xop/doclit/WEB-INF/web.xml">
<classes dir="${tests.output.dir}/classes">
@@ -469,4 +482,4 @@
</target>
-</project>
\ No newline at end of file
+</project>
Modified: branches/JBWS-856/jbossws-tests/build.xml
===================================================================
--- branches/JBWS-856/jbossws-tests/build.xml 2007-05-06 13:14:16 UTC (rev 2982)
+++ branches/JBWS-856/jbossws-tests/build.xml 2007-05-06 20:59:10 UTC (rev 2983)
@@ -354,6 +354,7 @@
</taskdef>
<wsprovide resourcedestdir="${tests.output.dir}/wsprovide/resources/jaxws/samples/wssecurity" genwsdl="true" sei="org.jboss.test.ws.jaxws.samples.wssecurity.HelloJavaBean"/>
+ <wsprovide resourcedestdir="${tests.output.dir}/wsprovide/resources/jaxws/samples/wssecuritypolicy" genwsdl="true" sei="org.jboss.test.ws.jaxws.samples.wssecuritypolicy.HelloJavaBean"/>
</target>
<target name="generate-resources" depends="servicegen,wstools,wsprovide">
Modified: branches/JBWS-856/jbossws-tests/src/java/org/jboss/test/ws/jaxws/samples/wssecuritypolicy/HelloJavaBean.java
===================================================================
--- branches/JBWS-856/jbossws-tests/src/java/org/jboss/test/ws/jaxws/samples/wssecuritypolicy/HelloJavaBean.java 2007-05-06 13:14:16 UTC (rev 2982)
+++ branches/JBWS-856/jbossws-tests/src/java/org/jboss/test/ws/jaxws/samples/wssecuritypolicy/HelloJavaBean.java 2007-05-06 20:59:10 UTC (rev 2983)
@@ -28,9 +28,10 @@
import org.jboss.logging.Logger;
import org.jboss.ws.annotation.EndpointConfig;
+import org.jboss.ws.annotation.Policy;
@WebService(name = "Hello", targetNamespace = "http://org.jboss.ws/samples/wssecurity")
-@EndpointConfig(configName = "Standard WSSecurity Endpoint")
+@Policy(wsdlFragmentLocation="file://dati/PolicyAttachmentFragment.wsdl")
@SOAPBinding(style = SOAPBinding.Style.RPC)
public class HelloJavaBean
{
Modified: branches/JBWS-856/jbossws-tests/src/java/org/jboss/test/ws/jaxws/samples/wssecuritypolicy/SimpleEncryptTestCase.java
===================================================================
--- branches/JBWS-856/jbossws-tests/src/java/org/jboss/test/ws/jaxws/samples/wssecuritypolicy/SimpleEncryptTestCase.java 2007-05-06 13:14:16 UTC (rev 2982)
+++ branches/JBWS-856/jbossws-tests/src/java/org/jboss/test/ws/jaxws/samples/wssecuritypolicy/SimpleEncryptTestCase.java 2007-05-06 20:59:10 UTC (rev 2983)
@@ -50,7 +50,7 @@
/** Deploy the test */
public static Test suite() throws Exception
{
- return JBossWSTestSetup.newTestSetup(SimpleEncryptTestCase.class, "jaxws-samples-wssecurity-encrypt.war");
+ return JBossWSTestSetup.newTestSetup(SimpleEncryptTestCase.class, "jaxws-samples-wssecuritypolicy-encrypt.war");
}
/**
@@ -68,18 +68,18 @@
private Hello getPort() throws Exception
{
- URL wsdlURL = new File("wsprovide/resources/jaxws/samples/wssecurity/HelloService.wsdl").toURL();
- URL securityURL = new File("resources/jaxws/samples/wssecurity/simple-encrypt/META-INF/jboss-wsse-client.xml").toURL();
- QName serviceName = new QName("http://org.jboss.ws/samples/wssecurity", "HelloService");
+ URL wsdlURL = new File("wsprovide/resources/jaxws/samples/wssecuritypolicy/HelloService.wsdl").toURL();
+ URL securityURL = new File("resources/jaxws/samples/wssecuritypolicy/simple-encrypt/META-INF/jboss-wsse-client.xml").toURL();
+ QName serviceName = new QName("http://org.jboss.ws/samples/wssecuritypolicy", "HelloService");
Service service = Service.create(wsdlURL, serviceName);
((ServiceExt)service).setSecurityConfig(securityURL.toExternalForm());
Hello port = (Hello)service.getPort(Hello.class);
- ((StubExt)port).setConfigName("Standard WSSecurity Client");
+ ((StubExt)port).setConfigName("Standard wssecuritypolicy Client");
Map<String, Object> reqContext = ((BindingProvider)port).getRequestContext();
- reqContext.put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY, "http://" + getServerHost() + ":8080/jaxws-samples-wssecurity-encrypt");
+ reqContext.put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY, "http://" + getServerHost() + ":8080/jaxws-samples-wssecuritypolicy-encrypt");
return port;
}
Modified: branches/JBWS-856/jbossws-tests/src/resources/jaxws/samples/wssecuritypolicy/WEB-INF/web.xml
===================================================================
--- branches/JBWS-856/jbossws-tests/src/resources/jaxws/samples/wssecuritypolicy/WEB-INF/web.xml 2007-05-06 13:14:16 UTC (rev 2982)
+++ branches/JBWS-856/jbossws-tests/src/resources/jaxws/samples/wssecuritypolicy/WEB-INF/web.xml 2007-05-06 20:59:10 UTC (rev 2983)
@@ -7,7 +7,7 @@
<servlet>
<servlet-name>HelloService</servlet-name>
- <servlet-class>org.jboss.test.ws.jaxws.samples.wssecurity.HelloJavaBean</servlet-class>
+ <servlet-class>org.jboss.test.ws.jaxws.samples.wssecuritypolicy.HelloJavaBean</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>HelloService</servlet-name>
17 years, 8 months
JBossWS SVN: r2982 - branches/jbossws-2.0/jbossws-tests/src/java/org/jboss/test/ws/jaxws/jbws1190.
by jbossws-commits@lists.jboss.org
Author: darran.lofthouse(a)jboss.com
Date: 2007-05-06 09:14:16 -0400 (Sun, 06 May 2007)
New Revision: 2982
Modified:
branches/jbossws-2.0/jbossws-tests/src/java/org/jboss/test/ws/jaxws/jbws1190/TestEndpointImpl.java
Log:
Fix JBWS1190 test case to just use the youngest WSDL.
Modified: branches/jbossws-2.0/jbossws-tests/src/java/org/jboss/test/ws/jaxws/jbws1190/TestEndpointImpl.java
===================================================================
--- branches/jbossws-2.0/jbossws-tests/src/java/org/jboss/test/ws/jaxws/jbws1190/TestEndpointImpl.java 2007-05-06 11:22:34 UTC (rev 2981)
+++ branches/jbossws-2.0/jbossws-tests/src/java/org/jboss/test/ws/jaxws/jbws1190/TestEndpointImpl.java 2007-05-06 13:14:16 UTC (rev 2982)
@@ -42,7 +42,7 @@
* @author darran.lofthouse(a)jboss.com
* @since 19-October-2006
*/
-@WebService(endpointInterface = "org.jboss.test.ws.jaxws.jbws1190.TestEndpoint", targetNamespace = "http://org.jboss/test/ws/jbws1190", name="Test")
+@WebService(endpointInterface = "org.jboss.test.ws.jaxws.jbws1190.TestEndpoint", targetNamespace = "http://org.jboss/test/ws/jbws1190", name = "Test")
public class TestEndpointImpl implements TestEndpoint
{
@@ -66,13 +66,21 @@
}
});
- assertEquals("WSDL files found", 1, wsdls.length);
+ File wsdlFile = null;
+ for (int i = 0; i < wsdls.length; i++)
+ {
+ if (wsdlFile == null || wsdls[i].compareTo(wsdlFile) > 0)
+ {
+ wsdlFile = wsdls[i];
+ }
+ }
+ assertTrue("No WSDL files found", wsdlFile != null);
WSDLDefinitionsFactory factory = WSDLDefinitionsFactory.newInstance();
WSDLDefinitions wsdl;
try
{
- wsdl = factory.parse(wsdls[0].toURL());
+ wsdl = factory.parse(wsdlFile.toURL());
}
catch (MalformedURLException e)
{
@@ -86,8 +94,8 @@
assertEquals("No of endpoints", 1, endpoints.length);
String address = endpoints[0].getAddress();
- assertTrue("Expected Scheme '" + scheme + "'", address.startsWith(scheme + "://"));
- assertTrue("Expected Port '" + port + "'", address.contains(":" + port + "/"));
+ assertTrue("Expected Scheme '" + scheme + "' from address '" + address + "'", address.startsWith(scheme + "://"));
+ assertTrue("Expected Port '" + port + "' from address '" + address + "'", address.indexOf(":" + port + "/") > -1);
}
private void assertEquals(final String message, final int expected, final int actual)
17 years, 8 months
JBossWS SVN: r2981 - trunk/jbossws-tests/src/java/org/jboss/test/ws/jaxws/jbws1190.
by jbossws-commits@lists.jboss.org
Author: darran.lofthouse(a)jboss.com
Date: 2007-05-06 07:22:34 -0400 (Sun, 06 May 2007)
New Revision: 2981
Modified:
trunk/jbossws-tests/src/java/org/jboss/test/ws/jaxws/jbws1190/TestEndpointImpl.java
Log:
Fix JBWS-1190 test case to use the youngest WSDL.
Modified: trunk/jbossws-tests/src/java/org/jboss/test/ws/jaxws/jbws1190/TestEndpointImpl.java
===================================================================
--- trunk/jbossws-tests/src/java/org/jboss/test/ws/jaxws/jbws1190/TestEndpointImpl.java 2007-05-06 08:49:30 UTC (rev 2980)
+++ trunk/jbossws-tests/src/java/org/jboss/test/ws/jaxws/jbws1190/TestEndpointImpl.java 2007-05-06 11:22:34 UTC (rev 2981)
@@ -80,7 +80,7 @@
WSDLDefinitions wsdl;
try
{
- wsdl = factory.parse(wsdls[0].toURL());
+ wsdl = factory.parse(wsdlFile.toURL());
}
catch (MalformedURLException e)
{
17 years, 8 months
JBossWS SVN: r2980 - branches/JBWS-856/jbossws-tests.
by jbossws-commits@lists.jboss.org
Author: maeste
Date: 2007-05-06 04:49:30 -0400 (Sun, 06 May 2007)
New Revision: 2980
Modified:
branches/JBWS-856/jbossws-tests/build.xml
Log:
Added ws-consume target for wssecuritypolicy test
Modified: branches/JBWS-856/jbossws-tests/build.xml
===================================================================
--- branches/JBWS-856/jbossws-tests/build.xml 2007-05-06 08:01:02 UTC (rev 2979)
+++ branches/JBWS-856/jbossws-tests/build.xml 2007-05-06 08:49:30 UTC (rev 2980)
@@ -261,6 +261,7 @@
<wsconsume wsdl="${tests.resources.dir}/jaxws/complex/META-INF/wsdl/RegistrationService.wsdl" package="org.jboss.test.ws.jaxws.complex" sourcedestdir="${tests.output.dir}/wsconsume/java" keep="true"/>
<wsconsume wsdl="${tests.resources.dir}/jaxws/holder/META-INF/wsdl/HolderService.wsdl" package="org.jboss.test.ws.jaxws.holder" sourcedestdir="${tests.output.dir}/wsconsume/java" keep="true"/>
<wsconsume wsdl="${tests.resources.dir}/jaxws/samples/wssecurity/META-INF/wsdl/HelloService.wsdl" package="org.jboss.test.ws.jaxws.samples.wssecurity" sourcedestdir="${tests.output.dir}/wsconsume/java" keep="true"/>
+ <wsconsume wsdl="${tests.resources.dir}/jaxws/samples/wssecuritypolicy/META-INF/wsdl/HelloService.wsdl" package="org.jboss.test.ws.jaxws.samples.wssecuritypolicy" sourcedestdir="${tests.output.dir}/wsconsume/java" keep="true"/>
</target>
<!--
17 years, 8 months
JBossWS SVN: r2979 - branches/jbossws-1.2.0.SP1-JBWS-1643/jbossws-core/src/java/org/jboss/ws/core/server.
by jbossws-commits@lists.jboss.org
Author: mageshbk(a)jboss.com
Date: 2007-05-06 04:01:02 -0400 (Sun, 06 May 2007)
New Revision: 2979
Modified:
branches/jbossws-1.2.0.SP1-JBWS-1643/jbossws-core/src/java/org/jboss/ws/core/server/ServiceEndpoint.java
branches/jbossws-1.2.0.SP1-JBWS-1643/jbossws-core/src/java/org/jboss/ws/core/server/WSDLRequestHandler.java
Log:
[JBWS-1609]Address in WSDL - Port value is -1 when server is requested with default port 80
Modified: branches/jbossws-1.2.0.SP1-JBWS-1643/jbossws-core/src/java/org/jboss/ws/core/server/ServiceEndpoint.java
===================================================================
--- branches/jbossws-1.2.0.SP1-JBWS-1643/jbossws-core/src/java/org/jboss/ws/core/server/ServiceEndpoint.java 2007-05-06 07:46:02 UTC (rev 2978)
+++ branches/jbossws-1.2.0.SP1-JBWS-1643/jbossws-core/src/java/org/jboss/ws/core/server/ServiceEndpoint.java 2007-05-06 08:01:02 UTC (rev 2979)
@@ -138,13 +138,8 @@
ServiceEndpointManagerFactory factory = ServiceEndpointManagerFactory.getInstance();
ServiceEndpointManager epManager = factory.getServiceEndpointManager();
- String wsdlHost = reqURL.getProtocol() + "://" + reqURL.getHost() + ":" + reqURL.getPort();
+ String wsdlHost = epManager.getDisplayHost(sepInfo, reqURL);
- if (epManager.getWebServiceHost().equals(ServiceEndpointManager.UNDEFINED_HOSTNAME) == false)
- {
- wsdlHost = epManager.getDisplayHost(sepInfo, reqURL);
- }
-
if(log.isDebugEnabled()) log.debug("WSDL request, using host: " + wsdlHost);
WSDLRequestHandler wsdlRequestHandler = new WSDLRequestHandler(epMetaData);
Modified: branches/jbossws-1.2.0.SP1-JBWS-1643/jbossws-core/src/java/org/jboss/ws/core/server/WSDLRequestHandler.java
===================================================================
--- branches/jbossws-1.2.0.SP1-JBWS-1643/jbossws-core/src/java/org/jboss/ws/core/server/WSDLRequestHandler.java 2007-05-06 07:46:02 UTC (rev 2978)
+++ branches/jbossws-1.2.0.SP1-JBWS-1643/jbossws-core/src/java/org/jboss/ws/core/server/WSDLRequestHandler.java 2007-05-06 08:01:02 UTC (rev 2979)
@@ -46,6 +46,7 @@
* For a discussion of this topic.
*
* @author Thomas.Diesler(a)jboss.org
+ * @author mageshbk(a)jboss.com
* @since 23-Mar-2005
*/
public class WSDLRequestHandler
@@ -134,10 +135,10 @@
if (! (wsdlHost.startsWith("http://") || wsdlHost.startsWith("https://")) )
{
- String reqProtocol = reqURL.getProtocol();
- int reqPort = reqURL.getPort();
- String hostAndPort = wsdlHost + (reqPort > 0 ? ":" + reqPort : "");
- completeHost = reqProtocol + "://" + hostAndPort;
+ String reqProtocol = reqURL.getProtocol();
+ int reqPort = reqURL.getPort();
+ String hostAndPort = wsdlHost + (reqPort > 0 ? ":" + reqPort : "");
+ completeHost = reqProtocol + "://" + hostAndPort;
}
String newLocation = completeHost + reqPath + "?wsdl&resource=" + newResourcePath;
@@ -157,25 +158,12 @@
String orgLocation = locationAttr.getNodeValue();
URL locURL = new URL(orgLocation);
- String locProtocol = locURL.getProtocol();
String locPath = locURL.getPath();
- if (reqURL.getProtocol().equals(locProtocol) && reqURL.getPath().equals(locPath))
- {
- String completeHost = wsdlHost;
- if (! (completeHost.startsWith("http://") || completeHost.startsWith("https://")) )
- {
- int locPort = locURL.getPort();
- String hostAndPort = wsdlHost + (locPort > 0 ? ":" + locPort : "");
+ String newLocation = wsdlHost + locPath;
+ locationAttr.setNodeValue(newLocation);
- completeHost = locProtocol + "://" + hostAndPort;
- }
-
- String newLocation = completeHost + locPath;
- locationAttr.setNodeValue(newLocation);
-
- log.trace("Mapping address from '" + orgLocation + "' to '" + newLocation + "'");
- }
+ log.trace("Mapping address from '" + orgLocation + "' to '" + newLocation + "'");
}
}
else
17 years, 8 months
JBossWS SVN: r2978 - branches/jbossws-1.2.0.SP1-JBWS-1643/jbossws-tests/src/java/org/jboss/test/ws/jaxrpc/jbws1190.
by jbossws-commits@lists.jboss.org
Author: mageshbk(a)jboss.com
Date: 2007-05-06 03:46:02 -0400 (Sun, 06 May 2007)
New Revision: 2978
Modified:
branches/jbossws-1.2.0.SP1-JBWS-1643/jbossws-tests/src/java/org/jboss/test/ws/jaxrpc/jbws1190/TestEndpointImpl.java
Log:
Reverted the changes
Modified: branches/jbossws-1.2.0.SP1-JBWS-1643/jbossws-tests/src/java/org/jboss/test/ws/jaxrpc/jbws1190/TestEndpointImpl.java
===================================================================
--- branches/jbossws-1.2.0.SP1-JBWS-1643/jbossws-tests/src/java/org/jboss/test/ws/jaxrpc/jbws1190/TestEndpointImpl.java 2007-05-06 06:50:21 UTC (rev 2977)
+++ branches/jbossws-1.2.0.SP1-JBWS-1643/jbossws-tests/src/java/org/jboss/test/ws/jaxrpc/jbws1190/TestEndpointImpl.java 2007-05-06 07:46:02 UTC (rev 2978)
@@ -35,7 +35,6 @@
/**
*
* @author darran.lofthouse(a)jboss.com
- * @author mageshbk(a)jboss.com
* @since 19-October-2006
*/
public class TestEndpointImpl implements TestEndpoint
@@ -61,7 +60,7 @@
}
});
- assertEquals("WSDL files found", 2, wsdls.length);
+ assertEquals("WSDL files found", 1, wsdls.length);
WSDLDefinitionsFactory factory = WSDLDefinitionsFactory.newInstance();
WSDLDefinitions wsdl;
@@ -75,10 +74,10 @@
}
WSDLService[] services = wsdl.getServices();
- assertEquals("No of services", 2, services.length);
+ assertEquals("No of services", 1, services.length);
WSDLEndpoint[] endpoints = services[0].getEndpoints();
- assertEquals("No of endpoints", 2, endpoints.length);
+ assertEquals("No of endpoints", 1, endpoints.length);
String address = endpoints[0].getAddress();
assertTrue("Expected Scheme '" + scheme + "'", address.startsWith(scheme + "://"));
17 years, 8 months
JBossWS SVN: r2977 - branches/jbossws-1.2.0.SP1-JBWS-1643/jbossws-core/src/java/org/jboss/ws/core/server.
by jbossws-commits@lists.jboss.org
Author: mageshbk(a)jboss.com
Date: 2007-05-06 02:50:21 -0400 (Sun, 06 May 2007)
New Revision: 2977
Modified:
branches/jbossws-1.2.0.SP1-JBWS-1643/jbossws-core/src/java/org/jboss/ws/core/server/ServiceEndpoint.java
branches/jbossws-1.2.0.SP1-JBWS-1643/jbossws-core/src/java/org/jboss/ws/core/server/ServiceEndpointManager.java
Log:
[JBWS-1609]Address in WSDL - Port value is -1 when server is requested with default port 80
Modified: branches/jbossws-1.2.0.SP1-JBWS-1643/jbossws-core/src/java/org/jboss/ws/core/server/ServiceEndpoint.java
===================================================================
--- branches/jbossws-1.2.0.SP1-JBWS-1643/jbossws-core/src/java/org/jboss/ws/core/server/ServiceEndpoint.java 2007-05-06 06:47:02 UTC (rev 2976)
+++ branches/jbossws-1.2.0.SP1-JBWS-1643/jbossws-core/src/java/org/jboss/ws/core/server/ServiceEndpoint.java 2007-05-06 06:50:21 UTC (rev 2977)
@@ -58,6 +58,7 @@
* This object registered with the ServiceEndpointManager service.
*
* @author Thomas.Diesler(a)jboss.org
+ * @author mageshbk(a)jboss.com
* @since 16-Jan-2005
*/
public class ServiceEndpoint
@@ -134,15 +135,16 @@
ServiceEndpointInfo sepInfo = getServiceEndpointInfo();
EndpointMetaData epMetaData = sepInfo.getServerEndpointMetaData();
- //String wsdlHost = reqURL.getHost();
+ ServiceEndpointManagerFactory factory = ServiceEndpointManagerFactory.getInstance();
+ ServiceEndpointManager epManager = factory.getServiceEndpointManager();
+
String wsdlHost = reqURL.getProtocol() + "://" + reqURL.getHost() + ":" + reqURL.getPort();
- ServiceEndpointManagerFactory factory = ServiceEndpointManagerFactory.getInstance();
- ServiceEndpointManager epManager = factory.getServiceEndpointManager();
if (epManager.getWebServiceHost().equals(ServiceEndpointManager.UNDEFINED_HOSTNAME) == false)
{
- wsdlHost = epManager.getWebServiceHost();
+ wsdlHost = epManager.getDisplayHost(sepInfo, reqURL);
}
+
if(log.isDebugEnabled()) log.debug("WSDL request, using host: " + wsdlHost);
WSDLRequestHandler wsdlRequestHandler = new WSDLRequestHandler(epMetaData);
Modified: branches/jbossws-1.2.0.SP1-JBWS-1643/jbossws-core/src/java/org/jboss/ws/core/server/ServiceEndpointManager.java
===================================================================
--- branches/jbossws-1.2.0.SP1-JBWS-1643/jbossws-core/src/java/org/jboss/ws/core/server/ServiceEndpointManager.java 2007-05-06 06:47:02 UTC (rev 2976)
+++ branches/jbossws-1.2.0.SP1-JBWS-1643/jbossws-core/src/java/org/jboss/ws/core/server/ServiceEndpointManager.java 2007-05-06 06:50:21 UTC (rev 2977)
@@ -78,6 +78,7 @@
* A service that manages JBossWS endpoints.
*
* @author Thomas.Diesler(a)jboss.org
+ * @author mageshbk(a)jboss.com
* @since 15-Jan-2005
*/
public class ServiceEndpointManager implements ServiceEndpointManagerMBean
@@ -334,18 +335,73 @@
return registered;
}
- private String getDisplayAddress(ServiceEndpointInfo seInfo, URL requestURL) throws MalformedURLException {
+
+ private String getDisplayAddress(ServiceEndpointInfo seInfo, URL requestURL) throws MalformedURLException
+ {
String endpointAddress = seInfo.getServerEndpointMetaData().getEndpointAddress();
URL displayURL = new URL(endpointAddress);
- String endPointPath = displayURL.getPath();
- if (this.getWebServiceHost().equals(ServiceEndpointManager.UNDEFINED_HOSTNAME) == true)
+ String displayHost = getDisplayHost(seInfo, requestURL);
+
+ String displayAddress = displayHost + displayURL.getPath();
+ if (log.isDebugEnabled())
{
- displayURL = requestURL;
+ log.trace("Mapping WSDL soap:address from '" + endpointAddress + "' to '" + displayAddress + "'");
}
- String displayAddress = displayURL.getProtocol() + "://" + displayURL.getHost() + ":" + displayURL.getPort() + endPointPath;
return displayAddress;
}
+ /*
+ * Formats the Service endpoint host according to the beans.xml definition and
+ * the requested url and returns the URL as string
+ *
+ */
+ public String getDisplayHost(ServiceEndpointInfo seInfo, URL requestURL) throws MalformedURLException
+ {
+ String endpointAddress = seInfo.getServerEndpointMetaData().getEndpointAddress();
+ URL displayURL = new URL(endpointAddress);
+ String protocol = displayURL.getProtocol();
+ String host = displayURL.getHost();
+ int port = displayURL.getPort();
+ String uriScheme = requestURL.getProtocol();
+ if ("CONFIDENTIAL".equals(seInfo.getServerEndpointMetaData().getTransportGuarantee()))
+ {
+ //If service is defined to be confidential then always it is https
+ uriScheme = "https";
+ }
+ if (alwaysModifySOAPAddress || host.equals(ServiceEndpointManager.UNDEFINED_HOSTNAME) == true)
+ {
+ //Modify the address
+ if (this.getWebServiceHost().equals(ServiceEndpointManager.UNDEFINED_HOSTNAME) == true)
+ {
+ //Use the incoming request's address
+ protocol = uriScheme;
+ host = requestURL.getHost();
+ port = requestURL.getPort();
+ }
+ else
+ {
+ //Use the address given in jboss-beans.xml
+ protocol = uriScheme;
+ host = this.getWebServiceHost();
+ if (protocol.equals("https"))
+ {
+ port = this.getWebServiceSecurePort();
+ }
+ else
+ {
+ port = this.getWebServicePort();
+ }
+ }
+ }
+ String displayHost = protocol + "://" + host + (port > 0 ? ":" + port : "");
+
+ if (log.isDebugEnabled())
+ {
+ log.trace("Mapping WSDL host from '" + protocol + "://" + host + ":" + port + "' to '" + displayHost + "'");
+ }
+ return displayHost;
+ }
+
/** Get the endpoint metrics
*/
public ServiceEndpointMetrics getServiceEndpointMetrics(ObjectName sepID)
17 years, 8 months
JBossWS SVN: r2976 - branches/jbossws-1.2.0.SP1-JBWS-1643/jbossws-tests/src/java/org/jboss/test/ws/jaxrpc/wsdlpublish.
by jbossws-commits@lists.jboss.org
Author: mageshbk(a)jboss.com
Date: 2007-05-06 02:47:02 -0400 (Sun, 06 May 2007)
New Revision: 2976
Modified:
branches/jbossws-1.2.0.SP1-JBWS-1643/jbossws-tests/src/java/org/jboss/test/ws/jaxrpc/wsdlpublish/WsdlPublishTestCase.java
Log:
Modified the location of wsdl as this test was failing
Modified: branches/jbossws-1.2.0.SP1-JBWS-1643/jbossws-tests/src/java/org/jboss/test/ws/jaxrpc/wsdlpublish/WsdlPublishTestCase.java
===================================================================
--- branches/jbossws-1.2.0.SP1-JBWS-1643/jbossws-tests/src/java/org/jboss/test/ws/jaxrpc/wsdlpublish/WsdlPublishTestCase.java 2007-05-06 06:45:35 UTC (rev 2975)
+++ branches/jbossws-1.2.0.SP1-JBWS-1643/jbossws-tests/src/java/org/jboss/test/ws/jaxrpc/wsdlpublish/WsdlPublishTestCase.java 2007-05-06 06:47:02 UTC (rev 2976)
@@ -37,6 +37,7 @@
* Test <wsdl-publish-location>
*
* @author Thomas.Diesler(a)jboss.org
+ * @author mageshbk(a)jboss.com
* @since 31-Jan-2007
*/
public class WsdlPublishTestCase extends JBossWSTest
@@ -55,7 +56,7 @@
TestEndpoint port = (TestEndpoint)service.getPort(TestEndpoint.class);
- String resStr = port.echoSimple(new File("wsdl-publish/some-wsdl-location/foo/bar/TestService.wsdl").getAbsolutePath());
+ String resStr = port.echoSimple(new File("resources/jaxrpc/wsdlpublish/WEB-INF/wsdl/foo/bar/TestService.wsdl").getAbsolutePath());
assertEquals("{http://org.jboss.test.ws/wsdlpublish}TestEndpoint", resStr);
}
}
17 years, 8 months
JBossWS SVN: r2975 - branches/jbossws-1.2.0.SP1-JBWS-1643/jbossws-tests/src/java/org/jboss/test/ws/jaxrpc/samples/wsbpel/hello.
by jbossws-commits@lists.jboss.org
Author: mageshbk(a)jboss.com
Date: 2007-05-06 02:45:35 -0400 (Sun, 06 May 2007)
New Revision: 2975
Modified:
branches/jbossws-1.2.0.SP1-JBWS-1643/jbossws-tests/src/java/org/jboss/test/ws/jaxrpc/samples/wsbpel/hello/BpelHelloTestCase.java
Log:
The location of the file jaxrpc-samples-wsbpel-hello-process.zip has been modified to use absolute path
Modified: branches/jbossws-1.2.0.SP1-JBWS-1643/jbossws-tests/src/java/org/jboss/test/ws/jaxrpc/samples/wsbpel/hello/BpelHelloTestCase.java
===================================================================
--- branches/jbossws-1.2.0.SP1-JBWS-1643/jbossws-tests/src/java/org/jboss/test/ws/jaxrpc/samples/wsbpel/hello/BpelHelloTestCase.java 2007-05-06 06:43:01 UTC (rev 2974)
+++ branches/jbossws-1.2.0.SP1-JBWS-1643/jbossws-tests/src/java/org/jboss/test/ws/jaxrpc/samples/wsbpel/hello/BpelHelloTestCase.java 2007-05-06 06:45:35 UTC (rev 2975)
@@ -21,6 +21,8 @@
*/
package org.jboss.test.ws.jaxrpc.samples.wsbpel.hello;
+import java.io.File;
+
import javax.naming.InitialContext;
import javax.xml.namespace.QName;
import javax.xml.rpc.Call;
@@ -35,6 +37,7 @@
* Test business process behavior based on web services.
*
* @author <a href="mailto:alex.guizar@jboss.com">Alejandro Guizar</a>
+ * @author mageshbk(a)jboss.com
* @version $Revision$
*/
public class BpelHelloTestCase extends JBossWSTest
@@ -44,7 +47,7 @@
public static Test suite()
{
JBossWSTestSetup wsTestSetup = JBossWSTestSetup.newTestSetup(BpelHelloTestCase.class, "jaxrpc-samples-wsbpel-hello.war, jaxrpc-samples-wsbpel-hello-client.jar");
- return new JbpmBpelTestSetup(wsTestSetup, new String[] { "libs/jaxrpc-samples-wsbpel-hello-process.zip" });
+ return new JbpmBpelTestSetup(wsTestSetup, new String[] { new File("libs/jaxrpc-samples-wsbpel-hello-process.zip").getAbsolutePath() });
}
protected void setUp() throws Exception
17 years, 8 months