Author: alessio.soldano(a)jboss.com
Date: 2010-09-15 13:56:09 -0400 (Wed, 15 Sep 2010)
New Revision: 12980
Removed:
framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/samples/provider/WebServiceEndpoint.java
Modified:
framework/trunk/testsuite/test/ant-import/build-samples-jaxws.xml
framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/samples/provider/ProviderBeanJAXB.java
framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/samples/provider/ProviderJAXBTestCase.java
framework/trunk/testsuite/test/resources/jaxws/samples/provider/jaxb/WEB-INF/web.xml
framework/trunk/testsuite/test/resources/jaxws/samples/provider/payload/WEB-INF/wsdl/Provider.wsdl
Log:
Fixing invadid provider testscases
Modified: framework/trunk/testsuite/test/ant-import/build-samples-jaxws.xml
===================================================================
--- framework/trunk/testsuite/test/ant-import/build-samples-jaxws.xml 2010-09-15 15:26:19
UTC (rev 12979)
+++ framework/trunk/testsuite/test/ant-import/build-samples-jaxws.xml 2010-09-15 17:56:09
UTC (rev 12980)
@@ -188,7 +188,6 @@
<war
warfile="${tests.output.dir}/test-libs/jaxws-samples-provider-jaxb.war"
webxml="${tests.output.dir}/test-resources/jaxws/samples/provider/jaxb/WEB-INF/web.xml">
<classes dir="${tests.output.dir}/test-classes">
<include
name="org/jboss/test/ws/jaxws/samples/provider/ProviderBeanJAXB.class"/>
- <include
name="org/jboss/test/ws/jaxws/samples/provider/WebServiceEndpoint.class"/>
<include
name="org/jboss/test/ws/jaxws/samples/provider/UserType.class"/>
</classes>
<webinf
dir="${tests.output.dir}/test-resources/jaxws/samples/provider/jaxb/WEB-INF">
Modified:
framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/samples/provider/ProviderBeanJAXB.java
===================================================================
---
framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/samples/provider/ProviderBeanJAXB.java 2010-09-15
15:26:19 UTC (rev 12979)
+++
framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/samples/provider/ProviderBeanJAXB.java 2010-09-15
17:56:09 UTC (rev 12980)
@@ -24,11 +24,13 @@
import javax.xml.bind.JAXBContext;
import javax.xml.bind.util.JAXBSource;
import javax.xml.transform.Source;
+import javax.xml.ws.BindingType;
import javax.xml.ws.Provider;
import javax.xml.ws.Service;
import javax.xml.ws.ServiceMode;
import javax.xml.ws.WebServiceException;
import javax.xml.ws.WebServiceProvider;
+import javax.xml.ws.http.HTTPBinding;
import org.jboss.logging.Logger;
@@ -40,7 +42,8 @@
* @since 29-Jun-2006
*/
@WebServiceProvider(serviceName = "ProviderService", portName =
"ProviderPort", targetNamespace = "http://org.jboss.ws/provider",
wsdlLocation = "WEB-INF/wsdl/Provider.wsdl")
-@ServiceMode(value = Service.Mode.PAYLOAD)
+@BindingType(value = HTTPBinding.HTTP_BINDING)
+@ServiceMode(value = Service.Mode.MESSAGE)
public class ProviderBeanJAXB implements Provider<Source>
{
// provide logging
Modified:
framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/samples/provider/ProviderJAXBTestCase.java
===================================================================
---
framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/samples/provider/ProviderJAXBTestCase.java 2010-09-15
15:26:19 UTC (rev 12979)
+++
framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/samples/provider/ProviderJAXBTestCase.java 2010-09-15
17:56:09 UTC (rev 12980)
@@ -21,29 +21,22 @@
*/
package org.jboss.test.ws.jaxws.samples.provider;
-import java.io.ByteArrayInputStream;
import java.net.MalformedURLException;
import java.net.URL;
import javax.xml.bind.JAXBContext;
import javax.xml.bind.JAXBException;
import javax.xml.namespace.QName;
-import javax.xml.soap.MessageFactory;
-import javax.xml.soap.SOAPConnection;
-import javax.xml.soap.SOAPConnectionFactory;
-import javax.xml.soap.SOAPEnvelope;
-import javax.xml.soap.SOAPMessage;
-import javax.xml.transform.dom.DOMSource;
import javax.xml.ws.Dispatch;
import javax.xml.ws.Service;
import javax.xml.ws.Service.Mode;
-import javax.xml.ws.soap.SOAPBinding;
+import javax.xml.ws.http.HTTPBinding;
import junit.framework.Test;
+import org.jboss.wsf.common.DOMUtils;
import org.jboss.wsf.test.JBossWSTest;
import org.jboss.wsf.test.JBossWSTestSetup;
-import org.jboss.wsf.common.DOMUtils;
import org.w3c.dom.Element;
/**
@@ -79,18 +72,6 @@
assertEquals(user.getQname(), userRes.getQname());
}
- public void testWebServiceDispatch() throws Exception
- {
- Dispatch<Object> dispatch = createDispatch("WebServiceEndpoint");
-
- UserType user = new UserType();
- user.setString("Kermit");
- user.setQname(new QName("TheFrog"));
- UserType userRes = (UserType)dispatch.invoke(user);
- assertEquals(user.getString(), userRes.getString());
- assertEquals(user.getQname(), userRes.getQname());
- }
-
private Dispatch<Object> createDispatch(String target) throws
MalformedURLException, JAXBException
{
String targetNS = "http://org.jboss.ws/provider";
@@ -99,39 +80,11 @@
URL endpointAddress = new URL("http://" + getServerHost() +
":8080/jaxws-samples-provider-jaxb/" + target);
Service service = Service.create(serviceName);
- service.addPort(portName, SOAPBinding.SOAP11HTTP_BINDING,
endpointAddress.toExternalForm());
+ service.addPort(portName, HTTPBinding.HTTP_BINDING,
endpointAddress.toExternalForm());
JAXBContext jbc = JAXBContext.newInstance(new Class[] { UserType.class });
Dispatch<Object> dispatch = service.createDispatch(portName, jbc,
Mode.PAYLOAD);
return dispatch;
}
- public void testProviderMessage() throws Exception
- {
- String reqString =
- "<env:Envelope
xmlns:env='http://schemas.xmlsoap.org/soap/envelope/'>" +
- " <env:Header/>" +
- " <env:Body>" +
- " <ns1:user
xmlns:ns1='http://org.jboss.ws/provider'>" +
- " <string>Kermit</string>" +
- " <qname>The Frog</qname>" +
- " </ns1:user>" +
- " </env:Body>" +
- "</env:Envelope>";
-
- MessageFactory msgFactory = MessageFactory.newInstance();
- SOAPConnection con = SOAPConnectionFactory.newInstance().createConnection();
- SOAPMessage reqMsg = msgFactory.createMessage(null, new
ByteArrayInputStream(reqString.getBytes()));
-
- URL epURL = new URL("http://" + getServerHost() +
":8080/jaxws-samples-provider-jaxb/ProviderEndpoint");
- SOAPMessage resMsg = con.call(reqMsg, epURL);
- SOAPEnvelope resEnv = resMsg.getSOAPPart().getEnvelope();
-
- Element child = (Element)resEnv.getBody().getChildElements().next();
- JAXBContext jc = JAXBContext.newInstance(new Class[]{UserType.class});
- UserType user = (UserType)jc.createUnmarshaller().unmarshal(new DOMSource(child));
-
- assertEquals("Kermit", user.getString());
- assertEquals(new QName("The Frog"), user.getQname());
- }
}
Deleted:
framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/samples/provider/WebServiceEndpoint.java
===================================================================
---
framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/samples/provider/WebServiceEndpoint.java 2010-09-15
15:26:19 UTC (rev 12979)
+++
framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/samples/provider/WebServiceEndpoint.java 2010-09-15
17:56:09 UTC (rev 12980)
@@ -1,39 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2006, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file 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.provider;
-
-import javax.jws.WebParam;
-import javax.jws.WebResult;
-import javax.jws.WebService;
-import javax.jws.soap.SOAPBinding;
-import javax.jws.soap.SOAPBinding.ParameterStyle;
-
-@WebService(name = "Provider", serviceName = "ProviderService",
portName = "ProviderPort", targetNamespace =
"http://org.jboss.ws/provider", wsdlLocation =
"WEB-INF/wsdl/Provider.wsdl")
-@SOAPBinding(parameterStyle = ParameterStyle.BARE)
-public class WebServiceEndpoint
-{
- @WebResult(name = "user")
- public UserType echo(@WebParam(name = "user") UserType type)
- {
- return type;
- }
-}
Modified:
framework/trunk/testsuite/test/resources/jaxws/samples/provider/jaxb/WEB-INF/web.xml
===================================================================
---
framework/trunk/testsuite/test/resources/jaxws/samples/provider/jaxb/WEB-INF/web.xml 2010-09-15
15:26:19 UTC (rev 12979)
+++
framework/trunk/testsuite/test/resources/jaxws/samples/provider/jaxb/WEB-INF/web.xml 2010-09-15
17:56:09 UTC (rev 12980)
@@ -9,17 +9,9 @@
<servlet-name>ProviderEndpoint</servlet-name>
<servlet-class>org.jboss.test.ws.jaxws.samples.provider.ProviderBeanJAXB</servlet-class>
</servlet>
- <servlet>
- <servlet-name>WebServiceEndpoint</servlet-name>
-
<servlet-class>org.jboss.test.ws.jaxws.samples.provider.WebServiceEndpoint</servlet-class>
- </servlet>
<servlet-mapping>
<servlet-name>ProviderEndpoint</servlet-name>
<url-pattern>/ProviderEndpoint</url-pattern>
</servlet-mapping>
- <servlet-mapping>
- <servlet-name>WebServiceEndpoint</servlet-name>
- <url-pattern>/WebServiceEndpoint</url-pattern>
- </servlet-mapping>
</web-app>
Modified:
framework/trunk/testsuite/test/resources/jaxws/samples/provider/payload/WEB-INF/wsdl/Provider.wsdl
===================================================================
---
framework/trunk/testsuite/test/resources/jaxws/samples/provider/payload/WEB-INF/wsdl/Provider.wsdl 2010-09-15
15:26:19 UTC (rev 12979)
+++
framework/trunk/testsuite/test/resources/jaxws/samples/provider/payload/WEB-INF/wsdl/Provider.wsdl 2010-09-15
17:56:09 UTC (rev 12980)
@@ -1,6 +1,6 @@
<?xml version='1.0'?>
<definitions name='ProviderService'
targetNamespace='http://org.jboss.ws/provider'
xmlns='http://schemas.xmlsoap.org/wsdl/'
-
xmlns:http='http://schemas.xmlsoap.org/wsdl/http/'
xmlns:mime='http://schemas.xmlsoap.org/wsdl/mime/'
xmlns:tns='http://org.jboss.ws/provider'
xmlns:xsd='http://www.w3.org/2001/XMLSchema'>
+
xmlns:soap='http://schemas.xmlsoap.org/wsdl/soap/'
xmlns:tns='http://org.jboss.ws/provider'
xmlns:xsd='http://www.w3.org/2001/XMLSchema'>
<types>
<xs:schema targetNamespace='http://org.jboss.ws/provider'
xmlns:tns='http://org.jboss.ws/provider' version='1.0'
xmlns:xs='http://www.w3.org/2001/XMLSchema'>
<xs:element name='user' type='tns:UserType'/>
@@ -25,20 +25,19 @@
</operation>
</portType>
<binding name='ProviderBinding' type='tns:Provider'>
- <http:binding verb='POST'/>
+ <soap:binding style='document'
transport='http://schemas.xmlsoap.org/soap/http'/>
<operation name='echo'>
- <http:operation location='echo'/>
<input>
- <mime:content type="text/xml"/>
+ <soap:body use='literal'/>
</input>
<output>
- <mime:content type="text/xml"/>
+ <soap:body use='literal'/>
</output>
</operation>
</binding>
<service name='ProviderService'>
<port binding='tns:ProviderBinding' name='ProviderPort'>
- <http:address location='REPLACE_WITH_ACTUAL_URL'/>
+ <soap:address location='REPLACE_WITH_ACTUAL_URL'/>
</port>
</service>
</definitions>
\ No newline at end of file