[prev in list] [next in list] [prev in thread] [next in thread] 

List:       jibx-cvs
Subject:    [Jibx-cvs] core/build/src/org/jibx/ws/wsdl/model Definitions.java,
From:       Dennis Sosnoski <dsosnoski () users ! sourceforge ! net>
Date:       2010-01-20 11:24:18
Message-ID: E1NXYfa-0003M5-Ks () sfp-cvsdas-3 ! v30 ! ch3 ! sourceforge ! com
[Download RAW message or body]

Update of /cvsroot/jibx/core/build/src/org/jibx/ws/wsdl/model
In directory sfp-cvsdas-3.v30.ch3.sourceforge.com:/tmp/cvs-serv12893/build/src/org/jibx/ws/wsdl/model


Modified Files:
	Definitions.java 
Log Message:
Track namespaces referenced from WSDL, generate numbered prefixes as needed to allow \
access.

Index: Definitions.java
===================================================================
RCS file: /cvsroot/jibx/core/build/src/org/jibx/ws/wsdl/model/Definitions.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** Definitions.java	22 Dec 2008 23:34:41 -0000	1.1
--- Definitions.java	20 Jan 2010 11:24:16 -0000	1.2
***************
*** 1,4 ****
  /*
!  * Copyright (c) 2004-2008, Dennis M. Sosnoski. All rights reserved.
   * 
   * Redistribution and use in source and binary forms, with or without modification, \
                are permitted provided that the
--- 1,4 ----
  /*
!  * Copyright (c) 2004-2010, Dennis M. Sosnoski. All rights reserved.
   * 
   * Redistribution and use in source and binary forms, with or without modification, \
                are permitted provided that the
***************
*** 23,27 ****
--- 23,29 ----
  
  import java.util.ArrayList;
+ import java.util.HashSet;
  import java.util.List;
+ import java.util.Set;
  
  import org.jibx.runtime.QName;
***************
*** 74,77 ****
--- 76,82 ----
      private String m_serviceLocation;
      
+     /** Namespaces referenced from WSDL. */
+     private Set m_namespaceUris;
+     
      /**
       * Default constructor. This is only used by the unmarshalling code.
***************
*** 88,96 ****
       * @param wpfx prefix for WSDL target namespace
       * @param wuri WSDL target namespace
-      * @param spfx prefix for schema target namespace
-      * @param suri schema target namespace
       */
!     public Definitions(String tname, String bname, String sname, String pname, \
                String wpfx, String wuri, String spfx,
!         String suri) {
          this();
          m_portTypeName = tname;
--- 93,98 ----
       * @param wpfx prefix for WSDL target namespace
       * @param wuri WSDL target namespace
       */
!     public Definitions(String tname, String bname, String sname, String pname, \
String wpfx, String wuri) {  this();
          m_portTypeName = tname;
***************
*** 103,110 ****
          m_messages = new ArrayList();
          m_operations = new ArrayList();
          addNamespaceDeclaration(wpfx, wuri);
-         if (!wuri.equals(suri) || !wpfx.equals(spfx)) {
-             addNamespaceDeclaration(spfx, suri);
-         }
      }
      
--- 105,111 ----
          m_messages = new ArrayList();
          m_operations = new ArrayList();
+         m_namespaceUris = new HashSet();
+         m_namespaceUris.add(wuri);
          addNamespaceDeclaration(wpfx, wuri);
      }
      
***************
*** 261,263 ****
--- 262,276 ----
          return m_operations;
      }
+     
+     /**
+      * Add namespace to set declared in WSDL. This just uses numbered prefixes.
+      * 
+      * @param uri
+      */
+     public void addNamespace(String uri) {
+         if (!m_namespaceUris.contains(uri)) {
+             addNamespaceDeclaration("ns"+m_namespaceUris.size(), uri);
+             m_namespaceUris.add(uri);
+         }
+     }
  }
\ No newline at end of file


------------------------------------------------------------------------------
Throughout its 18-year history, RSA Conference consistently attracts the
world's best and brightest in the field, creating opportunities for Conference
attendees to learn about information security's most important issues through
interactions with peers, luminaries and emerging and established companies.
http://p.sf.net/sfu/rsaconf-dev2dev
_______________________________________________
Jibx-cvs mailing list
Jibx-cvs@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jibx-cvs


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic