Return-Path: X-Original-To: apmail-incubator-airavata-commits-archive@minotaur.apache.org Delivered-To: apmail-incubator-airavata-commits-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id DDFC6DFC9 for ; Sun, 9 Sep 2012 23:23:20 +0000 (UTC) Received: (qmail 82135 invoked by uid 500); 9 Sep 2012 23:23:20 -0000 Delivered-To: apmail-incubator-airavata-commits-archive@incubator.apache.org Received: (qmail 82099 invoked by uid 500); 9 Sep 2012 23:23:20 -0000 Mailing-List: contact airavata-commits-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: airavata-dev@incubator.apache.org Delivered-To: mailing list airavata-commits@incubator.apache.org Received: (qmail 82092 invoked by uid 99); 9 Sep 2012 23:23:20 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 09 Sep 2012 23:23:20 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 09 Sep 2012 23:23:16 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id EBD9A23889E2; Sun, 9 Sep 2012 23:22:32 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1382608 - in /incubator/airavata/trunk/modules/commons: common-registry-api/src/main/java/org/apache/airavata/common/registry/api/impl/ registry-api/src/main/java/org/apache/airavata/registry/api/ registry-api/src/main/java/org/apache/aira... Date: Sun, 09 Sep 2012 23:22:32 -0000 To: airavata-commits@incubator.apache.org From: lahiru@apache.org X-Mailer: svnmailer-1.0.8-patched Message-Id: <20120909232232.EBD9A23889E2@eris.apache.org> Author: lahiru Date: Sun Sep 9 23:22:32 2012 New Revision: 1382608 URL: http://svn.apache.org/viewvc?rev=1382608&view=rev Log: minor changes to new structure Added: incubator/airavata/trunk/modules/commons/registry-api/src/main/java/org/apache/airavata/registry/api/AiravataRegistry1.java - copied, changed from r1382023, incubator/airavata/trunk/modules/commons/registry-api/src/main/java/org/apache/airavata/registry/api/AiravataRegistry.java Removed: incubator/airavata/trunk/modules/commons/registry-api/src/main/java/org/apache/airavata/registry/api/AiravataRegistry.java incubator/airavata/trunk/modules/commons/registry-service/ Modified: incubator/airavata/trunk/modules/commons/common-registry-api/src/main/java/org/apache/airavata/common/registry/api/impl/JCRRegistry.java incubator/airavata/trunk/modules/commons/registry-api/src/main/java/org/apache/airavata/registry/api/Axis2Registry.java incubator/airavata/trunk/modules/commons/registry-api/src/main/java/org/apache/airavata/registry/api/Gateway.java incubator/airavata/trunk/modules/commons/registry-api/src/main/java/org/apache/airavata/registry/api/util/WebServiceUtil.java Modified: incubator/airavata/trunk/modules/commons/common-registry-api/src/main/java/org/apache/airavata/common/registry/api/impl/JCRRegistry.java URL: http://svn.apache.org/viewvc/incubator/airavata/trunk/modules/commons/common-registry-api/src/main/java/org/apache/airavata/common/registry/api/impl/JCRRegistry.java?rev=1382608&r1=1382607&r2=1382608&view=diff ============================================================================== --- incubator/airavata/trunk/modules/commons/common-registry-api/src/main/java/org/apache/airavata/common/registry/api/impl/JCRRegistry.java (original) +++ incubator/airavata/trunk/modules/commons/common-registry-api/src/main/java/org/apache/airavata/common/registry/api/impl/JCRRegistry.java Sun Sep 9 23:22:32 2012 @@ -251,7 +251,7 @@ public class JCRRegistry extends Observa this.credentials = credentials; } - protected Node getRootNode(Session session) throws RepositoryException { + public Node getRootNode(Session session) throws RepositoryException { String ROOT_NODE_TEXT = "root"; if (!getSessionNodes().containsKey(null) || !getSessionNodes().get(null).get(ROOT_NODE_TEXT).getSession().isLive()){ getSessionNodes().put(null, new HashMap()); @@ -320,7 +320,7 @@ public class JCRRegistry extends Observa return session; } - protected Node getOrAddNode(Node node, String name) throws RepositoryException { + public Node getOrAddNode(Node node, String name) throws RepositoryException { Map> sessionNodes = getSessionNodes(); if (sessionNodes.containsKey(node)){ if (sessionNodes.get(node)!=null && sessionNodes.get(node).containsKey(name)){ Copied: incubator/airavata/trunk/modules/commons/registry-api/src/main/java/org/apache/airavata/registry/api/AiravataRegistry1.java (from r1382023, incubator/airavata/trunk/modules/commons/registry-api/src/main/java/org/apache/airavata/registry/api/AiravataRegistry.java) URL: http://svn.apache.org/viewvc/incubator/airavata/trunk/modules/commons/registry-api/src/main/java/org/apache/airavata/registry/api/AiravataRegistry1.java?p2=incubator/airavata/trunk/modules/commons/registry-api/src/main/java/org/apache/airavata/registry/api/AiravataRegistry1.java&p1=incubator/airavata/trunk/modules/commons/registry-api/src/main/java/org/apache/airavata/registry/api/AiravataRegistry.java&r1=1382023&r2=1382608&rev=1382608&view=diff ============================================================================== --- incubator/airavata/trunk/modules/commons/registry-api/src/main/java/org/apache/airavata/registry/api/AiravataRegistry.java (original) +++ incubator/airavata/trunk/modules/commons/registry-api/src/main/java/org/apache/airavata/registry/api/AiravataRegistry1.java Sun Sep 9 23:22:32 2012 @@ -41,7 +41,7 @@ import org.apache.airavata.registry.api. import org.apache.airavata.registry.api.workflow.*; import org.apache.airavata.registry.api.workflow.WorkflowInstanceStatus.ExecutionStatus; -public interface AiravataRegistry extends Registry{ +public interface AiravataRegistry1 extends Registry{ /** * Find locations where the service is deployed * Modified: incubator/airavata/trunk/modules/commons/registry-api/src/main/java/org/apache/airavata/registry/api/Axis2Registry.java URL: http://svn.apache.org/viewvc/incubator/airavata/trunk/modules/commons/registry-api/src/main/java/org/apache/airavata/registry/api/Axis2Registry.java?rev=1382608&r1=1382607&r2=1382608&view=diff ============================================================================== --- incubator/airavata/trunk/modules/commons/registry-api/src/main/java/org/apache/airavata/registry/api/Axis2Registry.java (original) +++ incubator/airavata/trunk/modules/commons/registry-api/src/main/java/org/apache/airavata/registry/api/Axis2Registry.java Sun Sep 9 23:22:32 2012 @@ -24,7 +24,7 @@ package org.apache.airavata.registry.api import org.apache.airavata.common.registry.api.exception.RegistryException; import org.apache.airavata.commons.gfac.type.ServiceDescription; -public interface Axis2Registry extends AiravataRegistry{ +public interface Axis2Registry extends AiravataRegistry1 { /** * Load WSDL for Axis2 Modified: incubator/airavata/trunk/modules/commons/registry-api/src/main/java/org/apache/airavata/registry/api/Gateway.java URL: http://svn.apache.org/viewvc/incubator/airavata/trunk/modules/commons/registry-api/src/main/java/org/apache/airavata/registry/api/Gateway.java?rev=1382608&r1=1382607&r2=1382608&view=diff ============================================================================== --- incubator/airavata/trunk/modules/commons/registry-api/src/main/java/org/apache/airavata/registry/api/Gateway.java (original) +++ incubator/airavata/trunk/modules/commons/registry-api/src/main/java/org/apache/airavata/registry/api/Gateway.java Sun Sep 9 23:22:32 2012 @@ -22,7 +22,7 @@ package org.apache.airavata.registry.api; public class Gateway { - private String gatewayName; + private String gatewayName = "default"; public Gateway(String gatewayName) { setGatewayName(gatewayName); Modified: incubator/airavata/trunk/modules/commons/registry-api/src/main/java/org/apache/airavata/registry/api/util/WebServiceUtil.java URL: http://svn.apache.org/viewvc/incubator/airavata/trunk/modules/commons/registry-api/src/main/java/org/apache/airavata/registry/api/util/WebServiceUtil.java?rev=1382608&r1=1382607&r2=1382608&view=diff ============================================================================== --- incubator/airavata/trunk/modules/commons/registry-api/src/main/java/org/apache/airavata/registry/api/util/WebServiceUtil.java (original) +++ incubator/airavata/trunk/modules/commons/registry-api/src/main/java/org/apache/airavata/registry/api/util/WebServiceUtil.java Sun Sep 9 23:22:32 2012 @@ -1,33 +1,37 @@ -/* - * - * 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. - * - */ - +/* + * + * 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.airavata.registry.api.util; -import org.apache.airavata.commons.gfac.type.ServiceDescription; -import org.apache.airavata.schemas.gfac.InputParameterType; -import org.apache.airavata.schemas.gfac.OutputParameterType; -import org.apache.airavata.schemas.gfac.ServiceDescriptionType; +import org.apache.airavata.commons.gfac.type.ServiceDescription; +import org.apache.airavata.commons.gfac.wsdl.WSDLConstants; +import org.apache.airavata.commons.gfac.wsdl.WSDLGenerator; +import org.apache.airavata.schemas.gfac.*; + +import java.util.Hashtable; public class WebServiceUtil { + + public static String generateWSDL(ServiceDescription service) { StringBuilder builder = new StringBuilder(); builder.append(""); @@ -167,4 +171,32 @@ public class WebServiceUtil { } + public static String getWSDL(ServiceDescription service) throws Exception{ + try { + + ServiceType type = service.getType().addNewService(); + ServiceType.ServiceName name = type.addNewServiceName(); + name.setStringValue(service.getType().getName()); + name.setTargetNamespace("http://schemas.airavata.apache.org/gfac/type"); + if(service.getType().getPortType() == null){ + PortTypeType portType = service.getType().addNewPortType(); + MethodType methodType = portType.addNewMethod(); + methodType.setMethodName("invoke"); + }else{ + MethodType method = service.getType().getPortType().getMethod(); + if (method == null) { + MethodType methodType = service.getType().getPortType().addNewMethod(); + methodType.setMethodName("invoke"); + } else { + service.getType().getPortType().getMethod().setMethodName("invoke"); + } + } + WSDLGenerator generator = new WSDLGenerator(); + Hashtable table = generator.generateWSDL(null, null, null, service.getType(), true); + return (String) table.get(WSDLConstants.AWSDL); + } catch (Exception e) { + throw new RuntimeException(e); + } + } + }