tuscany-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From n...@apache.org
Subject svn commit: r1210165 [1/2] - in /tuscany/sca-java-1.x/trunk: itest/serialization-ws-basicauth/ itest/serialization-ws-basicauth/src/ itest/serialization-ws-basicauth/src/main/ itest/serialization-ws-basicauth/src/main/java/ itest/serialization-ws-basic...
Date Sun, 04 Dec 2011 18:10:29 GMT
Author: nash
Date: Sun Dec  4 18:10:28 2011
New Revision: 1210165

URL: http://svn.apache.org/viewvc?rev=1210165&view=rev
Log:
TUSCANY-3984: Support binding.ws, interface.wsdl and policySets for serialized service references

Added:
    tuscany/sca-java-1.x/trunk/itest/serialization-ws/   (with props)
    tuscany/sca-java-1.x/trunk/itest/serialization-ws-basicauth/   (with props)
    tuscany/sca-java-1.x/trunk/itest/serialization-ws-basicauth/pom.xml
    tuscany/sca-java-1.x/trunk/itest/serialization-ws-basicauth/src/
    tuscany/sca-java-1.x/trunk/itest/serialization-ws-basicauth/src/main/
    tuscany/sca-java-1.x/trunk/itest/serialization-ws-basicauth/src/main/java/
    tuscany/sca-java-1.x/trunk/itest/serialization-ws-basicauth/src/main/java/helloworld/
    tuscany/sca-java-1.x/trunk/itest/serialization-ws-basicauth/src/main/java/helloworld/HelloWorldImpl.java
    tuscany/sca-java-1.x/trunk/itest/serialization-ws-basicauth/src/main/java/helloworld/HelloWorldService.java
    tuscany/sca-java-1.x/trunk/itest/serialization-ws-basicauth/src/main/java/helloworld/HelloWorldServiceComponent.java
    tuscany/sca-java-1.x/trunk/itest/serialization-ws-basicauth/src/main/resources/
    tuscany/sca-java-1.x/trunk/itest/serialization-ws-basicauth/src/main/resources/definitions.xml
    tuscany/sca-java-1.x/trunk/itest/serialization-ws-basicauth/src/main/resources/helloworldws.composite
    tuscany/sca-java-1.x/trunk/itest/serialization-ws-basicauth/src/main/resources/helloworldwsclient.composite
    tuscany/sca-java-1.x/trunk/itest/serialization-ws-basicauth/src/main/resources/wsdl/
    tuscany/sca-java-1.x/trunk/itest/serialization-ws-basicauth/src/main/resources/wsdl/helloworld.wsdl
    tuscany/sca-java-1.x/trunk/itest/serialization-ws-basicauth/src/test/
    tuscany/sca-java-1.x/trunk/itest/serialization-ws-basicauth/src/test/java/
    tuscany/sca-java-1.x/trunk/itest/serialization-ws-basicauth/src/test/java/helloworld/
    tuscany/sca-java-1.x/trunk/itest/serialization-ws-basicauth/src/test/java/helloworld/HelloWorldClientTestCase.java
    tuscany/sca-java-1.x/trunk/itest/serialization-ws-basicauth/src/test/java/helloworld/HelloWorldTestServer.java
    tuscany/sca-java-1.x/trunk/itest/serialization-ws/pom.xml
    tuscany/sca-java-1.x/trunk/itest/serialization-ws/src/
    tuscany/sca-java-1.x/trunk/itest/serialization-ws/src/main/
    tuscany/sca-java-1.x/trunk/itest/serialization-ws/src/main/java/
    tuscany/sca-java-1.x/trunk/itest/serialization-ws/src/main/java/helloworld/
    tuscany/sca-java-1.x/trunk/itest/serialization-ws/src/main/java/helloworld/ClientPWCBHandler.java
    tuscany/sca-java-1.x/trunk/itest/serialization-ws/src/main/java/helloworld/HelloWorldImpl.java
    tuscany/sca-java-1.x/trunk/itest/serialization-ws/src/main/java/helloworld/HelloWorldService.java
    tuscany/sca-java-1.x/trunk/itest/serialization-ws/src/main/java/helloworld/HelloWorldServiceComponent.java
    tuscany/sca-java-1.x/trunk/itest/serialization-ws/src/main/java/helloworld/ServerPWCBHandler.java
    tuscany/sca-java-1.x/trunk/itest/serialization-ws/src/main/resources/
    tuscany/sca-java-1.x/trunk/itest/serialization-ws/src/main/resources/META-INF/
    tuscany/sca-java-1.x/trunk/itest/serialization-ws/src/main/resources/META-INF/services/
    tuscany/sca-java-1.x/trunk/itest/serialization-ws/src/main/resources/META-INF/services/org.apache.tuscany.sca.policy.util.PolicyHandler
    tuscany/sca-java-1.x/trunk/itest/serialization-ws/src/main/resources/definitions.xml
    tuscany/sca-java-1.x/trunk/itest/serialization-ws/src/main/resources/helloworldKeys.jks   (with props)
    tuscany/sca-java-1.x/trunk/itest/serialization-ws/src/main/resources/helloworldws.composite
    tuscany/sca-java-1.x/trunk/itest/serialization-ws/src/main/resources/helloworldwsclient.composite
    tuscany/sca-java-1.x/trunk/itest/serialization-ws/src/main/resources/wsdl/
    tuscany/sca-java-1.x/trunk/itest/serialization-ws/src/main/resources/wsdl/helloworld.wsdl
    tuscany/sca-java-1.x/trunk/itest/serialization-ws/src/test/
    tuscany/sca-java-1.x/trunk/itest/serialization-ws/src/test/java/
    tuscany/sca-java-1.x/trunk/itest/serialization-ws/src/test/java/helloworld/
    tuscany/sca-java-1.x/trunk/itest/serialization-ws/src/test/java/helloworld/HelloWorldClientTestCase.java
    tuscany/sca-java-1.x/trunk/itest/serialization-ws/src/test/java/helloworld/HelloWorldTestServer.java
    tuscany/sca-java-1.x/trunk/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/BusinessInterface.java
    tuscany/sca-java-1.x/trunk/modules/core/src/main/java/org/apache/tuscany/sca/core/assembly/BusinessInterfaceImpl.java
    tuscany/sca-java-1.x/trunk/modules/core/src/main/java/org/apache/tuscany/sca/core/assembly/BusinessInterfaceProcessor.java
Modified:
    tuscany/sca-java-1.x/trunk/modules/core/src/main/java/org/apache/tuscany/sca/core/context/CallableReferenceImpl.java
    tuscany/sca-java-1.x/trunk/modules/core/src/main/java/org/apache/tuscany/sca/core/context/ComponentContextHelper.java
    tuscany/sca-java-1.x/trunk/modules/core/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor

Propchange: tuscany/sca-java-1.x/trunk/itest/serialization-ws/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Sun Dec  4 18:10:28 2011
@@ -0,0 +1,7 @@
+.classpath
+.project
+.settings
+target
+work
+.externalToolBuilders
+maven-eclipse.xml

Propchange: tuscany/sca-java-1.x/trunk/itest/serialization-ws-basicauth/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Sun Dec  4 18:10:28 2011
@@ -0,0 +1,7 @@
+.classpath
+.project
+.settings
+target
+work
+.externalToolBuilders
+maven-eclipse.xml

Added: tuscany/sca-java-1.x/trunk/itest/serialization-ws-basicauth/pom.xml
URL: http://svn.apache.org/viewvc/tuscany/sca-java-1.x/trunk/itest/serialization-ws-basicauth/pom.xml?rev=1210165&view=auto
==============================================================================
--- tuscany/sca-java-1.x/trunk/itest/serialization-ws-basicauth/pom.xml (added)
+++ tuscany/sca-java-1.x/trunk/itest/serialization-ws-basicauth/pom.xml Sun Dec  4 18:10:28 2011
@@ -0,0 +1,65 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+    * 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.    
+-->
+<project>
+    <modelVersion>4.0.0</modelVersion>
+    <parent>
+        <groupId>org.apache.tuscany.sca</groupId>
+        <artifactId>tuscany-itest</artifactId>
+        <version>1.7-SNAPSHOT</version>
+        <relativePath>../pom.xml</relativePath>
+    </parent>
+    <artifactId>itest-serialization-ws-basicauth</artifactId>
+    <name>Apache Tuscany SCA iTest Serialized Service Reference Using HTTP Basic Auth</name>
+
+    <dependencies>
+        <dependency>
+            <groupId>org.apache.tuscany.sca</groupId>
+            <artifactId>tuscany-host-embedded</artifactId>
+            <version>1.7-SNAPSHOT</version>
+        </dependency>
+        
+        <dependency>
+            <groupId>org.apache.ws.security</groupId>
+            <artifactId>wss4j</artifactId>
+            <version>1.5.3</version>
+        </dependency>
+
+        <dependency>
+            <groupId>org.apache.tuscany.sca</groupId>
+            <artifactId>tuscany-implementation-java-runtime</artifactId>
+            <version>1.7-SNAPSHOT</version>
+            <scope>runtime</scope>
+        </dependency>       
+        
+        <dependency>
+            <groupId>org.apache.tuscany.sca</groupId>
+            <artifactId>tuscany-host-tomcat</artifactId>
+            <version>1.7-SNAPSHOT</version>
+            <scope>test</scope>
+        </dependency>  
+           
+        <dependency>
+            <groupId>org.apache.tuscany.sca</groupId>
+            <artifactId>tuscany-binding-ws-axis2</artifactId>
+            <version>1.7-SNAPSHOT</version>
+            <scope>test</scope>
+        </dependency>         
+    </dependencies>
+</project>

