diff options
Diffstat (limited to '')
8 files changed, 112 insertions, 2 deletions
diff --git a/sandbox/slaws/axis-jaxws-experiment/src/main/java/calculator/AddService.java b/sandbox/slaws/axis-jaxws-experiment/src/main/java/calculator/AddService.java index 188451ebac..d20b890f99 100644 --- a/sandbox/slaws/axis-jaxws-experiment/src/main/java/calculator/AddService.java +++ b/sandbox/slaws/axis-jaxws-experiment/src/main/java/calculator/AddService.java @@ -18,9 +18,12 @@ */ package calculator; +import javax.jws.WebService; + /** * The Add service interface */ +@WebService public interface AddService { double add(double n1, double n2); diff --git a/sandbox/slaws/axis-jaxws-experiment/src/main/java/calculator/AddServiceImpl.java b/sandbox/slaws/axis-jaxws-experiment/src/main/java/calculator/AddServiceImpl.java index b289a20a9f..5318d775d9 100644 --- a/sandbox/slaws/axis-jaxws-experiment/src/main/java/calculator/AddServiceImpl.java +++ b/sandbox/slaws/axis-jaxws-experiment/src/main/java/calculator/AddServiceImpl.java @@ -23,8 +23,6 @@ import java.util.logging.Logger; import javax.jws.WebService; -import org.oasisopen.sca.annotation.Service; - /** * An implementation of the Add service */ diff --git a/sandbox/slaws/axis-jaxws-experiment/src/test/java/test/Client.java b/sandbox/slaws/axis-jaxws-experiment/src/test/java/test/Client.java new file mode 100644 index 0000000000..ac05ce2aea --- /dev/null +++ b/sandbox/slaws/axis-jaxws-experiment/src/test/java/test/Client.java @@ -0,0 +1,46 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +package test; + +import java.net.URL; + +import javax.xml.namespace.QName; +import javax.xml.ws.Endpoint; +import javax.xml.ws.Service; + +import calculator.AddService; +import calculator.AddServiceImpl; + + +public class Client { + + public static void main(String[] args) throws Exception { + + // default JVM JAXWS support + // no need for wsimport first + QName serviceName = new QName("http://calculator/", "AddServiceImplService"); + QName portName = new QName("http://calculator/", "AddServiceImplPort"); + URL wsdlLocation = Client.class.getClassLoader().getResource("AddServiceImplService.wsdl"); + javax.xml.ws.Service webService = Service.create( wsdlLocation, serviceName ); + AddService wsProxy = (AddService) webService.getPort(portName, AddService.class); + System.out.println("Result1 = " + wsProxy.add(1.0, 2.0)); + + } +} diff --git a/sandbox/slaws/axis-jaxws-experiment/src/test/java/test/Service.java b/sandbox/slaws/axis-jaxws-experiment/src/test/java/test/Service.java index b44b0bb050..f8eae8a625 100644 --- a/sandbox/slaws/axis-jaxws-experiment/src/test/java/test/Service.java +++ b/sandbox/slaws/axis-jaxws-experiment/src/test/java/test/Service.java @@ -27,6 +27,9 @@ import calculator.AddServiceImpl; public class Service { public static void main(String[] args) throws Exception { + + // default JVM JAXWS support. + // must have used wsgen first Endpoint.publish("http://localhost:8080/Test/Add", new AddServiceImpl()); diff --git a/sandbox/slaws/axis-jaxws-experiment/src/wsgenout/AddServiceImplService.wsdl b/sandbox/slaws/axis-jaxws-experiment/src/wsgenout/AddServiceImplService.wsdl new file mode 100644 index 0000000000..b07f05ad66 --- /dev/null +++ b/sandbox/slaws/axis-jaxws-experiment/src/wsgenout/AddServiceImplService.wsdl @@ -0,0 +1,39 @@ +<?xml version="1.0" encoding="UTF-8" standalone="yes"?> +<!-- Generated by JAX-WS RI at http://jax-ws.dev.java.net. RI's version is JAX-WS RI 2.1.1 in JDK 6. --> +<definitions targetNamespace="http://calculator/" name="AddServiceImplService" xmlns="http://schemas.xmlsoap.org/wsdl/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:tns="http://calculator/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"> + <types> + <xsd:schema> + <xsd:import namespace="http://calculator/" schemaLocation="AddServiceImplService_schema1.xsd"/> + </xsd:schema> + </types> + <message name="add"> + <part name="parameters" element="tns:add"/> + </message> + <message name="addResponse"> + <part name="parameters" element="tns:addResponse"/> + </message> + <portType name="AddServiceImpl"> + <operation name="add"> + <input message="tns:add"/> + <output message="tns:addResponse"/> + </operation> + </portType> + <binding name="AddServiceImplPortBinding" type="tns:AddServiceImpl"> + <soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="document"/> + <operation name="add"> + <soap:operation soapAction=""/> + <input> + <soap:body use="literal"/> + </input> + <output> + <soap:body use="literal"/> + </output> + </operation> + </binding> + <service name="AddServiceImplService"> + <port name="AddServiceImplPort" binding="tns:AddServiceImplPortBinding"> + <soap:address location="REPLACE_WITH_ACTUAL_URL"/> + </port> + </service> +</definitions> + diff --git a/sandbox/slaws/axis-jaxws-experiment/src/wsgenout/AddServiceImplService_schema1.xsd b/sandbox/slaws/axis-jaxws-experiment/src/wsgenout/AddServiceImplService_schema1.xsd new file mode 100644 index 0000000000..735f19bff3 --- /dev/null +++ b/sandbox/slaws/axis-jaxws-experiment/src/wsgenout/AddServiceImplService_schema1.xsd @@ -0,0 +1,21 @@ +<?xml version="1.0" encoding="UTF-8" standalone="yes"?> +<xs:schema version="1.0" targetNamespace="http://calculator/" xmlns:tns="http://calculator/" xmlns:xs="http://www.w3.org/2001/XMLSchema"> + + <xs:element name="add" type="tns:add"/> + + <xs:element name="addResponse" type="tns:addResponse"/> + + <xs:complexType name="add"> + <xs:sequence> + <xs:element name="arg0" type="xs:double"/> + <xs:element name="arg1" type="xs:double"/> + </xs:sequence> + </xs:complexType> + + <xs:complexType name="addResponse"> + <xs:sequence> + <xs:element name="return" type="xs:double"/> + </xs:sequence> + </xs:complexType> +</xs:schema> + diff --git a/sandbox/slaws/axis-jaxws-experiment/src/wsgenout/calculator/jaxws/Add.class b/sandbox/slaws/axis-jaxws-experiment/src/wsgenout/calculator/jaxws/Add.class Binary files differnew file mode 100644 index 0000000000..b8ddbef0b8 --- /dev/null +++ b/sandbox/slaws/axis-jaxws-experiment/src/wsgenout/calculator/jaxws/Add.class diff --git a/sandbox/slaws/axis-jaxws-experiment/src/wsgenout/calculator/jaxws/AddResponse.class b/sandbox/slaws/axis-jaxws-experiment/src/wsgenout/calculator/jaxws/AddResponse.class Binary files differnew file mode 100644 index 0000000000..e5db5e0e47 --- /dev/null +++ b/sandbox/slaws/axis-jaxws-experiment/src/wsgenout/calculator/jaxws/AddResponse.class |