[Registry-dev] svn commit r17922 - branches/registry/1_1/modules/extensions/src/org/wso2/registry/handlers/utils

deepal at wso2.com deepal at wso2.com
Wed Jun 4 05:02:41 PDT 2008


Author: deepal
Date: Wed Jun  4 05:02:40 2008
New Revision: 17922
URL: http://wso2.org/svn/browse/wso2?view=rev&revision=17922

Log:
fixing wsdl import problem

Modified:
   branches/registry/1_1/modules/extensions/src/org/wso2/registry/handlers/utils/WSDLFileProcessor.java
   branches/registry/1_1/modules/extensions/src/org/wso2/registry/handlers/utils/WSDLUtils.java

Modified: branches/registry/1_1/modules/extensions/src/org/wso2/registry/handlers/utils/WSDLFileProcessor.java
URL: http://wso2.org/svn/browse/wso2/branches/registry/1_1/modules/extensions/src/org/wso2/registry/handlers/utils/WSDLFileProcessor.java?rev=17922&r1=17921&r2=17922&view=diff
==============================================================================
--- branches/registry/1_1/modules/extensions/src/org/wso2/registry/handlers/utils/WSDLFileProcessor.java	(original)
+++ branches/registry/1_1/modules/extensions/src/org/wso2/registry/handlers/utils/WSDLFileProcessor.java	Wed Jun  4 05:02:40 2008
@@ -287,36 +287,36 @@
             if (wsdlDefinition.getQName() != null) {
                 String name = wsdlDefinition.getQName().getLocalPart();
                 if (name != null) {
-                    wsdlResource.addProperty("Name", name);
+                    wsdlResource.addProperty("org.wso2.wsdl.Name", name);
                 }
             }
 
             if (wsdlDefinition.getDocumentationElement() != null) {
                 String document = wsdlDefinition.getDocumentationElement().getTextContent();
                 if (document != null) {
-                    wsdlResource.addProperty("documentation", document);
+                    wsdlResource.addProperty("org.wso2.wsdl.documentation", document);
                 }
             }
 
             String targetNamespace = wsdlDefinition.getTargetNamespace();
-            wsdlResource.addProperty("TargetNamespace", targetNamespace);
+            wsdlResource.addProperty("org.wso2.wsdl.TargetNamespace", targetNamespace);
 
             wsdlResource.setContent(wsdlResourceContent);
 
             repository.put(wsdlPath, wsdlResource);
 
             if (metadata !=null && original) {
-                metadata.addProperty("TargetNamespace", targetNamespace);
+                metadata.addProperty("org.wso2.wsdl.TargetNamespace", targetNamespace);
                 if (wsdlDefinition.getQName() != null) {
                     String name = wsdlDefinition.getQName().getLocalPart();
                     if (name != null) {
-                        metadata.addProperty("Name", name);
+                        metadata.addProperty("org.wso2.wsdl.Name", name);
                     }
                 }
                 if (wsdlDefinition.getDocumentationElement() != null) {
                     String document = wsdlDefinition.getDocumentationElement().getTextContent();
                     if (document != null) {
-                        metadata.addProperty("documentation", document);
+                        metadata.addProperty("org.wso2.wsdl.documentation", document);
                     }
                 }
             }

Modified: branches/registry/1_1/modules/extensions/src/org/wso2/registry/handlers/utils/WSDLUtils.java
URL: http://wso2.org/svn/browse/wso2/branches/registry/1_1/modules/extensions/src/org/wso2/registry/handlers/utils/WSDLUtils.java?rev=17922&r1=17921&r2=17922&view=diff
==============================================================================
--- branches/registry/1_1/modules/extensions/src/org/wso2/registry/handlers/utils/WSDLUtils.java	(original)
+++ branches/registry/1_1/modules/extensions/src/org/wso2/registry/handlers/utils/WSDLUtils.java	Wed Jun  4 05:02:40 2008
@@ -57,10 +57,10 @@
 
     private static final String WSDL_STATUS = "org.wso2.wsdl.validationStatus ";
     private static final String WSI_STATUS = "org.wso2.wsi.validationStatus ";
-    private static final String WSDL_VALID = "WSDL is valid";
-    private static final String WSDL_VALID_I = "WSDL is valid for WSI";
-    private static final String WSDL_INVALID = "WSDL is invalid ";
-    private static final String WSDL_INVALID_I = "WSDL is invalid for WSI ";
+    private static final String WSDL_VALID = "true";
+    private static final String WSDL_VALID_I = "true";
+    private static final String WSDL_INVALID = "false";
+    private static final String WSDL_INVALID_I = "false";
 
     public static String[] validateForWSI(String uri) throws RegistryException {
         ArrayList<String> errorMesage = new ArrayList();
@@ -127,7 +127,7 @@
                 validateWSI(requestContext.getSourceURL(), resource);
             }
         } catch (Exception e) {
-            throw new RegistryException(e.getMessage());
+            resource.setProperty(WSI_STATUS, WSDL_INVALID_I);
         }
     }
 
@@ -170,6 +170,7 @@
                 validaWSDLFromURI(requestContext.getSourceURL(), resource);
             }
         } catch (Exception e) {
+            resource.setProperty(WSDL_STATUS, WSDL_INVALID);
             throw new RegistryException(e.getMessage());
         }
         resource.setContentStream(null);



More information about the Registry-dev mailing list