Added: tuscany/sca-java-1.x/trunk/itest/serialization-ws-basicauth/src/main/java/helloworld/HelloWorldImpl.java
URL: http://svn.apache.org/viewvc/tuscany/sca-java-1.x/trunk/itest/serialization-ws-basicauth/src/main/java/helloworld/HelloWorldImpl.java?rev=1210165&view=auto
==============================================================================
--- tuscany/sca-java-1.x/trunk/itest/serialization-ws-basicauth/src/main/java/helloworld/HelloWorldImpl.java (added)
+++ tuscany/sca-java-1.x/trunk/itest/serialization-ws-basicauth/src/main/java/helloworld/HelloWorldImpl.java Sun Dec  4 18:10:28 2011
@@ -0,0 +1,33 @@
+/*
+ * 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 helloworld;
+
+import org.osoa.sca.annotations.Service;
+
+/**
+ * This class implements the HelloWorld service.
+ */
+@Service(HelloWorldService.class)
+public class HelloWorldImpl implements HelloWorldService {
+
+    public String getGreetings(String name) {
+        return "Hello " + name;
+    }
+
+}

Added: tuscany/sca-java-1.x/trunk/itest/serialization-ws-basicauth/src/main/java/helloworld/HelloWorldService.java
URL: http://svn.apache.org/viewvc/tuscany/sca-java-1.x/trunk/itest/serialization-ws-basicauth/src/main/java/helloworld/HelloWorldService.java?rev=1210165&view=auto
==============================================================================
--- tuscany/sca-java-1.x/trunk/itest/serialization-ws-basicauth/src/main/java/helloworld/HelloWorldService.java (added)
+++ tuscany/sca-java-1.x/trunk/itest/serialization-ws-basicauth/src/main/java/helloworld/HelloWorldService.java Sun Dec  4 18:10:28 2011
@@ -0,0 +1,29 @@
+/*
+ * 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 helloworld;
+
+import org.osoa.sca.annotations.Remotable;
+
+/**
+ * The interface for the helloworld service
+ */
+@Remotable
+public interface HelloWorldService {
+    public String getGreetings(String name);
+}

Added: tuscany/sca-java-1.x/trunk/itest/serialization-ws-basicauth/src/main/java/helloworld/HelloWorldServiceComponent.java
URL: http://svn.apache.org/viewvc/tuscany/sca-java-1.x/trunk/itest/serialization-ws-basicauth/src/main/java/helloworld/HelloWorldServiceComponent.java?rev=1210165&view=auto
==============================================================================
--- tuscany/sca-java-1.x/trunk/itest/serialization-ws-basicauth/src/main/java/helloworld/HelloWorldServiceComponent.java (added)
+++ tuscany/sca-java-1.x/trunk/itest/serialization-ws-basicauth/src/main/java/helloworld/HelloWorldServiceComponent.java Sun Dec  4 18:10:28 2011
@@ -0,0 +1,80 @@
+/*
+ * 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 helloworld;
+
+import java.io.IOException;
+import java.io.StringReader;
+import javax.xml.stream.XMLInputFactory;
+import javax.xml.stream.XMLStreamReader;
+import org.apache.tuscany.sca.core.context.ServiceReferenceImpl;
+import org.osoa.sca.ServiceReference;
+import org.osoa.sca.annotations.Reference;
+
+/**
+ * The HelloWorld service implementation
+ */
+public class HelloWorldServiceComponent implements HelloWorldService {
+
+    ServiceReference<HelloWorldService> helloWorldService;
+
+    public String getGreetings(String name) {
+        System.out.println("Called getGreetings");
+        //return helloWorldService.getService().getGreetings(name);
+        String xml = null;
+        try {
+            xml = serializeServiceReferenceXML(helloWorldService);
+        } catch (IOException e) {
+            e.printStackTrace();
+            return "serialization failure";
+        }
+        System.out.println(xml);
+        ServiceReference<HelloWorldService> srCopy = null;
+        try {
+            srCopy = deserializeServiceReferenceXML(xml);
+        } catch (Exception e) {
+            e.printStackTrace();
+            return "deserialization failure";
+        }
+        return srCopy.getService().getGreetings(name);
+    }
+
+    private String serializeServiceReferenceXML(ServiceReference<HelloWorldService> sr) throws IOException {
+        ServiceReferenceImpl<HelloWorldService> sri = (ServiceReferenceImpl<HelloWorldService>) sr;
+        return sri.toXMLString();
+    }
+
+    private ServiceReference<HelloWorldService> deserializeServiceReferenceXML(String serializedSR) throws Exception {
+        StringReader reader = new StringReader(serializedSR);
+        XMLStreamReader xmlReader = XMLInputFactory.newInstance().createXMLStreamReader(reader);
+        ServiceReferenceImpl<HelloWorldService> sri
+            = new ServiceReferenceImpl<HelloWorldService>(/*HelloWorldService.class, */xmlReader);
+        return sri;
+    }
+
+    public ServiceReference<HelloWorldService> getHelloWorldService() {
+        System.out.println("Got Injected helloWorldService");
+        return helloWorldService;
+    }
+
+    @Reference
+    public void setHelloWorldService(ServiceReference<HelloWorldService> helloWorldService) {
+        System.out.println("Injected helloWorldService");        
+        this.helloWorldService = helloWorldService;
+    }
+}
\ No newline at end of file

Added: tuscany/sca-java-1.x/trunk/itest/serialization-ws-basicauth/src/main/resources/definitions.xml
URL: http://svn.apache.org/viewvc/tuscany/sca-java-1.x/trunk/itest/serialization-ws-basicauth/src/main/resources/definitions.xml?rev=1210165&view=auto
==============================================================================
--- tuscany/sca-java-1.x/trunk/itest/serialization-ws-basicauth/src/main/resources/definitions.xml (added)
+++ tuscany/sca-java-1.x/trunk/itest/serialization-ws-basicauth/src/main/resources/definitions.xml Sun Dec  4 18:10:28 2011
@@ -0,0 +1,25 @@
+<?xml version="1.0" encoding="ASCII"?>
+<definitions xmlns="http://www.osoa.org/xmlns/sca/1.0"
+             targetNamespace="http://helloworld"
+             xmlns:sca="http://www.osoa.org/xmlns/sca/1.0"
+             xmlns:tuscany="http://tuscany.apache.org/xmlns/sca/1.0" >
+
+    <sca:policySet name="ClientBasicAuthenticationPolicySet"
+                   provides="authentication"
+                   appliesTo="sca:reference/sca:binding.ws">
+        <tuscany:basicAuthentication>
+          <tuscany:userName>TuscanyWsUser</tuscany:userName>
+          <tuscany:password>TuscanyWsUserPasswd</tuscany:password>
+        </tuscany:basicAuthentication>
+    </sca:policySet>
+
+    <sca:policySet name="ServerBasicAuthenticationPolicySet"
+                   provides="authentication"
+                   appliesTo="sca:service/sca:binding.ws">
+        <tuscany:basicAuthentication>
+          <tuscany:userName>TuscanyWsUser</tuscany:userName>
+          <tuscany:password>TuscanyWsUserPasswd</tuscany:password>
+        </tuscany:basicAuthentication>
+    </sca:policySet>
+
+</definitions>

Added: tuscany/sca-java-1.x/trunk/itest/serialization-ws-basicauth/src/main/resources/helloworldws.composite
URL: http://svn.apache.org/viewvc/tuscany/sca-java-1.x/trunk/itest/serialization-ws-basicauth/src/main/resources/helloworldws.composite?rev=1210165&view=auto
==============================================================================
--- tuscany/sca-java-1.x/trunk/itest/serialization-ws-basicauth/src/main/resources/helloworldws.composite (added)
+++ tuscany/sca-java-1.x/trunk/itest/serialization-ws-basicauth/src/main/resources/helloworldws.composite Sun Dec  4 18:10:28 2011
@@ -0,0 +1,35 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+    * 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.    
+-->
+<composite xmlns="http://www.osoa.org/xmlns/sca/1.0"
+	targetNamespace="http://helloworld"
+	xmlns:sca="http://www.osoa.org/xmlns/sca/1.0"
+	xmlns:hw="http://helloworld"
+    name="helloworldws">
+
+	<service name="HelloWorldService" requires="authentication" promote="HelloWorldServiceComponent/HelloWorldService">
+        <interface.wsdl interface="http://helloworld#wsdl.interface(HelloWorld)" />
+        <binding.ws uri="http://localhost:8085/HelloWorldService"/>
+    </service>
+
+    <component name="HelloWorldServiceComponent">
+        <implementation.java class="helloworld.HelloWorldImpl" />
+    </component>
+
+</composite>
\ No newline at end of file

Added: tuscany/sca-java-1.x/trunk/itest/serialization-ws-basicauth/src/main/resources/helloworldwsclient.composite
URL: http://svn.apache.org/viewvc/tuscany/sca-java-1.x/trunk/itest/serialization-ws-basicauth/src/main/resources/helloworldwsclient.composite?rev=1210165&view=auto
==============================================================================
--- tuscany/sca-java-1.x/trunk/itest/serialization-ws-basicauth/src/main/resources/helloworldwsclient.composite (added)
+++ tuscany/sca-java-1.x/trunk/itest/serialization-ws-basicauth/src/main/resources/helloworldwsclient.composite Sun Dec  4 18:10:28 2011
@@ -0,0 +1,37 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * 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.    
+-->
+<composite xmlns="http://www.osoa.org/xmlns/sca/1.0"
+	targetNamespace="http://helloworld"
+	xmlns:hw="http://helloworld"
+	xmlns:sca="http://www.osoa.org/xmlns/sca/1.0"
+	name="helloworldwsclient">
+    
+    <!-- A component with an embedded reference definition connecting to an external webservice 
+         The wsdl interface for the reference is derived from the information specified by the 'wsdlElement'
+     -->
+    <component name="HelloTuscanyServiceComponent">
+      <implementation.java class="helloworld.HelloWorldServiceComponent"/>
+      <reference name="helloWorldService" requires="authentication">
+        <interface.wsdl interface="http://helloworld#wsdl.interface(HelloWorld)"/>
+        <binding.ws wsdlElement="http://helloworld#wsdl.port(HelloWorldService/HelloWorldSoapPort)"/>
+      </reference>
+    </component>
+
+</composite>

Added: tuscany/sca-java-1.x/trunk/itest/serialization-ws-basicauth/src/main/resources/wsdl/helloworld.wsdl
URL: http://svn.apache.org/viewvc/tuscany/sca-java-1.x/trunk/itest/serialization-ws-basicauth/src/main/resources/wsdl/helloworld.wsdl?rev=1210165&view=auto
==============================================================================
--- tuscany/sca-java-1.x/trunk/itest/serialization-ws-basicauth/src/main/resources/wsdl/helloworld.wsdl (added)
+++ tuscany/sca-java-1.x/trunk/itest/serialization-ws-basicauth/src/main/resources/wsdl/helloworld.wsdl Sun Dec  4 18:10:28 2011
@@ -0,0 +1,85 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * 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.    
+-->
+<wsdl:definitions targetNamespace="http://helloworld" xmlns:tns="http://helloworld" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+	name="helloworld">
+
+    <wsdl:types>
+        <schema elementFormDefault="qualified" targetNamespace="http://helloworld" xmlns="http://www.w3.org/2001/XMLSchema">
+
+            <element name="getGreetings">
+                <complexType>
+                    <sequence>
+                        <element name="name" type="xsd:string"/>
+                    </sequence>
+                </complexType>
+            </element>
+
+            <element name="getGreetingsResponse">
+                <complexType>
+                    <sequence>
+                        <element name="getGreetingsReturn" type="xsd:string"/>
+                    </sequence>
+                </complexType>
+            </element>
+            
+        </schema>
+    </wsdl:types>
+
+    <wsdl:message name="getGreetingsRequest">
+        <wsdl:part element="tns:getGreetings" name="parameters"/>
+    </wsdl:message>
+
+    <wsdl:message name="getGreetingsResponse">
+        <wsdl:part element="tns:getGreetingsResponse" name="parameters"/>
+    </wsdl:message>
+
+    <wsdl:portType name="HelloWorld">
+        <wsdl:operation name="getGreetings">
+            <wsdl:input message="tns:getGreetingsRequest" name="getGreetingsRequest"/>
+            <wsdl:output message="tns:getGreetingsResponse" name="getGreetingsResponse"/>
+        </wsdl:operation>
+    </wsdl:portType>
+
+    <wsdl:binding name="HelloWorldSoapBinding" type="tns:HelloWorld">
+        <wsdlsoap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
+        <wsdl:operation name="getGreetings">
+            <wsdlsoap:operation soapAction=""/>
+            <wsdl:input name="getGreetingsRequest">
+                <wsdlsoap:body use="literal"/>
+            </wsdl:input>
+            <wsdl:output name="getGreetingsResponse">
+                <wsdlsoap:body use="literal"/>
+            </wsdl:output>
+        </wsdl:operation>
+    </wsdl:binding>
+
+    <wsdl:service name="HelloWorldService">
+        <wsdl:port binding="tns:HelloWorldSoapBinding" name="HelloWorldSoapPort">
+            <wsdlsoap:address location="http://localhost:8085/HelloWorldService"/>
+        </wsdl:port>
+    </wsdl:service>
+    
+    <wsdl:service name="HelloWorldWsPolicyService">
+        <wsdl:port binding="tns:HelloWorldSoapBinding" name="HelloWorldSoapPort">
+            <wsdlsoap:address location="http://localhost:8085/HelloWorldWsPolicyService"/>
+        </wsdl:port>
+    </wsdl:service>
+
+</wsdl:definitions>

Added: tuscany/sca-java-1.x/trunk/itest/serialization-ws-basicauth/src/test/java/helloworld/HelloWorldClientTestCase.java
URL: http://svn.apache.org/viewvc/tuscany/sca-java-1.x/trunk/itest/serialization-ws-basicauth/src/test/java/helloworld/HelloWorldClientTestCase.java?rev=1210165&view=auto
==============================================================================
--- tuscany/sca-java-1.x/trunk/itest/serialization-ws-basicauth/src/test/java/helloworld/HelloWorldClientTestCase.java (added)
+++ tuscany/sca-java-1.x/trunk/itest/serialization-ws-basicauth/src/test/java/helloworld/HelloWorldClientTestCase.java Sun Dec  4 18:10:28 2011
@@ -0,0 +1,66 @@
+/*
+ * 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 helloworld;
+
+import junit.framework.Assert;
+
+import org.apache.tuscany.sca.host.embedded.SCADomain;
+import org.apache.tuscany.sca.host.embedded.SCATestCaseRunner;
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+
+/**
+ * Test case for helloworld web service client 
+ */
+public class HelloWorldClientTestCase {
+
+    private HelloWorldService helloTuscanyService;
+    private SCADomain scaDomain;
+    
+    private SCATestCaseRunner server;
+
+    @Before
+    public void startClient() throws Exception {
+        try {
+            scaDomain = SCADomain.newInstance("helloworldwsclient.composite");
+            helloTuscanyService = scaDomain.getService(HelloWorldService.class, "HelloTuscanyServiceComponent");
+    
+            server =  new SCATestCaseRunner(HelloWorldTestServer.class);
+            server.before();
+
+        } catch (Throwable e) {
+            e.printStackTrace();
+        }
+    }
+    
+    @Test
+    public void testEmbeddedReferenceClient() throws Exception {
+        String msg = helloTuscanyService.getGreetings("Tuscany");
+        Assert.assertEquals("Hello Tuscany", msg);
+    }
+    
+    @After
+    public void stopClient() throws Exception {
+    	server.after();
+        scaDomain.close();
+    }
+
+}

Added: tuscany/sca-java-1.x/trunk/itest/serialization-ws-basicauth/src/test/java/helloworld/HelloWorldTestServer.java
URL: http://svn.apache.org/viewvc/tuscany/sca-java-1.x/trunk/itest/serialization-ws-basicauth/src/test/java/helloworld/HelloWorldTestServer.java?rev=1210165&view=auto
==============================================================================
--- tuscany/sca-java-1.x/trunk/itest/serialization-ws-basicauth/src/test/java/helloworld/HelloWorldTestServer.java (added)
+++ tuscany/sca-java-1.x/trunk/itest/serialization-ws-basicauth/src/test/java/helloworld/HelloWorldTestServer.java Sun Dec  4 18:10:28 2011
@@ -0,0 +1,55 @@
+/*
+ * 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 helloworld;
+
+import java.io.IOException;
+import java.net.Socket;
+
+import org.apache.tuscany.sca.host.embedded.SCADomain;
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+
+/**
+ * Starts up the SCA runtime which starts listening for service requests
+ */
+public class HelloWorldTestServer {
+
+    private SCADomain scaDomain;
+
+        @Before
+	public void startServer() throws Exception {
+            try {
+                scaDomain = SCADomain.newInstance("helloworldws.composite");
+            } catch (Exception e) {
+                e.printStackTrace();
+            }
+	}
+
+	@Test
+	public void testPing() throws IOException {
+		new Socket("127.0.0.1", 8085);
+	}
+
+	@After
+	public void stopServer() throws Exception {
+            scaDomain.close();
+	}
+
+}

Added: tuscany/sca-java-1.x/trunk/itest/serialization-ws/pom.xml
URL: http://svn.apache.org/viewvc/tuscany/sca-java-1.x/trunk/itest/serialization-ws/pom.xml?rev=1210165&view=auto
==============================================================================
--- tuscany/sca-java-1.x/trunk/itest/serialization-ws/pom.xml (added)
+++ tuscany/sca-java-1.x/trunk/itest/serialization-ws/pom.xml Sun Dec  4 18:10:28 2011
@@ -0,0 +1,87 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+    * 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.    
+-->
+<project>
+    <modelVersion>4.0.0</modelVersion>
+    <parent>
+        <groupId>org.apache.tuscany.sca</groupId>
+        <artifactId>tuscany-itest</artifactId>
+        <version>1.7-SNAPSHOT</version>
+        <relativePath>../pom.xml</relativePath>
+    </parent>
+    <artifactId>itest-serialization-ws</artifactId>
+    <name>Apache Tuscany SCA iTest Serialized Service Reference Using Web Services</name>
+
+    <dependencies>
+        <dependency>
+            <groupId>org.apache.tuscany.sca</groupId>
+            <artifactId>tuscany-host-embedded</artifactId>
+            <version>1.7-SNAPSHOT</version>
+        </dependency>
+
+        <dependency>
+            <groupId>org.apache.ws.security</groupId>
+            <artifactId>wss4j</artifactId>
+            <version>1.5.4</version>
+            <exclusions>
+                <exclusion>
+                    <groupId>org.apache.santuario</groupId>
+                    <artifactId>xmlsec</artifactId>
+                </exclusion>
+                <exclusion>
+                    <groupId>bouncycastle</groupId>
+                    <artifactId>bcprov-jdk13</artifactId>
+                </exclusion>
+                <exclusion>
+                    <groupId>bouncycastle</groupId>
+                    <artifactId>bcprov-jdk15</artifactId>
+                </exclusion>
+                <exclusion>
+                    <groupId>opensaml</groupId>
+                    <artifactId>opensaml</artifactId>
+                </exclusion>
+                <exclusion>
+                    <groupId>junit</groupId>
+                    <artifactId>junit</artifactId>
+                </exclusion>
+            </exclusions>
+        </dependency>
+
+        <dependency>
+            <groupId>org.apache.tuscany.sca</groupId>
+            <artifactId>tuscany-implementation-java-runtime</artifactId>
+            <version>1.7-SNAPSHOT</version>
+            <scope>runtime</scope>
+        </dependency>       
+        
+        <dependency>
+            <groupId>org.apache.tuscany.sca</groupId>
+            <artifactId>tuscany-host-tomcat</artifactId>
+            <version>1.7-SNAPSHOT</version>
+            <scope>test</scope>
+        </dependency>  
+           
+        <dependency>
+            <groupId>org.apache.tuscany.sca</groupId>
+            <artifactId>tuscany-binding-ws-axis2</artifactId>
+            <version>1.7-SNAPSHOT</version>
+            <scope>test</scope>
+        </dependency>         
+    </dependencies>
+</project>

Added: tuscany/sca-java-1.x/trunk/itest/serialization-ws/src/main/java/helloworld/ClientPWCBHandler.java
URL: http://svn.apache.org/viewvc/tuscany/sca-java-1.x/trunk/itest/serialization-ws/src/main/java/helloworld/ClientPWCBHandler.java?rev=1210165&view=auto
==============================================================================
--- tuscany/sca-java-1.x/trunk/itest/serialization-ws/src/main/java/helloworld/ClientPWCBHandler.java (added)
+++ tuscany/sca-java-1.x/trunk/itest/serialization-ws/src/main/java/helloworld/ClientPWCBHandler.java Sun Dec  4 18:10:28 2011
@@ -0,0 +1,45 @@
+/*
+ * 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 helloworld;
+
+import java.io.IOException;
+
+import javax.security.auth.callback.Callback;
+import javax.security.auth.callback.CallbackHandler;
+import javax.security.auth.callback.UnsupportedCallbackException;
+
+import org.apache.ws.security.WSPasswordCallback;
+
+/**
+ * Sample userid passwd generation class
+ */
+public class ClientPWCBHandler implements CallbackHandler {
+
+    public void handle(Callback[] callbacks) throws IOException,
+            UnsupportedCallbackException {
+        for (int i = 0; i < callbacks.length; i++) {
+        	System.out.println("*** Calling Client UserId/Password Handler .... ");
+            WSPasswordCallback pwcb = (WSPasswordCallback)callbacks[i];
+            System.out.println("User Id = " + pwcb.getIdentifer());
+            pwcb.setPassword("TuscanyWsUserPasswd");
+            System.out.println("Set Password = " + pwcb.getPassword());
+        }
+    }
+
+}

Added: tuscany/sca-java-1.x/trunk/itest/serialization-ws/src/main/java/helloworld/HelloWorldImpl.java
URL: http://svn.apache.org/viewvc/tuscany/sca-java-1.x/trunk/itest/serialization-ws/src/main/java/helloworld/HelloWorldImpl.java?rev=1210165&view=auto
==============================================================================
--- tuscany/sca-java-1.x/trunk/itest/serialization-ws/src/main/java/helloworld/HelloWorldImpl.java (added)
+++ tuscany/sca-java-1.x/trunk/itest/serialization-ws/src/main/java/helloworld/HelloWorldImpl.java Sun Dec  4 18:10:28 2011
@@ -0,0 +1,33 @@
+/*
+ * 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 helloworld;
+
+import org.osoa.sca.annotations.Service;
+
+/**
+ * This class implements the HelloWorld service.
+ */
+@Service(HelloWorldService.class)
+public class HelloWorldImpl implements HelloWorldService {
+
+    public String getGreetings(String name) {
+        return "Hello " + name;
+    }
+
+}

Added: tuscany/sca-java-1.x/trunk/itest/serialization-ws/src/main/java/helloworld/HelloWorldService.java
URL: http://svn.apache.org/viewvc/tuscany/sca-java-1.x/trunk/itest/serialization-ws/src/main/java/helloworld/HelloWorldService.java?rev=1210165&view=auto
==============================================================================
--- tuscany/sca-java-1.x/trunk/itest/serialization-ws/src/main/java/helloworld/HelloWorldService.java (added)
+++ tuscany/sca-java-1.x/trunk/itest/serialization-ws/src/main/java/helloworld/HelloWorldService.java Sun Dec  4 18:10:28 2011
@@ -0,0 +1,29 @@
+/*
+ * 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 helloworld;
+
+import org.osoa.sca.annotations.Remotable;
+
+/**
+ * The interface for the helloworld service
+ */
+@Remotable
+public interface HelloWorldService {
+    public String getGreetings(String name);
+}

Added: tuscany/sca-java-1.x/trunk/itest/serialization-ws/src/main/java/helloworld/HelloWorldServiceComponent.java
URL: http://svn.apache.org/viewvc/tuscany/sca-java-1.x/trunk/itest/serialization-ws/src/main/java/helloworld/HelloWorldServiceComponent.java?rev=1210165&view=auto
==============================================================================
--- tuscany/sca-java-1.x/trunk/itest/serialization-ws/src/main/java/helloworld/HelloWorldServiceComponent.java (added)
+++ tuscany/sca-java-1.x/trunk/itest/serialization-ws/src/main/java/helloworld/HelloWorldServiceComponent.java Sun Dec  4 18:10:28 2011
@@ -0,0 +1,78 @@
+/*
+ * 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 helloworld;
+
+import java.io.IOException;
+import java.io.StringReader;
+import javax.xml.stream.XMLInputFactory;
+import javax.xml.stream.XMLStreamReader;
+import org.apache.tuscany.sca.core.context.ServiceReferenceImpl;
+import org.osoa.sca.ServiceReference;
+import org.osoa.sca.annotations.Reference;
+
+/**
+ * The HelloWorld service implementation
+ */
+public class HelloWorldServiceComponent implements HelloWorldService {
+
+    ServiceReference<HelloWorldService> helloWorldService;
+
+    public String getGreetings(String name) {
+        System.out.println("Called getGreetings");
+        String xml = null;
+        try {
+            xml = serializeServiceReferenceXML(helloWorldService);
+        } catch (IOException e) {
+            e.printStackTrace();
+            return "serialization failure";
+        }
+        System.out.println(xml);
+        ServiceReference<HelloWorldService> srCopy = null;
+        try {
+            srCopy = deserializeServiceReferenceXML(xml);
+        } catch (Exception e) {
+            e.printStackTrace();
+            return "deserialization failure";
+        }
+        return srCopy.getService().getGreetings(name);
+    }
+
+    public ServiceReference<HelloWorldService> getHelloWorldService() {
+        System.out.println("Got Injected helloWorldService");
+        return helloWorldService;
+    }
+
+    @Reference
+    public void setHelloWorldService(ServiceReference<HelloWorldService> helloWorldService) {
+        System.out.println("Injected helloWorldService");        
+        this.helloWorldService = helloWorldService;
+    }
+
+    private String serializeServiceReferenceXML(ServiceReference<HelloWorldService> sr) throws IOException {
+        ServiceReferenceImpl<HelloWorldService> sri = (ServiceReferenceImpl<HelloWorldService>) sr;
+        return sri.toXMLString();
+    }
+
+    private ServiceReference<HelloWorldService> deserializeServiceReferenceXML(String serializedSR) throws Exception {
+        StringReader reader = new StringReader(serializedSR);
+        XMLStreamReader xmlReader = XMLInputFactory.newInstance().createXMLStreamReader(reader);
+        ServiceReferenceImpl<HelloWorldService> sri = new ServiceReferenceImpl<HelloWorldService>(xmlReader);
+        return sri;
+    }
+}

Added: tuscany/sca-java-1.x/trunk/itest/serialization-ws/src/main/java/helloworld/ServerPWCBHandler.java
URL: http://svn.apache.org/viewvc/tuscany/sca-java-1.x/trunk/itest/serialization-ws/src/main/java/helloworld/ServerPWCBHandler.java?rev=1210165&view=auto
==============================================================================
--- tuscany/sca-java-1.x/trunk/itest/serialization-ws/src/main/java/helloworld/ServerPWCBHandler.java (added)
+++ tuscany/sca-java-1.x/trunk/itest/serialization-ws/src/main/java/helloworld/ServerPWCBHandler.java Sun Dec  4 18:10:28 2011
@@ -0,0 +1,55 @@
+/*
+ * 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 helloworld;
+
+import java.io.IOException;
+
+import javax.security.auth.callback.Callback;
+import javax.security.auth.callback.CallbackHandler;
+import javax.security.auth.callback.UnsupportedCallbackException;
+
+import org.apache.ws.security.WSPasswordCallback;
+
+/**
+ * Sample userid passwd generation class 
+ */
+public class ServerPWCBHandler implements CallbackHandler {
+
+    public void handle(Callback[] callbacks) throws IOException,
+            UnsupportedCallbackException {
+    	for (int i = 0; i < callbacks.length; i++) {
+            System.out.println("*** Calling Server User/Passwd Handler....");
+            WSPasswordCallback pwcb = (WSPasswordCallback)callbacks[i];
+            System.out.println("User Id = " + pwcb.getIdentifer());
+            System.out.println("Password = " + pwcb.getPassword());
+            
+            if ( pwcb.getUsage() == WSPasswordCallback.USERNAME_TOKEN ) {
+                if ( pwcb.getIdentifer().equals("TuscanyWsUser") &&
+                        pwcb.getPassword().equals("TuscanyWsUserPasswd") ){
+                            return;
+                } else {
+                    throw new UnsupportedCallbackException(pwcb, "Authentication Failed : UserId - Password mismatch");
+                }
+            } else if ( pwcb.getUsage() == WSPasswordCallback.SIGNATURE ) {
+                pwcb.setPassword("TuscanyWsUserPasswd");
+            }
+        }
+    }
+
+}

Added: tuscany/sca-java-1.x/trunk/itest/serialization-ws/src/main/resources/META-INF/services/org.apache.tuscany.sca.policy.util.PolicyHandler
URL: http://svn.apache.org/viewvc/tuscany/sca-java-1.x/trunk/itest/serialization-ws/src/main/resources/META-INF/services/org.apache.tuscany.sca.policy.util.PolicyHandler?rev=1210165&view=auto
==============================================================================
--- tuscany/sca-java-1.x/trunk/itest/serialization-ws/src/main/resources/META-INF/services/org.apache.tuscany.sca.policy.util.PolicyHandler (added)
+++ tuscany/sca-java-1.x/trunk/itest/serialization-ws/src/main/resources/META-INF/services/org.apache.tuscany.sca.policy.util.PolicyHandler Sun Dec  4 18:10:28 2011
@@ -0,0 +1,21 @@
+# 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.
+# 
+# PolicyHandlerClasses to interpret specific PolicyModels against specific QoS infrastructures
+# handler classname;qname=<policy intent addressed>;model=<policy model class>
+org.apache.tuscany.sca.policy.security.ws.Axis2ConfigParamPolicyHandler;intent=http://helloworld#wsAuthentication,model=org.apache.tuscany.sca.policy.security.ws.Axis2ConfigParamPolicy
+org.apache.tuscany.sca.policy.security.ws.WSSecurityPolicyHandler;intent=http://helloworld#wsIntegrity,model=org.apache.neethi.Policy
\ No newline at end of file

Added: tuscany/sca-java-1.x/trunk/itest/serialization-ws/src/main/resources/definitions.xml
URL: http://svn.apache.org/viewvc/tuscany/sca-java-1.x/trunk/itest/serialization-ws/src/main/resources/definitions.xml?rev=1210165&view=auto
==============================================================================
--- tuscany/sca-java-1.x/trunk/itest/serialization-ws/src/main/resources/definitions.xml (added)
+++ tuscany/sca-java-1.x/trunk/itest/serialization-ws/src/main/resources/definitions.xml Sun Dec  4 18:10:28 2011
@@ -0,0 +1,203 @@
+<?xml version="1.0" encoding="ASCII"?>
+<!--
+ * 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.    
+-->
+<sca:definitions xmlns="http://www.osoa.org/xmlns/sca/1.0"
+            targetNamespace="http://helloworld"
+ 			xmlns:sca="http://www.osoa.org/xmlns/sca/1.0"
+ 			xmlns:tuscany="http://tuscany.apache.org/xmlns/sca/1.0"
+ 			xmlns:hw="http://helloworld">
+ 
+ <!-- WS Security POLICY SETS -->
+ <sca:policySet name="wsClientAuthenticationPolicy"
+ 	provides="authentication"
+ 	appliesTo="sca:reference/sca:binding.ws">
+ 	<tuscany:wsConfigParam>
+ 		<parameter name="OutflowSecurity">
+ 			<action>
+ 				<items>UsernameToken</items>
+ 				<user>TuscanyWsUser</user>
+				<passwordCallbackClass>helloworld.ClientPWCBHandler</passwordCallbackClass>" +
+                <passwordType>PasswordText</passwordType>
+               </action>
+    	</parameter>
+ 	</tuscany:wsConfigParam>
+ </sca:policySet>
+ 
+ <!-- A policyset that uses WS Policy --> 
+ <sca:policySet name="wsSecurityPolicyForIntegrity"
+ 	provides="integrity"
+ 	appliesTo="sca:reference/sca:binding.ws">
+ 	<wsp:Policy wsu:Id="SignOnly" 
+ 		xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" 
+ 		xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy">
+		<wsp:ExactlyOne>
+			<wsp:All>
+				<sp:AsymmetricBinding xmlns:sp="http://schemas.xmlsoap.org/ws/2005/07/securitypolicy">
+					<wsp:Policy>
+						<sp:InitiatorToken>
+							<wsp:Policy>
+								<sp:X509Token sp:IncludeToken="http://schemas.xmlsoap.org/ws/2005/07/securitypolicy/IncludeToken/AlwaysToRecipient">
+									<wsp:Policy>
+										<sp:WssX509V3Token10/>
+									</wsp:Policy>
+								</sp:X509Token>
+							</wsp:Policy>
+						</sp:InitiatorToken>
+						<sp:RecipientToken>
+							<wsp:Policy>
+								<sp:X509Token sp:IncludeToken="http://schemas.xmlsoap.org/ws/2005/07/securitypolicy/IncludeToken/Never">
+									<wsp:Policy>
+										<sp:WssX509V3Token10/>
+									</wsp:Policy>
+								</sp:X509Token>
+							</wsp:Policy>
+						</sp:RecipientToken>
+						<sp:AlgorithmSuite>
+							<wsp:Policy>
+								<sp:TripleDesRsa15/>
+							</wsp:Policy>
+						</sp:AlgorithmSuite>
+						<sp:Layout>
+							<wsp:Policy>
+								<sp:Strict/>
+							</wsp:Policy>
+						</sp:Layout>
+						<sp:IncludeTimestamp/>
+						<sp:OnlySignEntireHeadersAndBody/>
+					</wsp:Policy>
+				</sp:AsymmetricBinding>
+				<sp:Wss10 xmlns:sp="http://schemas.xmlsoap.org/ws/2005/07/securitypolicy">
+					<wsp:Policy>
+						<sp:MustSupportRefKeyIdentifier/>
+						<sp:MustSupportRefIssuerSerial/>
+					</wsp:Policy>
+				</sp:Wss10>
+				<sp:SignedParts xmlns:sp="http://schemas.xmlsoap.org/ws/2005/07/securitypolicy">
+					<sp:Body/>
+				</sp:SignedParts>
+	
+				<ramp:RampartConfig xmlns:ramp="http://ws.apache.org/rampart/policy"> 
+					<ramp:user>TuscanyWsUser</ramp:user>
+					<ramp:encryptionUser>TuscanyWsUser</ramp:encryptionUser>
+					<ramp:passwordCallbackClass>helloworld.ClientPWCBHandler</ramp:passwordCallbackClass>
+					
+					<ramp:signatureCrypto>
+						<ramp:crypto provider="org.apache.ws.security.components.crypto.Merlin">
+							<ramp:property name="org.apache.ws.security.crypto.merlin.keystore.type">JKS</ramp:property>
+							<ramp:property name="org.apache.ws.security.crypto.merlin.file">helloworldKeys.jks</ramp:property>
+							<ramp:property name="org.apache.ws.security.crypto.merlin.keystore.password">TuscanyWsUserPasswd</ramp:property>
+						</ramp:crypto>
+					</ramp:signatureCrypto>
+				</ramp:RampartConfig>
+	
+			</wsp:All>
+		</wsp:ExactlyOne>
+	</wsp:Policy>
+ </sca:policySet>
+ 
+ 
+ <!-- Policysets for unit tests that use the testHelloworldws.composite -->
+ <!-- Since we use the helloworld-ws-service for the unit testing we need to 
+	 declare these policy sets and with the 'provides' set to the intents that the 
+	 composite in the helloworld-ws-service uses.  -->
+ <sca:policySet name="wsAuthenticationPolicy"
+ 	provides="authentication"
+ 	appliesTo="sca:service/sca:binding.ws"
+ 	>
+ 	<tuscany:wsConfigParam>
+ 		<parameter name="InflowSecurity">
+ 			<action>
+ 				<items>UsernameToken</items>
+ 				<passwordCallbackClass>helloworld.ServerPWCBHandler</passwordCallbackClass>
+       		</action>
+      	</parameter>
+ 	</tuscany:wsConfigParam>
+ </sca:policySet>
+ 
+ <sca:policySet name="wsServerSecurityPolicyForIntegrity"
+ 	provides="integrity"
+ 	appliesTo="sca:service/sca:binding.ws">
+ 	<wsp:Policy wsu:Id="SignOnly" 
+ 		xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" 
+ 		xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy">
+		<wsp:ExactlyOne>
+			<wsp:All>
+				<sp:AsymmetricBinding xmlns:sp="http://schemas.xmlsoap.org/ws/2005/07/securitypolicy">
+					<wsp:Policy>
+						<sp:InitiatorToken>
+							<wsp:Policy>
+								<sp:X509Token sp:IncludeToken="http://schemas.xmlsoap.org/ws/2005/07/securitypolicy/IncludeToken/AlwaysToRecipient">
+									<wsp:Policy>
+										<sp:WssX509V3Token10/>
+									</wsp:Policy>
+								</sp:X509Token>
+							</wsp:Policy>
+						</sp:InitiatorToken>
+						<sp:RecipientToken>
+							<wsp:Policy>
+								<sp:X509Token sp:IncludeToken="http://schemas.xmlsoap.org/ws/2005/07/securitypolicy/IncludeToken/Never">
+									<wsp:Policy>
+										<sp:WssX509V3Token10/>
+									</wsp:Policy>
+								</sp:X509Token>
+							</wsp:Policy>
+						</sp:RecipientToken>
+						<sp:AlgorithmSuite>
+							<wsp:Policy>
+								<sp:TripleDesRsa15/>
+							</wsp:Policy>
+						</sp:AlgorithmSuite>
+						<sp:Layout>
+							<wsp:Policy>
+								<sp:Strict/>
+							</wsp:Policy>
+						</sp:Layout>
+						<sp:IncludeTimestamp/>
+						<sp:OnlySignEntireHeadersAndBody/>
+					</wsp:Policy>
+				</sp:AsymmetricBinding>
+				<sp:Wss10 xmlns:sp="http://schemas.xmlsoap.org/ws/2005/07/securitypolicy">
+					<wsp:Policy>
+						<sp:MustSupportRefKeyIdentifier/>
+						<sp:MustSupportRefIssuerSerial/>
+					</wsp:Policy>
+				</sp:Wss10>
+				<sp:SignedParts xmlns:sp="http://schemas.xmlsoap.org/ws/2005/07/securitypolicy">
+					<sp:Body/>
+				</sp:SignedParts>
+	
+				<ramp:RampartConfig xmlns:ramp="http://ws.apache.org/rampart/policy"> 
+					<ramp:user>TuscanyWsUser</ramp:user>
+					<ramp:encryptionUser>TuscanyWsUser</ramp:encryptionUser>
+					<ramp:passwordCallbackClass>helloworld.ServerPWCBHandler</ramp:passwordCallbackClass>
+					
+					<ramp:signatureCrypto>
+						<ramp:crypto provider="org.apache.ws.security.components.crypto.Merlin">
+							<ramp:property name="org.apache.ws.security.crypto.merlin.keystore.type">JKS</ramp:property>
+							<ramp:property name="org.apache.ws.security.crypto.merlin.file">helloworldKeys.jks</ramp:property>
+							<ramp:property name="org.apache.ws.security.crypto.merlin.keystore.password">TuscanyWsUserPasswd</ramp:property>
+						</ramp:crypto>
+					</ramp:signatureCrypto>
+				</ramp:RampartConfig>
+			</wsp:All>
+		</wsp:ExactlyOne>
+	</wsp:Policy>
+ </sca:policySet>
+ 
+ </sca:definitions>

Added: tuscany/sca-java-1.x/trunk/itest/serialization-ws/src/main/resources/helloworldKeys.jks
URL: http://svn.apache.org/viewvc/tuscany/sca-java-1.x/trunk/itest/serialization-ws/src/main/resources/helloworldKeys.jks?rev=1210165&view=auto
==============================================================================
Binary file - no diff available.

Propchange: tuscany/sca-java-1.x/trunk/itest/serialization-ws/src/main/resources/helloworldKeys.jks
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: tuscany/sca-java-1.x/trunk/itest/serialization-ws/src/main/resources/helloworldws.composite
URL: http://svn.apache.org/viewvc/tuscany/sca-java-1.x/trunk/itest/serialization-ws/src/main/resources/helloworldws.composite?rev=1210165&view=auto
==============================================================================
--- tuscany/sca-java-1.x/trunk/itest/serialization-ws/src/main/resources/helloworldws.composite (added)
+++ tuscany/sca-java-1.x/trunk/itest/serialization-ws/src/main/resources/helloworldws.composite Sun Dec  4 18:10:28 2011
@@ -0,0 +1,42 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+    * 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.    
+-->
+<composite xmlns="http://www.osoa.org/xmlns/sca/1.0"
+	targetNamespace="http://helloworld"
+	xmlns:sca="http://www.osoa.org/xmlns/sca/1.0"
+	xmlns:hw="http://helloworld"
+    name="helloworldws">
+
+	<service name="HelloWorldService" requires="authentication" promote="HelloWorldServiceComponent/HelloWorldService">
+        <interface.wsdl interface="http://helloworld#wsdl.interface(HelloWorld)" />
+        <binding.ws uri="http://localhost:8085/HelloWorldService"/>
+    </service>
+    
+    <service name="HelloWorldWsPolicyService" promote="HelloWorldServiceComponent/HelloWorldService"
+    		 requires="integrity">
+        <interface.wsdl interface="http://helloworld#wsdl.interface(HelloWorld)" />
+        <binding.ws wsdlElement="http://helloworld#wsdl.binding(HelloWorldSoapBinding)"
+                    uri="http://localhost:8085/HelloWorldWsPolicyService"/>
+    </service>
+
+    <component name="HelloWorldServiceComponent">
+        <implementation.java class="helloworld.HelloWorldImpl" />
+    </component>
+
+</composite>

Added: tuscany/sca-java-1.x/trunk/itest/serialization-ws/src/main/resources/helloworldwsclient.composite
URL: http://svn.apache.org/viewvc/tuscany/sca-java-1.x/trunk/itest/serialization-ws/src/main/resources/helloworldwsclient.composite?rev=1210165&view=auto
==============================================================================
--- tuscany/sca-java-1.x/trunk/itest/serialization-ws/src/main/resources/helloworldwsclient.composite (added)
+++ tuscany/sca-java-1.x/trunk/itest/serialization-ws/src/main/resources/helloworldwsclient.composite Sun Dec  4 18:10:28 2011
@@ -0,0 +1,59 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * 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.    
+-->
+<composite xmlns="http://www.osoa.org/xmlns/sca/1.0"
+	targetNamespace="http://helloworld"
+	xmlns:hw="http://helloworld"
+	xmlns:sca="http://www.osoa.org/xmlns/sca/1.0"
+	name="helloworldwsclient">
+    
+    <!-- A component with an embedded reference definition connecting to an external webservice 
+         The wsdl interface for the reference is derived from the information specified by the 'wsdlElement'
+     -->
+    <component name="HelloTuscanyServiceComponent">
+      <implementation.java class="helloworld.HelloWorldServiceComponent"/>
+      <reference name="helloWorldService" requires="authentication">
+        <interface.wsdl interface="http://helloworld#wsdl.interface(HelloWorld)"/>
+        <binding.ws wsdlElement="http://helloworld#wsdl.port(HelloWorldService/HelloWorldSoapPort)"/>
+      </reference>
+    </component>
+    
+    <!-- A component with a reference promoted as a composite reference -->
+    <component name="HelloWorldServiceComponent">
+      <implementation.java class="helloworld.HelloWorldServiceComponent"/>
+    </component>
+    
+    <!-- A component with a reference promoted as a composite reference with a ws policy -->
+    <component name="HelloWorldWsPolicyServiceComponent">
+      <implementation.java class="helloworld.HelloWorldServiceComponent"/>
+    </component>
+    
+    <reference name="HelloWorldService" promote="HelloWorldServiceComponent/helloWorldService" 
+    			requires="authentication">
+        <interface.java interface="helloworld.HelloWorldService" />
+        <binding.ws wsdlElement="http://helloworld#wsdl.port(HelloWorldService/HelloWorldSoapPort)"/>
+    </reference>
+    
+    <reference name="HelloWorldWsPolicyService" promote="HelloWorldWsPolicyServiceComponent/helloWorldService"
+    			requires="integrity">
+        <interface.java interface="helloworld.HelloWorldService" />
+        <binding.ws wsdlElement="http://helloworld#wsdl.port(HelloWorldWsPolicyService/HelloWorldSoapPort)"/>
+    </reference>
+
+</composite>

Added: tuscany/sca-java-1.x/trunk/itest/serialization-ws/src/main/resources/wsdl/helloworld.wsdl
URL: http://svn.apache.org/viewvc/tuscany/sca-java-1.x/trunk/itest/serialization-ws/src/main/resources/wsdl/helloworld.wsdl?rev=1210165&view=auto
==============================================================================
--- tuscany/sca-java-1.x/trunk/itest/serialization-ws/src/main/resources/wsdl/helloworld.wsdl (added)
+++ tuscany/sca-java-1.x/trunk/itest/serialization-ws/src/main/resources/wsdl/helloworld.wsdl Sun Dec  4 18:10:28 2011
@@ -0,0 +1,85 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * 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.    
+-->
+<wsdl:definitions targetNamespace="http://helloworld" xmlns:tns="http://helloworld" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+	name="helloworld">
+
+    <wsdl:types>
+        <schema elementFormDefault="qualified" targetNamespace="http://helloworld" xmlns="http://www.w3.org/2001/XMLSchema">
+
+            <element name="getGreetings">
+                <complexType>
+                    <sequence>
+                        <element name="name" type="xsd:string"/>
+                    </sequence>
+                </complexType>
+            </element>
+
+            <element name="getGreetingsResponse">
+                <complexType>
+                    <sequence>
+                        <element name="getGreetingsReturn" type="xsd:string"/>
+                    </sequence>
+                </complexType>
+            </element>
+            
+        </schema>
+    </wsdl:types>
+
+    <wsdl:message name="getGreetingsRequest">
+        <wsdl:part element="tns:getGreetings" name="parameters"/>
+    </wsdl:message>
+
+    <wsdl:message name="getGreetingsResponse">
+        <wsdl:part element="tns:getGreetingsResponse" name="parameters"/>
+    </wsdl:message>
+
+    <wsdl:portType name="HelloWorld">
+        <wsdl:operation name="getGreetings">
+            <wsdl:input message="tns:getGreetingsRequest" name="getGreetingsRequest"/>
+            <wsdl:output message="tns:getGreetingsResponse" name="getGreetingsResponse"/>
+        </wsdl:operation>
+    </wsdl:portType>
+
+    <wsdl:binding name="HelloWorldSoapBinding" type="tns:HelloWorld">
+        <wsdlsoap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
+        <wsdl:operation name="getGreetings">
+            <wsdlsoap:operation soapAction=""/>
+            <wsdl:input name="getGreetingsRequest">
+                <wsdlsoap:body use="literal"/>
+            </wsdl:input>
+            <wsdl:output name="getGreetingsResponse">
+                <wsdlsoap:body use="literal"/>
+            </wsdl:output>
+        </wsdl:operation>
+    </wsdl:binding>
+
+    <wsdl:service name="HelloWorldService">
+        <wsdl:port binding="tns:HelloWorldSoapBinding" name="HelloWorldSoapPort">
+            <wsdlsoap:address location="http://localhost:8085/HelloWorldService"/>
+        </wsdl:port>
+    </wsdl:service>
+    
+    <wsdl:service name="HelloWorldWsPolicyService">
+        <wsdl:port binding="tns:HelloWorldSoapBinding" name="HelloWorldSoapPort">
+            <wsdlsoap:address location="http://localhost:8085/HelloWorldWsPolicyService"/>
+        </wsdl:port>
+    </wsdl:service>
+
+</wsdl:definitions>

Added: tuscany/sca-java-1.x/trunk/itest/serialization-ws/src/test/java/helloworld/HelloWorldClientTestCase.java
URL: http://svn.apache.org/viewvc/tuscany/sca-java-1.x/trunk/itest/serialization-ws/src/test/java/helloworld/HelloWorldClientTestCase.java?rev=1210165&view=auto
==============================================================================
--- tuscany/sca-java-1.x/trunk/itest/serialization-ws/src/test/java/helloworld/HelloWorldClientTestCase.java (added)
+++ tuscany/sca-java-1.x/trunk/itest/serialization-ws/src/test/java/helloworld/HelloWorldClientTestCase.java Sun Dec  4 18:10:28 2011
@@ -0,0 +1,82 @@
+/*
+ * 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 helloworld;
+
+import junit.framework.Assert;
+
+import org.apache.tuscany.sca.host.embedded.SCADomain;
+import org.apache.tuscany.sca.host.embedded.SCATestCaseRunner;
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+
+/**
+ * Test case for helloworld web service client 
+ */
+public class HelloWorldClientTestCase {
+
+    private HelloWorldService helloWorldService;
+    private HelloWorldService helloTuscanyService;
+    private HelloWorldService helloWsPolicyService;
+    private SCADomain scaDomain;
+    
+    private SCATestCaseRunner server;
+
+    @Before
+    public void startClient() throws Exception {
+        try {
+            scaDomain = SCADomain.newInstance("helloworldwsclient.composite");
+            helloWorldService = scaDomain.getService(HelloWorldService.class, "HelloWorldServiceComponent");
+            helloTuscanyService = scaDomain.getService(HelloWorldService.class, "HelloTuscanyServiceComponent");
+            helloWsPolicyService = scaDomain.getService(HelloWorldService.class, "HelloWorldWsPolicyServiceComponent");
+    
+            server =  new SCATestCaseRunner(HelloWorldTestServer.class);
+            server.before();
+
+        } catch (Throwable e) {
+            e.printStackTrace();
+        }
+    }
+    
+    @Test
+    public void testWSClient() throws Exception {
+        String msg = helloWorldService.getGreetings("Smith");
+        Assert.assertEquals("Hello Smith", msg);
+   }
+    
+    @Test
+    public void testEmbeddedReferenceClient() throws Exception {
+        String msg = helloTuscanyService.getGreetings("Tuscany");
+        Assert.assertEquals("Hello Tuscany", msg);
+    }
+    
+    @Test
+    public void testWsPolicyClient() throws Exception {
+        String msg = helloWsPolicyService.getGreetings("WsPolicyWorld");
+        Assert.assertEquals("Hello WsPolicyWorld", msg);
+    }
+    
+    @After
+    public void stopClient() throws Exception {
+    	server.after();
+        scaDomain.close();
+    }
+
+}

Added: tuscany/sca-java-1.x/trunk/itest/serialization-ws/src/test/java/helloworld/HelloWorldTestServer.java
URL: http://svn.apache.org/viewvc/tuscany/sca-java-1.x/trunk/itest/serialization-ws/src/test/java/helloworld/HelloWorldTestServer.java?rev=1210165&view=auto
==============================================================================
--- tuscany/sca-java-1.x/trunk/itest/serialization-ws/src/test/java/helloworld/HelloWorldTestServer.java (added)
+++ tuscany/sca-java-1.x/trunk/itest/serialization-ws/src/test/java/helloworld/HelloWorldTestServer.java Sun Dec  4 18:10:28 2011
@@ -0,0 +1,55 @@
+/*
+ * 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 helloworld;
+
+import java.io.IOException;
+import java.net.Socket;
+
+import org.apache.tuscany.sca.host.embedded.SCADomain;
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+
+/**
+ * Starts up the SCA runtime which starts listening for service requests
+ */
+public class HelloWorldTestServer {
+
+    private SCADomain scaDomain;
+
+        @Before
+	public void startServer() throws Exception {
+            try {
+                scaDomain = SCADomain.newInstance("helloworldws.composite");
+            } catch (Exception e) {
+                e.printStackTrace();
+            }
+	}
+
+	@Test
+	public void testPing() throws IOException {
+		new Socket("127.0.0.1", 8085);
+	}
+
+	@After
+	public void stopServer() throws Exception {
+            scaDomain.close();
+	}
+
+}

Added: tuscany/sca-java-1.x/trunk/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/BusinessInterface.java
URL: http://svn.apache.org/viewvc/tuscany/sca-java-1.x/trunk/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/BusinessInterface.java?rev=1210165&view=auto
==============================================================================
--- tuscany/sca-java-1.x/trunk/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/BusinessInterface.java (added)
+++ tuscany/sca-java-1.x/trunk/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/BusinessInterface.java Sun Dec  4 18:10:28 2011
@@ -0,0 +1,39 @@
+/*
+ * 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 org.apache.tuscany.sca.runtime;
+
+/**
+ * Java business interface for serializing a CallableReference
+ * 
+ * @version $Rev: 574648 $ $Date: 2007-09-11 18:45:36 +0100 (Tue, 11 Sep 2007) $
+ */
+public interface BusinessInterface {
+    /**
+     * Get the interface class name
+     * @return the interface class name
+     */
+    String getInterface();
+
+    /**
+     * Set the interface class name
+     * @param interfaze the interface class name
+     */
+    void setInterface(String interfaze);
+}

Added: tuscany/sca-java-1.x/trunk/modules/core/src/main/java/org/apache/tuscany/sca/core/assembly/BusinessInterfaceImpl.java
URL: http://svn.apache.org/viewvc/tuscany/sca-java-1.x/trunk/modules/core/src/main/java/org/apache/tuscany/sca/core/assembly/BusinessInterfaceImpl.java?rev=1210165&view=auto
==============================================================================
--- tuscany/sca-java-1.x/trunk/modules/core/src/main/java/org/apache/tuscany/sca/core/assembly/BusinessInterfaceImpl.java (added)
+++ tuscany/sca-java-1.x/trunk/modules/core/src/main/java/org/apache/tuscany/sca/core/assembly/BusinessInterfaceImpl.java Sun Dec  4 18:10:28 2011
@@ -0,0 +1,74 @@
+/*
+ * 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 org.apache.tuscany.sca.core.assembly;
+
+import org.apache.tuscany.sca.runtime.BusinessInterface;
+
+/**
+ * @version $Rev: 574648 $ $Date: 2007-09-11 18:45:36 +0100 (Tue, 11 Sep 2007) $
+ */
+public class BusinessInterfaceImpl implements BusinessInterface {
+    private String interfaze;
+    
+    /**
+     * @return the interface class name
+     */
+    public String getInterface() {
+        return interfaze;
+    }
+
+    /**
+     * @param interfaze the interface class name
+     */
+    public void setInterface(String interfaze) {
+        this.interfaze = interfaze;
+    }
+
+    /**
+     * @see java.lang.Object#hashCode()
+     */
+    @Override
+    public int hashCode() {
+        final int prime = 31;
+        int result = 1;
+        result = prime * result + ((interfaze == null) ? 0 : interfaze.hashCode());
+        return result;
+    }
+
+    /**
+     * @see java.lang.Object#equals(java.lang.Object)
+     */
+    @Override
+    public boolean equals(Object obj) {
+        if (this == obj)
+            return true;
+        if (obj == null)
+            return false;
+        if (!(obj instanceof BusinessInterfaceImpl))
+            return false;
+        final BusinessInterfaceImpl other = (BusinessInterfaceImpl)obj;
+        if (interfaze == null) {
+            if (other.interfaze != null)
+                return false;
+        } else if (!interfaze.equals(other.interfaze))
+            return false;
+        return true;
+    }
+}

Added: tuscany/sca-java-1.x/trunk/modules/core/src/main/java/org/apache/tuscany/sca/core/assembly/BusinessInterfaceProcessor.java
URL: http://svn.apache.org/viewvc/tuscany/sca-java-1.x/trunk/modules/core/src/main/java/org/apache/tuscany/sca/core/assembly/BusinessInterfaceProcessor.java?rev=1210165&view=auto
==============================================================================
--- tuscany/sca-java-1.x/trunk/modules/core/src/main/java/org/apache/tuscany/sca/core/assembly/BusinessInterfaceProcessor.java (added)
+++ tuscany/sca-java-1.x/trunk/modules/core/src/main/java/org/apache/tuscany/sca/core/assembly/BusinessInterfaceProcessor.java Sun Dec  4 18:10:28 2011
@@ -0,0 +1,97 @@
+/*
+ * 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 org.apache.tuscany.sca.core.assembly;
+
+import javax.xml.namespace.QName;
+import javax.xml.stream.XMLStreamException;
+import javax.xml.stream.XMLStreamReader;
+import javax.xml.stream.XMLStreamWriter;
+
+import org.apache.tuscany.sca.contribution.ModelFactoryExtensionPoint;
+import org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor;
+import org.apache.tuscany.sca.contribution.resolver.ModelResolver;
+import org.apache.tuscany.sca.contribution.service.ContributionReadException;
+import org.apache.tuscany.sca.contribution.service.ContributionResolveException;
+import org.apache.tuscany.sca.contribution.service.ContributionWriteException;
+import org.apache.tuscany.sca.monitor.Monitor;
+import org.apache.tuscany.sca.runtime.BusinessInterface;
+
+/**
+ * Artifact processor for reference parameters.
+ * 
+ * @version $Rev: 658664 $ $Date: 2008-05-21 13:46:26 +0100 (Wed, 21 May 2008) $
+ */
+public class BusinessInterfaceProcessor implements StAXArtifactProcessor<BusinessInterface> {
+    private static final QName BUSINESS_INTERFACE =
+        new QName("http://tuscany.apache.org/xmlns/sca/1.0", "businessInterface", "tuscany");
+    
+    /**
+     * Constructs a new processor.
+     * 
+     * @param modelFactories
+     */
+    public BusinessInterfaceProcessor(ModelFactoryExtensionPoint modelFactories, Monitor monitor) {
+    }
+
+    /**
+     * @see org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor#getArtifactType()
+     */
+    public QName getArtifactType() {
+        return BUSINESS_INTERFACE;
+    }
+
+    /**
+     * @see org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor#read(javax.xml.stream.XMLStreamReader)
+     */
+    public BusinessInterface read(XMLStreamReader reader) throws ContributionReadException, XMLStreamException {
+        BusinessInterface businessInterface = new BusinessInterfaceImpl();
+        businessInterface.setInterface(reader.getAttributeValue(null, "interface"));
+        return businessInterface;
+    }
+
+    /**
+     * @see org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor#write(java.lang.Object, javax.xml.stream.XMLStreamWriter)
+     */
+    public void write(BusinessInterface model, XMLStreamWriter writer) throws ContributionWriteException,
+        XMLStreamException {
+        writer.writeStartElement(BUSINESS_INTERFACE.getPrefix(),
+                                 BUSINESS_INTERFACE.getLocalPart(),
+                                 BUSINESS_INTERFACE.getNamespaceURI());
+        writer.writeNamespace(BUSINESS_INTERFACE.getPrefix(), BUSINESS_INTERFACE.getNamespaceURI());
+        if (model.getInterface() != null) {
+            writer.writeAttribute("interface", model.getInterface().toString());
+        }
+        writer.writeEndElement();
+    }
+
+    /**
+     * @see org.apache.tuscany.sca.contribution.processor.ArtifactProcessor#getModelType()
+     */
+    public Class<BusinessInterface> getModelType() {
+        return BusinessInterface.class;
+    }
+
+    /**
+     * @see org.apache.tuscany.sca.contribution.processor.ArtifactProcessor#resolve(java.lang.Object, org.apache.tuscany.sca.contribution.resolver.ModelResolver)
+     */
+    public void resolve(BusinessInterface model, ModelResolver resolver) throws ContributionResolveException {
+    }
+
+}



Mime
View raw message