Wednesday, August 25, 2010

Update on Google Wave from Official Google Blog


Just over a year after launching it in beta at the company’s developer conference, Google has decided to shut down Wave, the real-time collaboration tool that was designed to be a cross between instant messaging, group chat and email. In a blog post, Senior VP of Operations Urs Hölzle said that while the company had high hopes for the product, and despite the fact that it had “numerous loyal fans,” Google was canceling any further development of the feature, which the Google executive admitted “has not seen the user adoption we would have liked.”

Google have always pursued innovative projects because they want to drive breakthroughs in computer science that dramatically improve our users’ lives. Last year they launched developer preview of Google Wave, a web app for real time communication and collaboration, it set a high bar for what was possible in a web browser. It showed character-by-character live typing, and the ability to drag-and-drop files from the desktop, even “playback” the history of changes—all within a browser. Developers in the audience stood and cheered. Some even waved their laptops.

Google Wave has shown the power of this technology: sharing images and other media in real time; improving spell-checking by understanding not just an individual word, but also the context of each word; and enabling third-party developers to build new tools like consumer gadgets for travel, or robots to check code.

But despite these wins, and numerous loyal fans, Wave has not seen the user adoption. Hence Google don't plan to continue developing Wave as a standalone product, but will maintain the site at least through the end of the year and extend the technology for use in other Google projects. The central parts of the code, as well as the protocols that have driven many of Wave’s innovations, like drag-and-drop and character-by-character live typing, are already available as open source, so customers and partners can continue the innovation. In addition, Google will work on tools so that users can easily “liberate” their content from Wave.

Share |

Monday, August 02, 2010

Integrate Google Wave with Microsoft Outlook using WaveLock Extension


I was searching for Outlook Extension using which I can integrate Google Wave with Microsoft Outlook using extension. I found WaveLock which solves my purpose. Here is the original article which explains: How can we integrate Google Wave with Outlook ? 

Using WaveLock one can do real-time communication and collaboration in Outlook! WaveLook is a free plugin that integrates Google Wave into your Outlook inbox. It is the first and only native client for Google Wave.

Following are major benifits of using WaveLock to integrate Google Wave with Microsoft Outlook

  • Easier to Use 
  • Live Editing 
  • Draft Mode 
  • Native Gadgets 
  • Multiple Accounts 
  • Microsoft Exchange compatible
  • Single Host
  • Keep Things Secure
  • WaveLook Compatible
  • Microsoft Exchange Integration
  • Google Wave Compatible

Share |

Thursday, July 01, 2010

What is Base Rate? Understanding of Base Rate System India


Starting from July 1, all banks in India were moved to a “base rate” regime. What does this mean for all of us and how does this affect your existing borrowings? Here I try to clarify few questions which you may have:

What is the base rate?
When someone borrows money to buy car or house or electrical appliance or any thing else, there is an interest rate that one has to pay to the lender. The base rate is the minimum rate of interest that a bank will lend money at as per RBI guidelines. This is like floor interest rate below which RBI will not allow banks to lend money to any one.
Previously, banks used decide interest rates on the loans they offered, on a complicated system called benchmark prime lending rate (BPLR). Each bank has its own BPLR which is very difficult for borrowers to compare rates across banks.
Now, with the base rate, it will be easier for everyone to compare across banks and to get a more transparent sense of how the interest rate for the loan is being arrived at.

Is interest rate going to be cheaper? Will my EMI change?
The most important thing to keep in mind is that the cost of money is not changing, i.e., if a car loan cost about 12% or a home loan cost 9%, these rates of interest charged are not going to change.
Its just that the method used to arrive at this will be more clear to everyone. So, interest rates aren’t coming down as a result of this base rate implementation.
Following on from this, your EMI on an existing loan is also not going to change. You will continue to pay whatever you were paying up to last month in future months as well.


Should one change to a bank with a lower base rate?
As mentioned above, the cost of money is not changing. Most banks continue to charge a very similar rate of interest as they did before. Just because one bank has a base rate of 7% and another has a rate of 8.5% does not mean one should change to the bank with the lower rate.
On top of base rate there are additional amount of interest that the banks are charging, to cover its cost of doing business, and some compensation for the risk its taking in lending money.
So, after all these additions, its unlikely that the lending rates of one bank are any different to the rate being charged by any other bank. And there is no major advantage to shifting from one bank to another.

How does the base rate affect pre-existing loan?
For existing loans, there is nothing going to change. As mentioned above, interest rates aren’t changing in the economy. However, when any loan comes up for renewal, then it will be priced using the base rate formula.

Will the base rate remain fixed forever?
No, the RBI has given guidelines to banks to adjust their base rates depending upon the prevailing market conditions and interest rate policies. Expect to see banks update their base rates every few months if that is required. Banks will then communicate this to all their clients.

Share |

Tuesday, April 13, 2010

Google Adsense Alternatives to Earn Money by Placing Ads on Your Blog or Website.


Google Adsense, a company which has changed the Internet to an online money making market. Google Adsense is a best way to earn online. They pay good and honestly if your work is unique and constant. Many of people are just blogging for making money on internet through Google Adsense or other ways. But there are many webmasters, bloggers and publishers which are not happy with Google Adsense and are looking for Alternative of Google Adsense to be able to earn online again because either they dont like Google Adsense (i don't know why) or they are banned by Google Adsense for Fraud Clicks, Invalid activities or violating their TOS (Terms and Conditions).

People are looking for Better Adsense Alternatives as a new source to earn and they make some extra bucks. But some of them want to left Google because Google only pays when the earning amount is $100 one more problem is Google Adsense PIN Code which Google Adsense send by mail (not my email) after confirming The Publisher has $10 in his Google Adsense Account. As minimum payout is $100, that can a healthy amount for small bloggers to earn and may take ages to get their first check from Google Adsense.

One more problem is Google only pays through Check and Western Union But several publishers like Paypal as a payment source which Google Adsense do not accept for Unknown reasons. There are many people which are earning in 5-6 digits $ money without getting a single penny from Google Adsense John Chow is a Good example of this.

Webmasters or publishers which are not accepted in Google Adsense, Banned by them or do not like to go with Google Adsense will like this list of Adsense Alternatives given below.



Note: [If there is any ad network which is not listed then please add that website link in comments]

Share |

Thursday, March 11, 2010

Eclipse: Using extension-point to avoid cyclic dependency between 2 plugins without refactoring code


I have encountered a cyclic dependency issue while developing application using eclipse based plug-in development environment. Here I am going to explain the issue, which you might be also encountered during the plug-in development and which would have lead you to re-factorize your code to solve this issue. But here I am going to use extension-point using which I can invoke execute code from another plug-in and get results without adding interdependency between them.

Example:
I have eclipse plug-ins PluginA and PluginB, here PluginB is already dependent on PluginA. Now I have some class method in PluginB, and I would like to execute that method from one of the class in PluginA .
- If we add the dependency of PluginA on PluginB then it would result in cyclic dependency.
- Alternatively, what we can do is to re-factor the code in such a way that this method and relevant calsses moved to PluginA so that it would be available in both PluginA and PluginB, but this solution will be expensive in the well deployed system since it involves lot of testing efforts and it may break, if we missed out something during re-factoring, And there may more such logic should come out and again we need to re-factorize with same process.
- Here, I am going to discuss alternate and permanent solution which can be used for calling method of the class which belong to PluginB form some class of PluginA without adding dependency and avoiding the re-factorization of the code.


Solution

Step 1: Create extension point.

  • Create new common plug-in let's say PluginC.
  • In this common plug-in create on interface as follows:
    package test;
    
    import java.util.Map;
    
    /**
     * @author Tejash Shah
     *
     */
    public interface IActionHandler {
      /**
         * This method is used by  ActionManager class to set the id when contribution is added in plugin.xml
         * 
         * @param id
         */
     public void setId(String id);
     
     /**
         * @return the unique id of the Action Handler
         */
        public String getId();
        
        /**
         * @param variables
         *            Here, you can pass the set of Objects which is required by the Action Handler to run the action. Here
         *            key will be name of variable and value can be any Object containing value
         * @return the result of the execution, which can be any kind of Object
         */
        public Object run(Map variables);
    }
    
  • Now open plugin.xml for PluginC using Plug-In Editor of eclipse, switch to "Extension Points" tab and click on "Add" button to add the extension point

  • Provide the "Extension Point ID", "Extension Point Name" and "Extension Point Schema" as per your requirements.
  • On "Finish" it will open editor for defining "Extension Point" schema as follows, switch to "Definition" tab in it

  • Click on "New Element" to add additional element bellow, and provide its Name as "ActionHandler"

  • Then select "ActionHandler" element and add 2  "New Attribute" named "id" and "handlerClass" for the same and set attribute details as follows:

  • For "id" element select value of "Use" as "requied" and rest of them keep it as it is
  • For "handlerClass" select the value of "Use" as "requied", then set "Type" to "java" and for value of "Implements" click on "Browse..." button and select the interface IActionHandler which we defined previously.
  • After this select "extension" element in the tree and add "New Sequence" and select check box for "Unbounded" for the newly added sequence.

  • Then right click on the "Sequence (1-*)" and form context menu select "New" -> "ActionHandler" and for "ActionHAndler" also select check box for the "Unbounded".
  • Now, "Save All" the edited files (plugin.xml and schema file).
  • If you check the source of the schema (.exsd) file for this extension-point, it would be as follows:

    <?xml version='1.0' encoding='UTF-8'?>
    <!-- Schema file written by PDE -->
    <schema targetNamespace="Test" xmlns="http://www.w3.org/2001/XMLSchema">
    <annotation>
          <appinfo>
             <meta.schema plugin="Test" id="test.actionHandler" name="SampleActionHandler"/>
          </appinfo>
          <documentation>
             [Enter description of this extension point.]
          </documentation>
       </annotation>
    
       <element name="extension">
          <annotation>
             <appinfo>
                <meta.element />
             </appinfo>
          </annotation>
          <complexType>
             <sequence minOccurs="1" maxOccurs="unbounded">
                <element ref="ActionHandler" minOccurs="1" maxOccurs="unbounded"/>
             </sequence>
             <attribute name="point" type="string" use="required">
                <annotation>
                   <documentation>
                      
                   </documentation>
                </annotation>
             </attribute>
             <attribute name="id" type="string">
                <annotation>
                   <documentation>
                      
                   </documentation>
                </annotation>
             </attribute>
             <attribute name="name" type="string">
                <annotation>
                   <documentation>
                      
                   </documentation>
                   <appinfo>
                      <meta.attribute translatable="true"/>
                   </appinfo>
                </annotation>
             </attribute>
          </complexType>
       </element>
    
       <element name="ActionHandler">
          <complexType>
             <attribute name="id" type="string" use="required">
                <annotation>
                   <documentation>
                      
                   </documentation>
                </annotation>
             </attribute>
             <attribute name="handlerClass" type="string" use="required">
                <annotation>
                   <documentation>
                      The class which will provide implementation of IActionHandler and where you can write the logic to handle the action.
    
    You can it&apos;s instance by providing id of ActionHandler and you can call run() method to excute the action
                   </documentation>
                   <appinfo>
                      <meta.attribute kind="java" basedOn=":test.IActionHandler"/>
                   </appinfo>
                </annotation>
             </attribute>
          </complexType>
       </element>
    
       <annotation>
          <appinfo>
             <meta.section type="since"/>
          </appinfo>
          <documentation>
             [Enter the first release in which this extension point appears.]
          </documentation>
       </annotation>
    
       <annotation>
          <appinfo>
             <meta.section type="examples"/>
          </appinfo>
          <documentation>
             [Enter extension point usage example here.]
          </documentation>
       </annotation>
    
       <annotation>
          <appinfo>
             <meta.section type="apiinfo"/>
          </appinfo>
          <documentation>
             [Enter API information here.]
          </documentation>
       </annotation>
    
       <annotation>
          <appinfo>
             <meta.section type="implementation"/>
          </appinfo>
          <documentation>
             [Enter information about supplied implementation of this extension point.]
          </documentation>
       </annotation>
    
    
    </schema>
    
Step 2: Create a manager class withing PluginC 
  •  Create new class "SampleActionManager" withing PluginC as follows to load the all contributed actionHandlers.

    /**
     * 
     */
    package test;
    
    import java.util.HashMap;
    import java.util.Map;
    
    import org.eclipse.core.runtime.CoreException;
    import org.eclipse.core.runtime.IConfigurationElement;
    import org.eclipse.core.runtime.IExtensionPoint;
    import org.eclipse.core.runtime.IExtensionRegistry;
    import org.eclipse.core.runtime.Platform;
    
    /**
     * @author Tejash Shah
     *
     */
    public class SampleActionManager {
    
      private static SampleActionManager handler = new SampleActionManager();
         
         private static final String ATTRIB_ID = "id";
    
         private static final String ATTRIB_CLASS = "handlerClass";
         
         private static final String SAMPEL_ACTION_HANDLER = "test.actionHandler"; // ID given in Plugin.xml while adding extension point
    
         private Map actionHandlers;
    
         private SampleActionManager() {
             loadSonicActionHandler();
         }
    
         private void loadSonicActionHandler() {
             actionHandlers = new HashMap();
             IConfigurationElement[] configurationElements = getConfigurationElements(SAMPEL_ACTION_HANDLER);
             for (int i = 0; i < configurationElements.length; i++) {
                 try {
                     Object extensionObject = configurationElements[i].createExecutableExtension(ATTRIB_CLASS);
                     IActionHandler contributor = (IActionHandler)extensionObject;
                     String id = configurationElements[i].getAttribute(ATTRIB_ID);
                     contributor.setId(id);
                     actionHandlers.put(id, contributor);
                 } catch (CoreException e) {
                     e.printStackTrace();
                 }
             }
         }
    
         public static SampleActionManager getInstance() {
             return handler;
         }
    
         public IActionHandler getActionHandlerbyId(String id) {
             return actionHandlers.get(id);
         }
         
         public static IConfigurationElement[] getConfigurationElements(String extensionPointID) {
             IExtensionRegistry registry = Platform.getExtensionRegistry();
             IExtensionPoint contentTypesXP = registry.getExtensionPoint(extensionPointID);
             if (contentTypesXP == null)
                 return new IConfigurationElement[0];
             IConfigurationElement[] allContentTypeCEs = contentTypesXP.getConfigurationElements();
             return allContentTypeCEs;
         }
    }
    

  • You can also optionally create an abstract class "AbstractActionHandler" as follows:



    /**
     * 
     */
    package test;
    
    
    /**
     * @author Tejash
     *
     */
    public abstract class AbstractActionHandler implements IActionHandler {
    
     private String id = "";
      
     /* (non-Javadoc)
      * @see test.IActionHandler#getId()
      */
     public String getId() {
      return this.id;
     }
    
     /* (non-Javadoc)
      * @see test.IActionHandler#setId(java.lang.String)
      */
     public void setId(String id) {
      this.id = id;
     }
    
    }
    

    Step 3: Add plug-in dependencies.
    • Open plugin.xml for the PluginA and PluginB in "Plug-In Editor" switch to "Dependencies" tab and add dependency to PlugInC in both the plug-in and save both plugin.xml
    Step 4: Add contribute to this extension point form PluginB where the particular method logic belongs to
    • Open plugin.xml for the PluginB in "Plug-in Editor" and go to "Extensions" tab, click on "Add" button and add the extension for "test.actionHandler" which we have defined in PluginC.
    • You can provide "ID" and "Name" for this extension as shown in the bellow image.

    • Then select the child node of Extension to provide extension related details as follows:

    • e.g. I have given "id" as "MyActionHandler", then click on "handlerClass" link which will launch "New Java Class Wizard". Here you can provide all required details as shown in the above image. And optionally select Sueprclass value as the "AbstractActionHandler"Class if you have created it previously.
    • On click on "Finish" it will create default implementation of "MyActionHandler" class, you change run method to invoke any method of class which belong to PluginB. view the sample code as follows:

      /**
       * 
       */
      package test;
      
      import java.util.Map;
      
      /**
       * @author tejash
       *
       */
      public class MyActionHandler extends AbstractActionHandler implements
        IActionHandler {
      
       /**
        * 
        */
       public MyActionHandler() {
        // TODO Auto-generated constructor stub
       }
      
       /* (non-Javadoc)
        * @see test.IActionHandler#run(java.util.Map)
        */
       public Object run(Map variables) {
        // You logic to invoke method particular class goes here
        //e.g. 
        // return Myclass.myMethod();
        // If you have some arguments then you can receive as part of variables object 
        return null;
       }
      
      }
      
    Step 5: Finally use ActionManger from PluginA to call desired class method which belongs to PluginA.
    • Now in the PluginA where we wanted to make call to some method of PlugInB, we can get the ActionHandler object for the same and then pass appropriate variable and invoke run method to get the result object as follows:

      IActionHandler actionHandler = SampleActionManager.getInstance().getActionHandlerbyId("MyActionHandler");
        Map variables = new HashMap();
        //Here you can add as many objects to variables
        //then make call to run method to execute method in another plug-in and get results as follows:
        Object result = actionHandler.run(variables);
        //use the result here for further processing logic
      
    • Once you get the result Object, you can write further processing logic on it

    You are now able to invoke a class method of PluginB from PluginA without adding dependency or code re-factoring.

    Note: Next time if you code across similar issue for other class methods even if they belong to some other plugin say PluginX then also you can use the same "Extension" by just adding dependent on PluginC. Then create ActionHandler using Extension.

    Share |

    How to avoid Spring validation errors: Unable to locate Spring Namespace handler , Incorrect usage of element for certain elements , No setter found for property , Class Not Found


    I integrated spring IDE plug-ins in my eclipse environment. I wanted use some additional namespaces like camel, CXF and some custom schema to spring.xml, spring beans file. When I tried to validate the spring.xml file the spring IDE it was showing following errors and warnings in "Problems" / "Error Log" view of eclipse

    •  Unable to locate Spring Namespace handler...
    •  Incorrect usage of element for certain elements ... (The element was refereed form my custom schema)
    •  Many errors of Class Not Found.
    •  No setter found for property ... (When I am trying to set some property in spring.xml) 

    Here, I am going to discuss the approaches I used to solve these issues.


    Issue 1: Unable to locate Spring Namespace handler...
    1) To resolve this issue there must be Namespace Handler implemented for the namespaces used in the spring beans (spring.xml) file. Now add the jar file containing NamespaceHandler implementation and all other dependent jars to the spring project's class path. This would probably solve this issue, but still this error is not resolved for me. In this case I have applied second solution of contributing NamespaceHandler using eclipse plug-in as follows:.
    - You can create new eclipse plug-in or use any existing eclipse plug-in for this purpose
    - First copy jar file containing NamespaceHandler class and all other dependent jar files to the plug-in. (e.g. I copied them to "lib" directory of my plug-in)
    - Now open plugin.xml using plug-in editor in the eclipse and go to "Runtime" tab. Here in the "Classpath" section add all the jars which we have copied. (Before this make sure that .classpath file is not read-only)
    - This will add all the jars in to project as well as plug-in's run-time classpath.
    - Then configure plug-in dependencies by going to "Dependencies" tab. Here add the dependencies to following plug-ins if they are not already added.
    • org.springframework.ide.eclipse.beans.core
    • org.eclipse.ui
    • org.eclipse.core.runtime

    - Note: you can also add the more plugin dependencies if they are required for the NamespaceHandler to work.
    - After this you can contribute to spring NamespaceHandler using extension; you can switch to "Extensions" tab for this.
    - Here, add the extension "org.springframework.ide.eclipse.beans.core.namespaces" by clicking on the add button. This will create extension entry as shown in the following image.
    - If you look at source of plugin.xml file it would look like:

    <extension
            point="org.springframework.ide.eclipse.beans.core.namespaces">
         <namespace
               namespaceHandler="spring.util.NamespaceHandler1"
               uri="spring.util.namespace1">
         </namespace>
      </extension>
    - As shown in above screen-shot we need to provide actual namespace URI as value of "uri", the fully qualified class name of NamespaceHandler class as value if "namespaceHandler". You can give some meaningful "name" (optional) to this contribution. If you have your custom element provider then provide its fully qualified name in "elementProvider" (optional).
    - If you have more than one custom namespaces refereed in spring.xml then you can either add multiple extension-point contribution as shown above or you can just add multiple namespace entries withing same extension-point contribution as follows:
    • Right click on extension-point contribution to open the context menu; click on new -> namespace. This will add the new NamespaceHandler contribution entry and configure required required values as I have mentioned above.

    - Now launch the eclipse with this plug-in contribution and it would resolve all warnings related to Unable to locate Spring Namespace handler...

     Issue 2 : Incorrect usage of element for certain elements ... (The element was refereed form my custom schema)
    If you have contributed NamespaceHandler as shown in the above solution and your namespace handler properly handles the validation for the different element of the custom schema, then this issue will also be resolved as part of it.

    Issue 3: Many errors of Class Not Found.
    This error can come in the "Problems" view or in the "Error Log" view you might find stack trace stating ClassNotFoundExceotion or NoClassDefError. There are 2 scenarios when this error could come
    1. NamespaceHandler class is directly or indirectly referring that particular class, and it is not part of plug-in (The plug-in using which we contributed NamespaceHandlers) classpath.
      • This you can determine by looking at the stack trace of that error. If stack trace some where refers to Namespace handler or its relevant classes then the particular class is referred directly or indirectly from Namespace handler.
      • In this case pick up the jar file containing missing class in it and copy it to plug-in (e.g. "lib" directory of plug-in) and then add it to runtime classpath of the plug-in as I have mentioned in the Issue-1 and this would get rid of particular class not found error
    2. Bean defined inside spring.xml  file is referring, that class is missing or it is internally using this class.
      • Here you check the error in "Problems" view and check if this class is used to create the bean in side spring,xml or not? or else this class is referred in directly from one of the beans defined in the spring.xml
      • To solve this issue we need to determine the required jars for the all missing classes and then add all the required jar to Spring project's class path. (Here it is not required to copy jar files to project it self you can refer them as external jars also)
    Issue 4: No setter found for property ... (When I am trying to set some property in spring.xml)
    This error comes in "Problems" view of the eclipse. It could have occurred because of 2 reasons
    1. The property which we are trying to set on the bean, for the same setter method was not defined in the class.
      • In this case define setter method withing class definition as "setPropertyName(...)" with required logic.
    2. The setter method for that particular property does not belongs to same class but it belongs to parent or super parent class, but still you are getting "No setter found for property ..." error for the same property
      • In this scenario, you need to verify that all the classes in the hierarchy and all the class which it may directly or indirectly refer to must be present in "Spring" project's class path. (if they are present in third-party jars then those jars should be part of "Spring" project's classpath).

    Share |

    Thursday, March 04, 2010

    Embedding a Wave in Blogger various ways


    I came across the wave created by Timothy Brown. Which talks about various ways to embed a Wave to Blogger. Hence I feel that I should embed it here so that everyone can get benefited form it.

    Share |

    Monday, January 04, 2010

    WS-I Basic Profile 1.1 and Schema Reference Behaviors and Specifications


    I have done some research on WS-I Basic profile and I would like to explain what basic profile says in simple words.

    What is the need for WS-I Basic Profile?

    WS-I Basic Profile defines specification for WSDL document to avoid the confusion present in WSDL specification. As per WSDL specification following example is valid but as per WS-I it is incorrect

    <wsdl:definitions name="StockQuote"
    targetNamespace="http://example.com/stockquote/definitions"
    xmlns:stock="http://example.com/stockquote/schemas""
    ...
    xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">
    
    < wsdl:import namespace="http://example.com/stockquote/schemas"
    location="http://example.com/stockquote/stockquote.xsd"/>
    
    < wsdl:message name="GetLastTradePriceInput">
    < wsdl:part name="body" element="xsd1:TradePriceRequest"/>
    </ wsdl:message>
    ...
    </ wsdl:definitions>


    As per WS-I Basic Profile we can import only WSDL document using wsdl:import. For importing XSD document we need to use xsd:import within wsdl:type section as follows:

    <?xml version="1.0" encoding="UTF-8"?>
    <wsdl:definitions name="StockQuote"
    targetNamespace="http://example.com/stockquote/definitions"
    xmlns:stock="http://example.com/stockquote/schemas"
    ...
    xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">
    <wsdl:types>
    <xsd:schema targetNamespace="urn:myschema"
    xmlns:stock="http://example.com/stockquote/schemas"
    xmlns:xsd="http://www.w3.org/2001/XMLSchema">
    <xsd:import namespace="http://example.com/stockquote/schemas" schemaLocation="http://example.com/stockquote/stockquote.xsd"/>
    </xsd:schema>
    </wsdl:types>
    <wsdl:message name="GetLastTradePriceInput">
    < wsdl:part name="body" element="stock:TradePriceRequest"/>
    </wsdl:message>
    ...
    </wsdl:definitions>



    What am I going to discuss in this post?

    On reading the spec it is not immediately clear what the point means and having examples would be really useful. So I am going to discuss the points from the spec related to types/elements visibility with several examples. WS-I Basic Profile provides specifications for WSDL, SOAP, XML, XML Schema and many other things related to Web Services. Among these, I am going to discuss about the visibility of types defined in the Type section of WSDL as well as imported / included types from XML schema (XSD). Also how XML schema data types are visible within schema document as well as across imported and included schema documents.

    I will begin with visibility for XSD document and later discuss the type visibility for WSDL document

    Visibility for XSD document along with sample XML document
    1. Import XSD document inside another XSD document




      • Types, elements, attributes and groups defined in imported XSD document should be visible inside current XSD document



        • Example:

          SubSchema.xsd



          <?xml version="1.0" encoding="UTF-8"?>
          <xsd:schema targetNamespace="http://subNamespace.com"
          xmlns:xsd="http://www.w3.org/2001/XMLSchema"
          xmlns:tns="http://subNamespace.com"
          xmlns="http://subNamespace.com">
          <xsd:complexType name="AComplexTypeInSubSchema">
          <xsd:sequence>
          <xsd:element name="SomeData" type="xsd:string">
          </xsd:element>
          <xsd:element name="SomeMoreData" type="xsd:string">
          </xsd:element>
          </xsd:sequence>
          </xsd:complexType>
          </xsd:schema>


          MasterSchema.xsd



          <?xml version="1.0" encoding="UTF-8"?>
          <xsd:schema targetNamespace="http://masterNamespace.com"
          xmlns:ssns="http://subNamespace.com"
          xmlns:tns="http://masterNamespace.com"
          xmlns:xsd="http://www.w3.org/2001/XMLSchema">
          <xsd:import namespace="http://subNamespace.com" schemaLocation="SubSchema.xsd"/>
          <xsd:complexType name="AComplexTypeInMaster">
          <xsd:sequence>
          <xsd:element name="MasterTypeData1" type="xsd:string"/>
          <xsd:element name="ElementFromSubSchemaType" type="ssns:AComplexTypeInSubSchema"/>
          </xsd:sequence>
          </xsd:complexType>
          <xsd:element name="ElementFromMasterSchemaType" type="tns:AComplexTypeInMaster"/>
          </xsd:schema>


        • As shown in above examples "AComplexTypeInSubSchema" is defined in "SubSchema.xsd" which becomes visible in MasterSchema.xsd after "SubSchema.xsd" is imported inside "MasterSchema.xsd".

        • Note: "AComplexTypeInSubSchema" is accessible in MasterSchema.xsd using namespace prefix ssns defined for its namespace "http://subNamespace.com"
        • Sample XML Document using ElementFromMasterSchemaType



          <?xml version="1.0" encoding="UTF-8"?>
          <com:ElementFromMasterSchemaType xsi:schemaLocation="http://masterNamespace.com file:/C:/Schemas/importedtypes/MasterSchema.xsd"
          xmlns:com="http://masterNamespace.com"
          xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
          <MasterTypeData1>string</MasterTypeData1>
          <ElementFromSubSchemaType>
          <SomeData>string</SomeData>
          <SomeMoreData>string</SomeMoreData>
          </ElementFromSubSchemaType>
          </com:ElementFromMasterSchemaType>

      • Types, elements, attributes and groups defined in nested imported XSD document not be visible inside current XSD document



        • Example:

          SubSchema2.xsd



          <?xml version="1.0" encoding="UTF-8"?>
          <xsd:schema targetNamespace="http://subNamespace.com"
          xmlns:xsd="http://www.w3.org/2001/XMLSchema"
          xmlns:tns="http://subNamespace2.com"
          xmlns="http://subNamespace.com">
          <xsd:complexType name="ANestedComplexTypeInSubSchema">
          <xsd:sequence>
          <xsd:element name="SomeData" type="xsd:string">
          </xsd:element>
          <xsd:element name="SomeMoreData" type="xsd:string">
          </xsd:element>
          </xsd:sequence>
          </xsd:complexType>
          </xsd:schema>


          SubSchema.xsd



          <?xml version="1.0" encoding="UTF-8"?>
          <xsd:schema targetNamespace="http://subNamespace.com"
          xmlns:xsd="http://www.w3.org/2001/XMLSchema"
          xmlns:tns="http://subNamespace.com"
          xmlns:ssns="http://subNamespace2.com"
          xmlns="http://subNamespace.com">
          <xsd:import namespace="http://subNamespace2.com" schemaLocation="SubSchema2.xsd"/>
          <xsd:complexType name="AComplexTypeInSubSchema">
          <xsd:sequence>
          <xsd:element name="SomeData" type="xsd:string">
          </xsd:element>
          <xsd:element name="SomeMoreData" type="xsd:string">
          </xsd:element>
          <xsd:element name="ElementFromNestedSubSchemaType" type="ssns:ANestedComplexTypeInSubSchema"/><!-- This is valid -->
          </xsd:sequence>
          </xsd:complexType>
          </xsd:schema>


          MasterSchema.xsd



          <?xml version="1.0" encoding="UTF-8"?>
          <xsd:schema targetNamespace="http://masterNamespace.com"
          xmlns:ssns="http://subNamespace.com"
          xmlns:tns="http://masterNamespace.com"
          xmlns:xsd="http://www.w3.org/2001/XMLSchema">
          <xsd:import namespace="http://subNamespace.com" schemaLocation="SubSchema.xsd"/>
          <xsd:complexType name="AComplexTypeInMaster">
          <xsd:sequence>
          <xsd:element name="MasterTypeData1" type="xsd:string"/>
          <xsd:element name="MasterTypeData2" type="xsd:string"/>
          <xsd:element name="ElementFromNestedSubSchemaType" type="ssns:ANestedComplexTypeInSubSchema"/><!-- This is not valid -->
          <xsd:element name="ElementFromSubSchemaType" type="ssns:AComplexTypeInSubSchema"/><!-- This is valid -->
          </xsd:sequence>
          </xsd:complexType>
          <xsd:element name="ElementFromMasterSchemaType" type="tns:AComplexTypeInMaster"/>
          </xsd:schema>
          


        • In the above examples MasterSchema.xsd is importing SubSchema.xsd and SubSchema.xsd is further importing SubSchema2.xsd. As I mentioned above nested imported types are not visible in the current schema document. Therefor, using ANestedComplexTypeInSubSchema which is defined in SubSchema2.xsd is invalid for MasterSchema.xsd but same thing is valid inside SubSchema.xsd since it is directly importing SubSchema2.xsd
        • As per the previous example using AComplexTypeInSubSchema inside MasterSchema.xsd is valid, since we have imported SubSchema.xsd in MasterSchema.xsd




      • If imported XSD file has included some XSD files then type, elements, attributes and groups defined in that nested included XSD file should be visible inside current XSD document



        • Example:

          SubSchema2.xsd



          <?xml version="1.0" encoding="UTF-8"?>
          <xsd:schema targetNamespace="http://subNamespace.com"
          xmlns:xsd="http://www.w3.org/2001/XMLSchema"
          xmlns:tns="http://subNamespace2.com"
          xmlns="http://subNamespace.com">
          <xsd:complexType name="ANestedComplexTypeInSubSchema">
          <xsd:sequence>
          <xsd:element name="SomeData" type="xsd:string">
          </xsd:element>
          <xsd:element name="SomeMoreData" type="xsd:string">
          </xsd:element>
          </xsd:sequence>
          </xsd:complexType>
          </xsd:schema>


          SubSchema.xsd



          <?xml version="1.0" encoding="UTF-8"?>
          <xsd:schema targetNamespace="http://subNamespace.com"
          xmlns:xsd="http://www.w3.org/2001/XMLSchema"
          xmlns:tns="http://subNamespace.com"
          xmlns="http://subNamespace.com">
          <xsd:include schemaLocation="SubSchema2.xsd"/>
          <xsd:complexType name="AComplexTypeInSubSchema"> <!-- This is valid -->
          <xsd:sequence>
          <xsd:element name="mysubelement" type="xsd:string">
          </xsd:element>
          <xsd:element name="nestedIncludedElement" type="ANestedComplexTypeInSubSchema">
          </xsd:element>
          </xsd:sequence>
          </xsd:complexType>
          </xsd:schema>


          MasterSchema.xsd



          <?xml version="1.0" encoding="UTF-8"?>
          <xsd:schema targetNamespace="http://masterNamespace.com"
          xmlns:ssns="http://subNamespace.com"
          xmlns:tns="http://masterNamespace.com"
          xmlns:xsd="http://www.w3.org/2001/XMLSchema">
          <xsd:import namespace="http://subNamespace.com" schemaLocation="SubSchema.xsd"/>
          <xsd:complexType name="AComplexTypeInMaster">
          <xsd:sequence>
          <xsd:element name="MasterTypeData1" type="xsd:string"/>
          <xsd:element name="ElementFromSubSchemaType" type="ssns:AComplexTypeInSubSchema"/> <!-- This is valid -->
          <xsd:element name="myNestedIncluedElement" type="ssns:ANestedComplexTypeInSubSchema"/><!-- This is valid -->
          </xsd:sequence>
          </xsd:complexType>
          
          <xsd:element name="ElementFromMasterSchemaType" type="tns:AComplexTypeInMaster"/>
          </xsd:schema>
        • In the above examples MasterSchema.xsd is importing SubSchema.xsd and SubSchema.xsd is further including SubSchema2.xsd. As I mentioned above nested included types are not visible in the current schema document. Therefor, using ANestedComplexTypeInSubSchema which is defined in SubSchema2.xsd is valid for MasterSchema.xsd and also inside SubSchema.xsd since it is directly importing SubSchema2.xsd
        • Sample XML Document using ElementFromMasterSchemaType in MasterSchema.xsd
        • <?xml version="1.0" encoding="UTF-8"?>
          <com:ElementFromMasterSchemaType
          xsi:schemaLocation="http://masterNamespace.com file:/C:/Schemas/nestedImport/MasterSchema.xsd"
          xmlns:com="http://masterNamespace.com"
          xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
          <MasterTypeData1>string</MasterTypeData1>
          <ElementFromSubSchemaType>
          <mysubelement>string</mysubelement>
          <nestedIncludedElement>
          <SomeData>string</SomeData>
          <SomeMoreData>string</SomeMoreData>
          </nestedIncludedElement>
          </ElementFromSubSchemaType>
          <myNestedIncluedElement>
          <SomeData>string</SomeData>
          <SomeMoreData>string</SomeMoreData>
          </myNestedIncluedElement>
          </com:ElementFromMasterSchemaType>

    2. Include XSD document within another XSD




      • Types, elements, attributes and groups defined in included XSD file should be visible inside current XSD document



        • Examples

          A.xsd



          <?xml version="1.0"?>
          <xsd:schema targetNamespace="http://example.org/mynamespace"
          xmlns:xsd="http://www.w3.org/2001/XMLSchema"
          xmlns="http://example.org/mynamespace">
          <xsd:element name="AElement" type="AType"/>
          <xsd:complexType name="AType">
          <xsd:sequence>
          <xsd:element name="elStr" type="xsd:string"/>
          <xsd:element name="elInt" type="xsd:int"/>
          </xsd:sequence>
          </xsd:complexType>
          </xsd:schema>
          


          B.xsd



          <?xml version="1.0"?>
          <xsd:schema targetNamespace="http://example.org/mynamespace"
          xmlns:xsd="http://www.w3.org/2001/XMLSchema"
          xmlns="http://example.org/mynamespace">
          <xsd:include schemaLocation="A.xsd"/>
          <xsd:element name="BAElement" type="BType"/>
          <xsd:element name="AElementInsideB" type="AType"/> <!-- Valid Included Type  -->
          <xsd:complexType name="BType">
          <xsd:sequence>
          <xsd:element name="elStr" type="xsd:string"/>
          <xsd:element name="elInt" type="xsd:int"/>
          </xsd:sequence>
          </xsd:complexType>
          </xsd:schema>
          

        • As shown in the above example B.xsd is including A.xsd and hence AType is visible inside B.xsd

      • Types, elements, attributes and groups defined in nested included XSD file should be visible inside current XSD document



        • Example

          A.xsd



          <?xml version="1.0"?>
          <xsd:schema targetNamespace="http://example.org/mynamespace"
          xmlns:xsd="http://www.w3.org/2001/XMLSchema"
          xmlns="http://example.org/mynamespace">
          <xsd:element name="AElement" type="AType"/>
          <xsd:complexType name="AType">
          <xsd:sequence>
          <xsd:element name="elStr" type="xsd:string"/>
          <xsd:element name="elInt" type="xsd:int"/>
          </xsd:sequence>
          </xsd:complexType>
          </xsd:schema>


          B.xsd



          <?xml version="1.0"?>
          <xsd:schema targetNamespace="http://example.org/mynamespace"
          xmlns:xsd="http://www.w3.org/2001/XMLSchema"
          xmlns="http://example.org/mynamespace">
          <xsd:include schemaLocation="A.xsd"/>
          <xsd:element name="BAElement" type="BType"/>
          <xsd:element name="AElementInsideB" type="AType"/> <!-- This is valid Included Type  -->
          <xsd:complexType name="BType">
          <xsd:sequence>
          <xsd:element name="elStr" type="xsd:string"/>
          <xsd:element name="elInt" type="xsd:int"/>
          </xsd:sequence>
          </xsd:complexType>
          </xsd:schema>


          C.xsd



          <?xml version="1.0"?>
          <xsd:schema targetNamespace="http://example.org/mynamespace"
          xmlns:xsd="http://www.w3.org/2001/XMLSchema"
          xmlns="http://example.org/mynamespace">
          <xsd:include schemaLocation="B.xsd"/>
          <xsd:element name="CElement" type="CType"/>
          <xsd:element name="AElementInsideC" type="AType"/>    <!-- This is valid Nested included Type -->
          <xsd:element name="BElementInsideC" type="BType"/>    <!-- This is valid direct included Type -->
          <xsd:complexType name="CType">
          <xsd:sequence>
          <xsd:element name="elStr" type="xsd:string"/>
          <xsd:element name="elInt" type="xsd:int"/>
          </xsd:sequence>
          </xsd:complexType>
          </xsd:schema>
          
        • In the above examples B.xsd is including A.xsd and C.xsd is including B.xsd, i.e. A.xsd is nested included inside C.xsd. As I mentioned above the AType defined in A.xsd is visible inside B.xsd as well as C.xsd
      • If included XSD files has imported some XSD file then those types, elements, attributes and groups defined in that nested imported XSD file must not be visible inside current XSD document.
        If we want to make types, elements, attributes and groups from nested imported XSD document visible then need to explicitly import that XSD document.



        • Exammple

          D.xsd



          <?xml version="1.0"?>
          <xsd:schema targetNamespace="http://example.org/anothernamespace"
          xmlns:xsd="http://www.w3.org/2001/XMLSchema"
          xmlns="http://example.org/anothernamespace">
          <xsd:element name="DElement" type="DType"/>
          <xsd:complexType name="DType">
          <xsd:sequence>
          <xsd:element name="elStr" type="xsd:string"/>
          <xsd:element name="elInt" type="xsd:int"/>
          </xsd:sequence>
          </xsd:complexType>
          </xsd:schema>


          B.xsd



          <?xml version="1.0"?>
          <xsd:schema targetNamespace="http://example.org/mynamespace"
          xmlns:xsd="http://www.w3.org/2001/XMLSchema"
          xmlns="http://example.org/mynamespace"
          xmlns:dn="http://example.org/anothernamespace">
          <xsd:import namespace="http://example.org/anothernamespace" schemaLocation="D.xsd"/>
          <xsd:element name="BAElement" type="BType"/>
          <xsd:element name="DElementInsideB" type="dn:DType"/> <!-- Valid use of Imported Type  -->
          <xsd:complexType name="BType">
          <xsd:sequence>
          <xsd:element name="elStr" type="xsd:string"/>
          <xsd:element name="elInt" type="xsd:int"/>
          </xsd:sequence>
          </xsd:complexType>
          </xsd:schema>
          


          C.xsd (Invalid use of nested import)



          <?xml version="1.0"?>
          <xsd:schema targetNamespace="http://example.org/mynamespace"
          xmlns:xsd="http://www.w3.org/2001/XMLSchema"
          xmlns="http://example.org/mynamespace">
          <xsd:include schemaLocation="B.xsd"/>
          <xsd:element name="CElement" type="CType"/>
          <xsd:element name="AElementInsideC" type="BType"/><!-- This is valid, included Type -->
          <xsd:element name="DElementInsideC" type="dn:DType"/&gt;<!-- This is not valid, nested imported Type -->
          <xsd:complexType name="CType">
          <xsd:sequence>
          <xsd:element name="elStr" type="xsd:string"/>
          <xsd:element name="elInt" type="xsd:int"/>
          </xsd:sequence>
          </xsd:complexType>
          </xsd:schema>


          C.xsd (Valid use of imported type)



          <?xml version="1.0"?>
          <xsd:schema targetNamespace="http://example.org/mynamespace"
          xmlns:xsd="http://www.w3.org/2001/XMLSchema"
          xmlns="http://example.org/mynamespace"
          xmlns:dn="http://example.org/anothernamespace">
          <xsd:include schemaLocation="B.xsd"/>
          <xsd:import namespace="http://example.org/anothernamespace" schemaLocation="D.xsd"/>
          <xsd:element name="CElement" type="CType"/>
          <xsd:element name="AElementInsideC" type="BType"/><!-- This is valid, included Type -->
          <xsd:element name="DElementInsideC" type="dn:DType"/><!-- This is valid, imported Type -->
          <xsd:complexType name="CType">
          <xsd:sequence>
          <xsd:element name="elStr" type="xsd:string"/>
          <xsd:element name="elInt" type="xsd:int"/>
          </xsd:sequence>
          </xsd:complexType>
          </xsd:schema>
          
        • As shown in the above example B.xsd is importing D.xsd so it is valid to use DType in B.xsd
        • In invalid C.xsd we are including B.xsd in C.xsd. In this case using BType inside C.xsd is valid case but using DType inside C.xsd is invalid since it is not imported in C.xsd and hence it is not visible as I mentioned before
        • To make DType visible inside C.xsd we must import D.xsd in C.xsd as shown in the valid example above

    Visibility for WSDL document along with sample WSDL document

    1. Importing WSDL/XSD document using <wsdl:import>



      • Types, elements, attributes and groups defined in imported WSDL/XSD document must not be visible inside current WSDL document, but the other parts of the imported WSDL are visible inside current WSDL(read next point for more details)



        • Examples

          listing5.wsdl



          <?xml version="1.0"?>
          <wsdl:definitions targetNamespace="urn:listing5"
          xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
          xmlns:xsd="http://www.w3.org/2001/XMLSchema">
          <wsdl:types>
          <xsd:schema targetNamespace="urn:listing5"
          xmlns:xsd="http://www.w3.org/2001/XMLSchema">
          <xsd:import namespace="http://www.w3.org/2001/XMLSchema"/>
          <xsd:complexType name="Phone">
          <xsd:sequence>
          <xsd:element name="areaCode" type="xsd:int"/>
          <xsd:element name="exchange" type="xsd:int"/>
          <xsd:element name="number" type="xsd:int"/>
          </xsd:sequence>
          </xsd:complexType>
          </xsd:schema>
          </wsdl:types>
          </wsdl:definitions>
          


          listing.wsdl



          <?xml version="1.0"?>
          <wsdl:definitions targetNamespace="urn:listing4"
          xmlns:tns="urn:listing4"
          xmlns:listing5="urn:listing5"
          xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
          xmlns:xsd="http://www.w3.org/2001/XMLSchema"
          xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/">
          <wsdl:import namespace="urn:listing5" location="listing5.wsdl"/>
          <wsdl:types>
          <xsd:schema targetNamespace="urn:listing4"
          xmlns:listing5="urn:listing5"
          xmlns:xsd="http://www.w3.org/2001/XMLSchema">
          <xsd:import namespace="http://www.w3.org/2001/XMLSchema"/>
          <xsd:complexType name="Address">
          <xsd:sequence>
          <xsd:element name="streetNum" type="xsd:int"/>
          <xsd:element name="streetName" type="xsd:string"/>
          <xsd:element name="city" type="xsd:string"/>
          <xsd:element name="state" type="xsd:string"/>
          <xsd:element name="phone" type="listing5:Phone"/><!-- This is imported type form listing5.wsdl which not valid according to Basic Profile -->
          </xsd:sequence>
          </xsd:complexType>
          </xsd:schema>
          </wsdl:types>
          <wsdl:message name="GetAddressRequest">
          <wsdl:part name="name" type="xsd:string"/>
          </wsdl:message>
          <wsdl:message name="GetAddressResponse">
          <wsdl:part name="address" type="listing5:Phone"/><!-- This is imported type form listing5.wsdl which not valid according to Basic Profile -->
          </wsdl:message>
          <wsdl:message name="GetPhoneRequest">
          <wsdl:part name="name" type="xsd:string"/>
          </wsdl:message>
          <wsdl:message name="GetPhoneResponse">
          <wsdl:part name="phone" type="listing5:Phone"/><!-- This is imported type form listing5.wsdl which not valid according to Basic Profile -->
          </wsdl:message>
          <wsdl:portType name="AddressBook">
          <wsdl:operation name="getAddress">
          <wsdl:input message="tns:GetAddressRequest"/>
          <wsdl:output message="tns:GetAddressResponse"/>
          </wsdl:operation>
          <wsdl:operation name="getPhone">
          <wsdl:input message="tns:GetPhoneRequest"/>
          <wsdl:output message="tns:GetPhoneResponse"/>
          </wsdl:operation>
          </wsdl:portType>
          </wsdl:definitions>
          

        • In the above example listing.wsdl is importing listing5.wsdl using wsdl:import and we are using xsd type Phone defined in listing5.wsdl inside listing.wsdl which looks correct when you see this first time. But as per basic profile this is not allowed and listing.wsdl is invalid WSDL document as per basic profile WS-I
        • If we want to import some type in WSDL document then we must declare it inside XSD document and import this using xsd:import I will discuss xsd:import in more details in following points
      • <wsdl:import> must be used only for importing another WSDL description other than wsdl:type section and <wsdl:import> must not be used to import an XSD schema document. We must use <xsd:import> to import XSD schema documents



        • Examples

          Imported.wsdl



          <?xml version="1.0" encoding="UTF-8"?>
          <wsdl:definitions name="Imported"
          targetNamespace="http://www.example.org/Imported/"
          xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
          xmlns:tns="http://www.example.org/Imported/"
          xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
          xmlns:xsd="http://www.w3.org/2001/XMLSchema">
          <wsdl:types>
          <xsd:schema targetNamespace="http://www.example.org/Imported/">
          <xsd:element name="NewOperationResponse" type="xsd:string"/>
          <xsd:element name="NewOperationRequest" type="xsd:string"/>
          </xsd:schema>
          </wsdl:types>
          <wsdl:message name="NewOperationResponse">
          <wsdl:part element="tns:NewOperationResponse" name="NewOperationResponse"/>
          </wsdl:message>
          <wsdl:message name="NewOperationRequest">
          <wsdl:part element="tns:NewOperationRequest" name="NewOperationRequest"/>
          </wsdl:message>
          <wsdl:portType name="Imported">
          <wsdl:operation name="NewOperation">
          <wsdl:input message="tns:NewOperationRequest"/>
          <wsdl:output message="tns:NewOperationResponse"/>
          </wsdl:operation>
          </wsdl:portType>
          <wsdl:binding name="ImportedSOAP" type="tns:Imported">
          <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
          <wsdl:operation name="NewOperation">
          <soap:operation soapAction="http://www.example.org/Imported/NewOperation"/>
          <wsdl:input>
          <soap:body parts="NewOperationRequest" use="literal"/>
          </wsdl:input>
          <wsdl:output>
          <soap:body parts="NewOperationResponse" use="literal"/>
          </wsdl:output>
          </wsdl:operation>
          </wsdl:binding>
          <wsdl:service name="Imported">
          <wsdl:port binding="tns:ImportedSOAP" name="ImportedSOAP">
          <soap:address location="http://www.example.org/"/>
          </wsdl:port>
          </wsdl:service>
          </wsdl:definitions>
          


          Master.wsdl



          <?xml version="1.0" encoding="UTF-8"?>
          <wsdl:definitions targetNamespace="urn:ESBP_TO_WSDL/xsd/examples/Master"
          xmlns:xsd="http://www.w3.org/2001/XMLSchema"
          xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
          xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
          xmlns:tns="urn:ESBP_TO_WSDL/xsd/examples/Master"
          xmlns:imp="http://www.example.org/Imported/">
          <wsdl:import namespace="http://www.example.org/Imported/" location="Imported.wsdl"/>
          <wsdl:types>
          </wsdl:types>
          <wsdl:message name="Request">
          <wsdl:part name="DefaultInput" type="xsd:anyType">
          </wsdl:part>
          </wsdl:message>
          <wsdl:message name="Response">
          <wsdl:part name="DefaultOutput" type="xsd:anyType">
          </wsdl:part>
          </wsdl:message>
          <wsdl:portType name="MasterPortType">
          <wsdl:operation name="Master">
          <wsdl:input message="tns:Request">
          </wsdl:input>
          <wsdl:output message="tns:Response">
          </wsdl:output>
          </wsdl:operation>
          </wsdl:portType>
          <wsdl:binding name="MasterSOAPBinding" type="tns:MasterPortType">
          <soap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/>
          <wsdl:operation name="Master">
          <soap:operation soapAction="urn:ESBP_TO_WSDL/xsd/examples/Master:MasterPortType:MasterRequest"/>
          <wsdl:input>
          <soap:body namespace="urn:ESBP_TO_WSDL/xsd/examples/Master" use="literal"/>
          </wsdl:input>
          <wsdl:output>
          <soap:body namespace="urn:ESBP_TO_WSDL/xsd/examples/Master" use="literal"/>
          </wsdl:output>
          </wsdl:operation>
          </wsdl:binding>
          <wsdl:service name="MasterService">
          <wsdl:port name="MasterPort" binding="tns:MasterSOAPBinding">
          <soap:address location="http://localhost:2580/process/Master"/>
          </wsdl:port>
          </wsdl:service>
          <wsdl:service name="ImportedService">
          <wsdl:port name="ImportedPort" binding="imp:ImportedSOAP"><!-- Referring to imported binding which is correct as per WS-I Basic Profile -->
          <soap:address location="http://localhost:2580/process/Imported"/>
          </wsdl:port>
          </wsdl:service>
          </wsdl:definitions>
          

        • In the above examples we are importing Imported.wsdl into Master.wsdl and we are referring to binding ImportedSOAP defined inside Imported.wsdl into Master.wsdl which is correct use of wsdl:import as per WS-I Basic Profile Specifications
      • Importing XSD using <wsdl:import> is not valid, we must use <xsd:import> for importing XSD file inside WSDL file



        • Example

          Sample.wsdl



          <?xml version="1.0" encoding="UTF-8"?>
          <wsdl:definitions xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tns="urn:ESBP_TO_WSDL/xsd/examples/Master" xmlns:imp="http://www.example.org/Imported/" targetNamespace="urn:ESBP_TO_WSDL/xsd/examples/Master" >
          <wsdl:import namespace="http://www.example.org/Imported/" location="Imported.wsdl"/> <!-- This is valid, importing wsdl document using wsdl:import  -->
          <wsdl:import namespace="http://www.example.org/Imported/" location="Imported.xsd"/> <!-- This is invalid, we must use xsd:import to import xsd file as per basic profile -->
          
          <wsdl:types>
          </wsdl:types>
          <wsdl:message name="Request">
          <wsdl:part name="DefaultInput" type="xsd:anyType"></wsdl:part>
          </wsdl:message>
          <wsdl:message name="Response">
          <wsdl:part name="DefaultOutput" type="xsd:anyType"></wsdl:part>
          </wsdl:message>
          <wsdl:portType name="MasterPortType">
          <wsdl:operation name="Master">
          <wsdl:input message="tns:Request"></wsdl:input>
          <wsdl:output message="tns:Response"></wsdl:output>
          </wsdl:operation>
          </wsdl:portType>
          <wsdl:binding name="MasterSOAPBinding" type='tns:MasterPortType' >
          <soap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/>
          <wsdl:operation name="Master">
          <soap:operation soapAction="urn:ESBP_TO_WSDL/xsd/examples/Master:MasterPortType:MasterRequest"/>
          <wsdl:input>
          <soap:body namespace="urn:ESBP_TO_WSDL/xsd/examples/Master" use="literal"/>
          </wsdl:input>
          <wsdl:output>
          <soap:body namespace="urn:ESBP_TO_WSDL/xsd/examples/Master" use="literal"/>
          </wsdl:output>
          </wsdl:operation>
          </wsdl:binding>
          <wsdl:service name="MasterService">
          <wsdl:port name="MasterPort" binding='tns:MasterSOAPBinding' >
          <soap:address location="http://localhost:2580/process/Master"/>
          </wsdl:port>
          </wsdl:service>
          <wsdl:service name="ImportedService">
          <wsdl:port name="ImportedPort" binding='imp:ImportedSOAP' >
          <soap:address location="http://localhost:2580/process/Imported"/>
          </wsdl:port>
          </wsdl:service>
          </wsdl:definitions>
          
        • In the above Sample.wsdl document we have imported XSD schema documnet Imported.xsd using wsdl:import which is not allowed as per WS-I basic profile and we must use xsd:import to import XSD schema documents which I am going to discuss in the following points
    2. Importing XSD file using <xsd:import> within <xsd:schema> section of <wsdl:types> section of WSDL document



      • Types, elements, attributes and groups defined in imported XSD schema document (using <xsd:import>) should be visible inside same <xsd:schema> section of <wsdl:types> section



        • Examples

          A.xsd



          <?xml version="1.0"?>
          <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
          targetNamespace="http://example.org/mynamespace"
          xmlns="http://example.org/mynamespace">
          <xsd:element name="AElement" type="AType"/>
          <xsd:complexType name="AType">
          <xsd:sequence>
          <xsd:element name="elStr" type="xsd:string"/>
          <xsd:element name="elInt" type="xsd:int"/>
          </xsd:sequence>
          </xsd:complexType>
          </xsd:schema>
          


          A.wsdl



          <?xml version="1.0" encoding="UTF-8"?>
          <wsdl:definitions xmlns:xsd="http://www.w3.org/2001/XMLSchema"
          xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
          xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
          xmlns:tns="urn:ESBP_TO_WSDL/xsd/SampleWSDLS/sample_wsdl_import_xsd"
          targetNamespace="urn:ESBP_TO_WSDL/xsd/SampleWSDLS/sample_wsdl_import_xsd"
          xmlns:test="urn:ESBP_TO_WSDL/esbp/test"
          xmlns:A="http://example.org/mynamespace"> <!-- Namespaces are declared here for imported XSD as well as for schema section namespace -->
          <wsdl:types>
          <xsd:schema elementFormDefault="qualified"
          targetNamespace="urn:ESBP_TO_WSDL/esbp/test"
          xmlns:xsd="http://www.w3.org/2001/XMLSchema"
          xmlns:test="urn:ESBP_TO_WSDL/esbp/test">
          <xsd:import namespace="http://example.org/mynamespace" schemaLocation="A.xsd"></xsd:import> <!-- Correct method of importing XSD schema socument in WSDL as per WS-I Basic Profile Specifications -->  
          <xsd:element name="ElementOfTypeA" type="A:AType"></xsd:element> <!-- Imported Type from A.xsd -->
          <xsd:complexType name="MyComplexType">
          <xsd:sequence>
          <xsd:element name="streetNum" type="xsd:int"/>
          <xsd:element name="streetName" type="xsd:string"/>
          <xsd:element name="city" type="xsd:string"/>
          <xsd:element name="state" type="xsd:string"/>
          <xsd:element name="ElFromA" ref="A:AElement"/>  <!-- Imported element from A.xsd -->
          </xsd:sequence>
          </xsd:complexType>
          </xsd:schema>
          </wsdl:types>
          <wsdl:message name="Request">
          <wsdl:part name="DefaultInput" type="A:AType"></wsdl:part><!-- Imported Type from A.xsd -->
          <wsdl:part name="DefaultInput2" element="A:AElement"></wsdl:part>  <!-- Imported element from A.xsd -->
          </wsdl:message>
          <wsdl:message name="Response">
          <wsdl:part name="DefaultOutput"
          type="test:MyComplexType"></wsdl:part> <!-- Type from schema section -->
          <wsdl:part name="DefaultOutput2"
          element="test:ElementOfTypeA"></wsdl:part><!-- Element from schema section -->
          </wsdl:message>
          <wsdl:portType name="sample_wsdl_import_xsdPortType">
          <wsdl:operation name="sample_wsdl_import_xsd">
          <wsdl:input message="tns:Request"></wsdl:input>
          <wsdl:output message="tns:Response"></wsdl:output>
          </wsdl:operation>
          </wsdl:portType>
          <wsdl:binding name="sample_wsdl_import_xsdSOAPBinding" type='tns:sample_wsdl_import_xsdPortType' >
          <soap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/>
          <wsdl:operation name="sample_wsdl_import_xsd">
          <soap:operation soapAction="urn:ESBP_TO_WSDL/xsd/SampleWSDLS/sample_wsdl_import_xsd:sample_wsdl_import_xsdPortType:sample_wsdl_import_xsdRequest"/>
          <wsdl:input>
          <soap:body namespace="urn:ESBP_TO_WSDL/xsd/SampleWSDLS/sample_wsdl_import_xsd" use="literal"/>
          </wsdl:input>
          <wsdl:output>
          <soap:body namespace="urn:ESBP_TO_WSDL/xsd/SampleWSDLS/sample_wsdl_import_xsd" use="literal"/>
          </wsdl:output>
          </wsdl:operation>
          </wsdl:binding>
          <wsdl:service name="sample_wsdl_import_xsdService">
          <wsdl:port name="sample_wsdl_import_xsdPort" binding='tns:sample_wsdl_import_xsdSOAPBinding' >
          <soap:address location="http://localhost:2580/process/sample_wsdl_import_xsd"/>
          </wsdl:port>
          </wsdl:service>
          </wsdl:definitions>
          
        • In the above examples A.wsdl is importing A.xsd using xsd:import withing xsd:schema section of wsdl:types section of WSDL document which is correct way of importing XSD schema document inside WSDL document as per WS-I Basic Profile Specifications
      • Types, elements, attributes and groups defined in imported XSD file should not be visible inside another <xsd:schema> section of <wsdl:types> unless it is explicitly imported in that <xsd:schema> schema section using <xsd:import>



        • Examples

          A.xsd



          <?xml version="1.0"?>
          <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
          targetNamespace="http://example.org/mynamespace"
          xmlns="http://example.org/mynamespace">
          <xsd:element name="AElement" type="AType"/>
          <xsd:complexType name="AType">
          <xsd:sequence>
          <xsd:element name="elStr" type="xsd:string"/>
          <xsd:element name="elInt" type="xsd:int"/>
          </xsd:sequence>
          </xsd:complexType>
          </xsd:schema>
          


          A.wsdl



          <?xml version="1.0" encoding="UTF-8"?>
          <wsdl:definitions targetNamespace="urn:ESBP_TO_WSDL/xsd/SampleWSDLS/sample_wsdl_import_xsd"
          xmlns:xsd="http://www.w3.org/2001/XMLSchema"
          xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
          xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
          xmlns:tns="urn:ESBP_TO_WSDL/xsd/SampleWSDLS/sample_wsdl_import_xsd"
          xmlns:test="urn:ESBP_TO_WSDL/esbp/test"
          xmlns:A="http://example.org/mynamespace">
          <wsdl:types>
          <xsd:schema elementFormDefault="qualified"
          targetNamespace="urn:ESBP_TO_WSDL/esbp/test"
          xmlns:xsd="http://www.w3.org/2001/XMLSchema"
          xmlns:test="urn:ESBP_TO_WSDL/esbp/test">
          <xsd:import namespace="http://example.org/mynamespace" schemaLocation="A.xsd">
          </xsd:import>
          <xsd:element name="ElementOfTypeA" type="AType">
          </xsd:element>
          <xsd:complexType name="MyComplexType">
          <xsd:sequence>
          <xsd:element name="streetNum" type="xsd:int"/>
          <xsd:element name="streetName" type="xsd:string"/>
          <xsd:element name="city" type="xsd:string"/>
          <xsd:element name="state" type="xsd:string"/>
          <xsd:element name="ElFromA" ref="A:AElement"/>
          </xsd:sequence>
          </xsd:complexType>
          </xsd:schema>
          <xsd:schema elementFormDefault="qualified"
          targetNamespace="urn:ESBP_TO_WSDL/esbp/test"
          xmlns:xsd="http://www.w3.org/2001/XMLSchema"
          xmlns:test2="urn:ESBP_TO_WSDL/esbp/test2">
          <xsd:import namespace="http://example.org/mynamespace"/>
          <xsd:element name="ElOfTypeA" type="A:AType"/> <!-- This is valid since the namespace is imported here -->
          <xsd:complexType name="AnotherComplexType">
          <xsd:sequence>
          <xsd:element name="streetNum" type="xsd:int"/>
          <xsd:element name="streetName" type="xsd:string"/>
          <xsd:element name="city" type="xsd:string"/>
          <xsd:element name="state" type="test:MyComplexType"/> <!-- This is invalid since the namespace is not imported here -->
          </xsd:sequence>
          </xsd:complexType>
          </xsd:schema>
          </wsdl:types>
          <wsdl:message name="Request">
          <wsdl:part name="DefaultInput" type="A:AType">
          </wsdl:part>
          <wsdl:part name="DefaultInput2" element="A:AElement">
          </wsdl:part>
          </wsdl:message>
          <wsdl:message name="Response">
          <wsdl:part name="DefaultOutput" type="test:MyComplexType">
          </wsdl:part>
          <wsdl:part name="DefaultOutput2" element="test:ElementOfTypeA">
          </wsdl:part>
          </wsdl:message>
          <wsdl:portType name="sample_wsdl_import_xsdPortType">
          <wsdl:operation name="sample_wsdl_import_xsd">
          <wsdl:input message="tns:Request">
          </wsdl:input>
          <wsdl:output message="tns:Response">
          </wsdl:output>
          </wsdl:operation>
          </wsdl:portType>
          <wsdl:binding name="sample_wsdl_import_xsdSOAPBinding" type="tns:sample_wsdl_import_xsdPortType">
          <soap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/>
          <wsdl:operation name="sample_wsdl_import_xsd">
          <soap:operation soapAction="urn:ESBP_TO_WSDL/xsd/SampleWSDLS/sample_wsdl_import_xsd:sample_wsdl_import_xsdPortType:sample_wsdl_import_xsdRequest"/>
          <wsdl:input>
          <soap:body namespace="urn:ESBP_TO_WSDL/xsd/SampleWSDLS/sample_wsdl_import_xsd" use="literal"/>
          </wsdl:input>
          <wsdl:output>
          <soap:body namespace="urn:ESBP_TO_WSDL/xsd/SampleWSDLS/sample_wsdl_import_xsd" use="literal"/>
          </wsdl:output>
          </wsdl:operation>
          </wsdl:binding>
          <wsdl:service name="sample_wsdl_import_xsdService">
          <wsdl:port name="sample_wsdl_import_xsdPort" binding="tns:sample_wsdl_import_xsdSOAPBinding">
          <soap:address location="http://localhost:2580/process/sample_wsdl_import_xsd"/>
          </wsdl:port>
          </wsdl:service>
          </wsdl:definitions>
          
      • Types, elements, attributes and groups defined in imported XSD file should be visible in <wsdl:part> section of <wsdl:message> if the namespace of imported XSD file is declared as attribute of <wsdl:definitions>




        • Example

          A.xsd



          <?xml version="1.0"?>
          
          <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
          
          targetNamespace="http://example.org/mynamespace"
          
          xmlns="http://example.org/mynamespace">
          
          <xsd:element name="AElement" type="AType"/>
          
          <xsd:complexType name="AType">
          
          <xsd:sequence>
          
          <xsd:element name="elStr" type="xsd:string"/>
          
          <xsd:element name="elInt" type="xsd:int"/>
          
          </xsd:sequence>
          
          </xsd:complexType>
          
          </xsd:schema>
          


          A.wsdl



          <?xml version="1.0" encoding="UTF-8"?>
          
          <wsdl:definitions xmlns:xsd="http://www.w3.org/2001/XMLSchema"
          
          xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
          
          xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
          
          xmlns:tns="urn:ESBP_TO_WSDL/xsd/SampleWSDLS/sample_wsdl_import_xsd"
          
          targetNamespace="urn:ESBP_TO_WSDL/xsd/SampleWSDLS/sample_wsdl_import_xsd"
          
          xmlns:test="urn:ESBP_TO_WSDL/esbp/test">
          
          <wsdl:types>
          
          <xsd:schema elementFormDefault="qualified"
          
          targetNamespace="urn:ESBP_TO_WSDL/esbp/test"
          
          xmlns:xsd="http://www.w3.org/2001/XMLSchema"
          
          xmlns:test="urn:ESBP_TO_WSDL/esbp/test">
          
          <xsd:import namespace="http://example.org/mynamespace" schemaLocation="A.xsd"></xsd:import>
          
          <xsd:element name="ElementOfTypeA" type="AType"></xsd:element>
          
          <xsd:complexType name="MyComplexType">
          
          <xsd:sequence>
          
          <xsd:element name="streetNum" type="xsd:int"/>
          
          <xsd:element name="streetName" type="xsd:string"/>
          
          <xsd:element name="city" type="xsd:string"/>
          
          <xsd:element name="state" type="xsd:string"/>
          
          <xsd:element name="ElFromA" ref="A:AElement"/>
          
          </xsd:sequence>
          
          </xsd:complexType>
          
          </xsd:schema>
          
          <xsd:schema elementFormDefault="qualified"
          
          targetNamespace="urn:ESBP_TO_WSDL/esbp/test"
          
          xmlns:xsd="http://www.w3.org/2001/XMLSchema"
          
          xmlns:test2="urn:ESBP_TO_WSDL/esbp/test2"
          
          xmlns:test="urn:ESBP_TO_WSDL/esbp/test">
          
          <xsd:import namespace="http://example.org/mynamespace" schemaLocation="A.xsd"></xsd:import>
          
          <xsd:import namespace="urn:ESBP_TO_WSDL/esbp/test"/>
          
          <xsd:element name="ElOfTypeA" type="A:AType"></xsd:element>
          
          <xsd:complexType name="AnotherComplexType">
          
          <xsd:sequence>
          
          <xsd:element name="streetNum" type="xsd:int"/>
          
          <xsd:element name="streetName" type="xsd:string"/>
          
          <xsd:element name="city" type="xsd:string"/>
          
          <xsd:element name="state" type="test:MyComplexType"/>
          
          </xsd:sequence>
          
          </xsd:complexType>
          
          </xsd:schema>
          
          </wsdl:types>
          
          <wsdl:message name="Request">
          
          <wsdl:part name="DefaultInput" type="A:AType"></wsdl:part> <!-- This is not valid since namespace is not declared as attribute of wsdl:definitions -->
          
          <wsdl:part name="DefaultInput2" element="A:AElement"></wsdl:part><!-- This is not valid since namespace is not declared as attribute of wsdl:definitions -->
          
          
          
          </wsdl:message>
          
          <wsdl:message name="Response">
          
          <wsdl:part name="DefaultOutput"
          
          type="test:MyComplexType"></wsdl:part>
          
          <wsdl:part name="DefaultOutput2"
          
          element="test:ElementOfTypeA"></wsdl:part>
          
          <wsdl:part name="DefaultOutput3"
          
          type="test2:AnotherComplexType"></wsdl:part><!-- This is not valid since namespace is not declared as attribute of wsdl:definitions -->
          
          
          
          </wsdl:message>
          
          <wsdl:portType name="sample_wsdl_import_xsdPortType">
          
          <wsdl:operation name="sample_wsdl_import_xsd">
          
          <wsdl:input message="tns:Request"></wsdl:input>
          
          <wsdl:output message="tns:Response"></wsdl:output>
          
          </wsdl:operation>
          
          </wsdl:portType>
          
          <wsdl:binding name="sample_wsdl_import_xsdSOAPBinding" type='tns:sample_wsdl_import_xsdPortType' >
          
          <soap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/>
          
          <wsdl:operation name="sample_wsdl_import_xsd">
          
          <soap:operation soapAction="urn:ESBP_TO_WSDL/xsd/SampleWSDLS/sample_wsdl_import_xsd:sample_wsdl_import_xsdPortType:sample_wsdl_import_xsdRequest"/>
          
          <wsdl:input>
          
          <soap:body namespace="urn:ESBP_TO_WSDL/xsd/SampleWSDLS/sample_wsdl_import_xsd" use="literal"/>
          
          </wsdl:input>
          
          <wsdl:output>
          
          <soap:body namespace="urn:ESBP_TO_WSDL/xsd/SampleWSDLS/sample_wsdl_import_xsd" use="literal"/>
          
          </wsdl:output>
          
          </wsdl:operation>
          
          </wsdl:binding>
          
          <wsdl:service name="sample_wsdl_import_xsdService">
          
          <wsdl:port name="sample_wsdl_import_xsdPort" binding='tns:sample_wsdl_import_xsdSOAPBinding' >
          
          <soap:address location="http://localhost:2580/process/sample_wsdl_import_xsd"/>
          
          </wsdl:port>
          
          </wsdl:service>
          
          </wsdl:definitions>
          

        • Above A.wsdl is not valid according to basic profile, to make above example correct as per basic profile please check the following example

          ValidA.wsdl



          <?xml version="1.0" encoding="UTF-8"?>
          
          <wsdl:definitions xmlns:xsd="http://www.w3.org/2001/XMLSchema"
          
          xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
          
          xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
          
          xmlns:tns="urn:ESBP_TO_WSDL/xsd/SampleWSDLS/sample_wsdl_import_xsd"
          
          targetNamespace="urn:ESBP_TO_WSDL/xsd/SampleWSDLS/sample_wsdl_import_xsd"
          
          xmlns:test="urn:ESBP_TO_WSDL/esbp/test"
          
          xmlns:test2="urn:ESBP_TO_WSDL/esbp/test2"
          
          xmlns:A="http://example.org/mynamespace">
          
          <wsdl:types>
          
          <xsd:schema elementFormDefault="qualified"
          
          targetNamespace="urn:ESBP_TO_WSDL/esbp/test"
          
          xmlns:xsd="http://www.w3.org/2001/XMLSchema"
          
          xmlns:test="urn:ESBP_TO_WSDL/esbp/test">
          
          <xsd:import namespace="http://example.org/mynamespace" schemaLocation="A.xsd"></xsd:import>
          
          <xsd:element name="ElementOfTypeA" type="AType"></xsd:element>
          
          <xsd:complexType name="MyComplexType">
          
          <xsd:sequence>
          
          <xsd:element name="streetNum" type="xsd:int"/>
          
          <xsd:element name="streetName" type="xsd:string"/>
          
          <xsd:element name="city" type="xsd:string"/>
          
          <xsd:element name="state" type="xsd:string"/>
          
          <xsd:element name="ElFromA" ref="A:AElement"/>
          
          </xsd:sequence>
          
          </xsd:complexType>
          
          </xsd:schema>
          
          <xsd:schema elementFormDefault="qualified"
          
          targetNamespace="urn:ESBP_TO_WSDL/esbp/test"
          
          xmlns:xsd="http://www.w3.org/2001/XMLSchema"
          
          xmlns:test2="urn:ESBP_TO_WSDL/esbp/test2"
          
          xmlns:test="urn:ESBP_TO_WSDL/esbp/test">
          
          <xsd:import namespace="http://example.org/mynamespace" schemaLocation="A.xsd"></xsd:import>
          
          <xsd:import namespace="urn:ESBP_TO_WSDL/esbp/test"/>
          
          <xsd:element name="ElOfTypeA" type="A:AType"></xsd:element>
          
          <xsd:complexType name="AnotherComplexType">
          
          <xsd:sequence>
          
          <xsd:element name="streetNum" type="xsd:int"/>
          
          <xsd:element name="streetName" type="xsd:string"/>
          
          <xsd:element name="city" type="xsd:string"/>
          
          <xsd:element name="state" type="test:MyComplexType"/>
          
          </xsd:sequence>
          
          </xsd:complexType>
          
          </xsd:schema>
          
          </wsdl:types>
          
          <wsdl:message name="Request">
          
          <wsdl:part name="DefaultInput" type="A:AType"></wsdl:part><!-- This is valid since namespace is declared as attribute of wsdl:definitions -->
          
          <wsdl:part name="DefaultInput2" element="A:AElement"></wsdl:part><!-- This is valid since namespace is declared as attribute of wsdl:definitions -->
          
          </wsdl:message>
          
          <wsdl:message name="Response">
          
          <wsdl:part name="DefaultOutput"
          
          type="test:MyComplexType"></wsdl:part>
          
          <wsdl:part name="DefaultOutput2"
          
          element="test:ElementOfTypeA"></wsdl:part>
          
          <wsdl:part name="DefaultOutput3"
          
          type="test2:AnotherComplexType"></wsdl:part><!-- This is valid since namespace is declared as attribute of wsdl:definitions -->
          
          </wsdl:message>
          
          <wsdl:portType name="sample_wsdl_import_xsdPortType">
          
          <wsdl:operation name="sample_wsdl_import_xsd">
          
          <wsdl:input message="tns:Request"></wsdl:input>
          
          <wsdl:output message="tns:Response"></wsdl:output>
          
          </wsdl:operation>
          
          </wsdl:portType>
          
          <wsdl:binding name="sample_wsdl_import_xsdSOAPBinding" type='tns:sample_wsdl_import_xsdPortType' >
          
          <soap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/>
          
          <wsdl:operation name="sample_wsdl_import_xsd">
          
          <soap:operation soapAction="urn:ESBP_TO_WSDL/xsd/SampleWSDLS/sample_wsdl_import_xsd:sample_wsdl_import_xsdPortType:sample_wsdl_import_xsdRequest"/>
          
          <wsdl:input>
          
          <soap:body namespace="urn:ESBP_TO_WSDL/xsd/SampleWSDLS/sample_wsdl_import_xsd" use="literal"/>
          
          </wsdl:input>
          
          <wsdl:output>
          
          <soap:body namespace="urn:ESBP_TO_WSDL/xsd/SampleWSDLS/sample_wsdl_import_xsd" use="literal"/>
          
          </wsdl:output>
          
          </wsdl:operation>
          
          </wsdl:binding>
          
          <wsdl:service name="sample_wsdl_import_xsdService">
          
          <wsdl:port name="sample_wsdl_import_xsdPort" binding='tns:sample_wsdl_import_xsdSOAPBinding' >
          
          <soap:address location="http://localhost:2580/process/sample_wsdl_import_xsd"/>
          
          </wsdl:port>
          
          </wsdl:service>
          
          </wsdl:definitions>
          
      • Types, elements, attributes and groups defined in nested imported XSD file should not be visible inside same <schema> section of <wsdl:types> as well as inside <wsdl:part> section of <wsdl:message>



        • Example
        • A.xsd
          <?xml version="1.0"?>
          <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
          targetNamespace="http://example.org/mynamespace"
          xmlns="http://example.org/mynamespaceA">
          <xsd:element name="AElement" type="AType"/>
          <xsd:complexType name="AType">
          <xsd:sequence>
          <xsd:element name="elStr" type="xsd:string"/>
          <xsd:element name="elInt" type="xsd:int"/>
          </xsd:sequence>
          </xsd:complexType>
          </xsd:schema>
          
          B.xsd
          <?xml version="1.0"?>
          <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
          targetNamespace="http://example.org/mynamespace"
          xmlns="http://example.org/mynamespaceB"
          xmlns:A=”http://example.org/mynamespaceA”>
          <xsd:import namespace=”http://example.org/mynamespaceA”
          schemaLocation="A.xsd"/>
          <xsd:element name="BAElement" type="BType"/>
          <xsd:element name="AElementInsideB" type="AType"/>
          <xsd:complexType name="BType">
          <xsd:sequence>
          <xsd:element name="elStr" type="xsd:string"/>
          <xsd:element name="elInt" type="xsd:int"/>
          </xsd:sequence>
          </xsd:complexType>
          </xsd:schema>
          
          NestedInvalid.wsdl
          <?xml version="1.0" encoding="UTF-8"?>
          <wsdl:definitions xmlns:xsd="http://www.w3.org/2001/XMLSchema"
          xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
          xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
          xmlns:tns="urn:ESBP_TO_WSDL/xsd/SampleWSDLS/sample_wsdl_import_xsd"
          targetNamespace="urn:ESBP_TO_WSDL/xsd/SampleWSDLS/sample_wsdl_import_xsd"
          xmlns:test="urn:ESBP_TO_WSDL/esbp/test"
          xmlns:B="http://example.org/mynamespaceB">
          <wsdl:types>
          <xsd:schema elementFormDefault="qualified"
          targetNamespace="urn:ESBP_TO_WSDL/esbp/test"
          xmlns:xsd="http://www.w3.org/2001/XMLSchema"
          xmlns:test="urn:ESBP_TO_WSDL/esbp/test">
          <xsd:import namespace="http://example.org/mynamespaceB" schemaLocation="B.xsd"></xsd:import>
          <xsd:element name="ElementOfTypeA" type="AType"></xsd:element>
          <xsd:complexType name="MyComplexType">
          <xsd:sequence>
          <xsd:element name="streetNum" type="xsd:int"/>
          <xsd:element name="streetName" type="xsd:string"/>
          <xsd:element name="city" type="xsd:string"/>
          <xsd:element name="state" type="xsd:string"/>
          <xsd:element name="ElFromA" ref="AElement"/>
          </xsd:sequence>
          </xsd:complexType>
          </xsd:schema>
          </wsdl:types>
          <wsdl:message name="Request">
          <wsdl:part name="DefaultInput"
          type="A:AType"></wsdl:part><!-- This is invalid use of type since this is from A.xsd the nested imported file-->
          
          <wsdl:part name="DefaultInput2"
          element="A:AElement"></wsdl:part><!-- This is invalid use of element since this is from A.xsd the nested imported file-->
          
          </wsdl:message>
          <wsdl:message name="Response">
          <wsdl:part name="DefaultOutput"
          type="test:MyComplexType"></wsdl:part>
          <wsdl:part name="DefaultOutput2"
          element="test:ElementOfTypeA"></wsdl:part> <!-- This is invalid use of element since this is from A.xsd the nested imported file-->
          </wsdl:message>
          <wsdl:portType name="sample_wsdl_import_xsdPortType">
          <wsdl:operation name="sample_wsdl_import_xsd">
          <wsdl:input message="tns:Request"></wsdl:input>
          <wsdl:output message="tns:Response"></wsdl:output>
          </wsdl:operation>
          </wsdl:portType>
          <wsdl:binding name="sample_wsdl_import_xsdSOAPBinding" type='tns:sample_wsdl_import_xsdPortType' >
          <soap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/>
          <wsdl:operation name="sample_wsdl_import_xsd">
          <soap:operation soapAction="urn:ESBP_TO_WSDL/xsd/SampleWSDLS/sample_wsdl_import_xsd:sample_wsdl_import_xsdPortType:sample_wsdl_import_xsdRequest"/>
          <wsdl:input>
          <soap:body namespace="urn:ESBP_TO_WSDL/xsd/SampleWSDLS/sample_wsdl_import_xsd" use="literal"/>
          </wsdl:input>
          <wsdl:output>
          <soap:body namespace="urn:ESBP_TO_WSDL/xsd/SampleWSDLS/sample_wsdl_import_xsd" use="literal"/>
          </wsdl:output>
          </wsdl:operation>
          </wsdl:binding>
          <wsdl:service name="sample_wsdl_import_xsdService">
          <wsdl:port name="sample_wsdl_import_xsdPort" binding='tns:sample_wsdl_import_xsdSOAPBinding' >
          <soap:address location="http://localhost:2580/process/sample_wsdl_import_xsd"/>
          </wsdl:port>
          </wsdl:service>
          </wsdl:definitions>
          
    3. Including XSD document using <xsd:include> within <xsd:schema> section of <wsdl:types>



      • Types, elements, attributes and groups defined in included XSD document should be visible inside same <xsd:schema> section of <wsdl:types>



        • Example

          A.xsd



          <?xml version="1.0"?>
          <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
          targetNamespace="http://example.org/mynamespace"
          xmlns="http://example.org/mynamespace">
          <xsd:element name="AElement" type="AType"/>
          <xsd:complexType name="AType">
          <xsd:sequence>
          <xsd:element name="elStr" type="xsd:string"/>
          <xsd:element name="elInt" type="xsd:int"/>
          </xsd:sequence>
          </xsd:complexType>
          </xsd:schema><?xml version="1.0"?>
          <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
          targetNamespace="http://example.org/mynamespace"
          xmlns="http://example.org/mynamespace">
          <xsd:element name="AElement" type="AType"/>
          <xsd:complexType name="AType">
          <xsd:sequence>
          <xsd:element name="elStr" type="xsd:string"/>
          <xsd:element name="elInt" type="xsd:int"/>
          </xsd:sequence>
          </xsd:complexType>
          </xsd:schema>
          


          B.xsd



          <?xml version="1.0"?>
          <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
          targetNamespace="http://example.org/mynamespace"
          xmlns="http://example.org/mynamespace">
          <xsd:include schemaLocation="A.xsd"/>
          <xsd:element name="BAElement" type="BType"/>
          <xsd:element name="AElementInsideB" type="AType"/>
          <xsd:complexType name="BType">
          <xsd:sequence>
          <xsd:element name="elStr" type="xsd:string"/>
          <xsd:element name="elInt" type="xsd:int"/>
          </xsd:sequence>
          </xsd:complexType>
          </xsd:schema>
          


          Sample.wsdl



          <?xml version="1.0" encoding="UTF-8"?>
          <wsdl:definitions xmlns:xsd="http://www.w3.org/2001/XMLSchema"
          xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
          xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
          xmlns:tns="urn:ESBP_TO_WSDL/xsd/SampleWSDLS/sample_wsdl_import_xsd"
          targetNamespace="urn:ESBP_TO_WSDL/xsd/SampleWSDLS/sample_wsdl_import_xsd"
          xmlns:test="urn:ESBP_TO_WSDL/esbp/test"
          xmlns:B="http://example.org/mynamespace">
          <wsdl:types>
          <xsd:schema elementFormDefault="qualified"
          targetNamespace="http://example.org/mynamespace"
          xmlns:xsd="http://www.w3.org/2001/XMLSchema"
          xmlns:B="http://example.org/mynamespace">
          <xsd:include schemaLocation="B.xsd"></xsd:import>
          <xsd:element name="ElementOfTypeA" type="B:AType"></xsd:element><!-- This is nested element type from A.xsd -->
          <xsd:complexType name="MyComplexType">
          <xsd:sequence>
          <xsd:element name="streetNum" type="xsd:int"/>
          <xsd:element name="streetName" type="xsd:string"/>
          <xsd:element name="city" type="xsd:string"/>
          <xsd:element name="state" type="xsd:string"/>
          <xsd:element name="ElFromA" ref="B:BElement"/> <!-- This is included element from B.xsd -->
          </xsd:sequence>
          </xsd:complexType>
          </xsd:schema>
          </wsdl:types>
          <wsdl:message name="Request">
          <wsdl:part name="DefaultInput" type="B:BType"></wsdl:part><!-- This is included type from B.xsd -->
          <wsdl:part name="DefaultInput2" element="B:AElement"></wsdl:part><!-- This is nested included element from A.xsd -->
          </wsdl:message>
          <wsdl:message name="Response">
          <wsdl:part name="DefaultOutput"
          type="B:MyComplexType"></wsdl:part>
          <wsdl:part name="DefaultOutput2"
          element="B:ElementOfTypeA"></wsdl:part>
          </wsdl:message>
          <wsdl:portType name="sample_wsdl_import_xsdPortType">
          <wsdl:operation name="sample_wsdl_import_xsd">
          <wsdl:input message="tns:Request"></wsdl:input>
          <wsdl:output message="tns:Response"></wsdl:output>
          </wsdl:operation>
          </wsdl:portType>
          <wsdl:binding name="sample_wsdl_import_xsdSOAPBinding" type='tns:sample_wsdl_import_xsdPortType' >
          <soap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/>
          <wsdl:operation name="sample_wsdl_import_xsd">
          <soap:operation soapAction="urn:ESBP_TO_WSDL/xsd/SampleWSDLS/sample_wsdl_import_xsd:sample_wsdl_import_xsdPortType:sample_wsdl_import_xsdRequest"/>
          <wsdl:input>
          <soap:body namespace="urn:ESBP_TO_WSDL/xsd/SampleWSDLS/sample_wsdl_import_xsd" use="literal"/>
          </wsdl:input>
          <wsdl:output>
          <soap:body namespace="urn:ESBP_TO_WSDL/xsd/SampleWSDLS/sample_wsdl_import_xsd" use="literal"/>
          </wsdl:output>
          </wsdl:operation>
          </wsdl:binding>
          <wsdl:service name="sample_wsdl_import_xsdService">
          <wsdl:port name="sample_wsdl_import_xsdPort" binding='tns:sample_wsdl_import_xsdSOAPBinding' >
          <soap:address location="http://localhost:2580/process/sample_wsdl_import_xsd"/>
          </wsdl:port>
          </wsdl:service>
          </wsdl:definitions>
          

      • Types, elements, attributes and groups defined in included XSD document should not be visible inside another <xsd:schema> section of <wsdl:types> unless it is explicitly imported in that <xsd:schema> schema section



        • Example

          A.xsd



          <?xml version="1.0"?>
          <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
          targetNamespace="http://example.org/mynamespace"
          xmlns="http://example.org/mynamespace">
          <xsd:element name="AElement" type="AType"/>
          <xsd:complexType name="AType">
          <xsd:sequence>
          <xsd:element name="elStr" type="xsd:string"/>
          <xsd:element name="elInt" type="xsd:int"/>
          </xsd:sequence>
          </xsd:complexType>
          </xsd:schema><?xml version="1.0"?>
          <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
          targetNamespace="http://example.org/mynamespace"
          xmlns="http://example.org/mynamespace">
          <xsd:element name="AElement" type="AType"/>
          <xsd:complexType name="AType">
          <xsd:sequence>
          <xsd:element name="elStr" type="xsd:string"/>
          <xsd:element name="elInt" type="xsd:int"/>
          </xsd:sequence>
          </xsd:complexType>
          </xsd:schema>


          B.xsd



          <?xml version="1.0"?>
          <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
          targetNamespace="http://example.org/mynamespace"
          xmlns="http://example.org/mynamespace">
          <xsd:include schemaLocation="A.xsd"/>
          <xsd:element name="BAElement" type="BType"/>
          <xsd:element name="AElementInsideB" type="AType"/>
          <xsd:complexType name="BType">
          <xsd:sequence>
          <xsd:element name="elStr" type="xsd:string"/>
          <xsd:element name="elInt" type="xsd:int"/>
          </xsd:sequence>
          </xsd:complexType>
          </xsd:schema>
          


          Sample.wsdl



          <?xml version="1.0" encoding="UTF-8"?>
          <wsdl:definitions xmlns:xsd="http://www.w3.org/2001/XMLSchema"
          xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
          xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
          xmlns:tns="urn:ESBP_TO_WSDL/xsd/SampleWSDLS/sample_wsdl_import_xsd"
          targetNamespace="urn:ESBP_TO_WSDL/xsd/SampleWSDLS/sample_wsdl_import_xsd"
          xmlns:test="urn:ESBP_TO_WSDL/esbp/test"
          xmlns:B="http://example.org/mynamespace">
          <wsdl:types>
          <xsd:schema elementFormDefault="qualified"
          targetNamespace=" http://example.org/mynamespace "
          xmlns:xsd="http://www.w3.org/2001/XMLSchema"
          xmlns:B=" http://example.org/mynamespace ">
          <xsd:import namespace="http://example.org/mynamespace" schemaLocation="B.xsd"></xsd:import>
          <xsd:element name="ElementOfTypeA" type="B:AType"></xsd:element><!-- This is nested type from A.xsd -->
          <xsd:complexType name="MyComplexType">
          <xsd:sequence>
          <xsd:element name="streetNum" type="xsd:int"/>
          <xsd:element name="streetName" type="xsd:string"/>
          <xsd:element name="city" type="xsd:string"/>
          <xsd:element name="state" type="xsd:string"/>
          <xsd:element name="ElFromA" ref="B:BElement"/> <!-- This is included element from B.xsd -->
          </xsd:sequence>
          </xsd:complexType>
          </xsd:schema>
          <xsd:schema elementFormDefault="qualified"
          targetNamespace="urn:ESBP_TO_WSDL/esbp/test"
          xmlns:xsd="http://www.w3.org/2001/XMLSchema"
          xmlns:test="urn:ESBP_TO_WSDL/esbp/test">
          <xsd:element name="ElementOfTypeA" type="B:AType"></xsd:element><!-- This is nested element type from A.xsd but it should not be visible in this schema section -->
          <xsd:complexType name="MyComplexType">
          <xsd:sequence>
          <xsd:element name="streetNum" type="xsd:int"/>
          <xsd:element name="streetName" type="xsd:string"/>
          <xsd:element name="city" type="xsd:string"/>
          <xsd:element name="state" type="xsd:string"/>
          <xsd:element name="ElFromA" ref="B:BElement"/> <!-- This is included element from B.xsd but this should not be visible here -->
          </xsd:sequence>
          </xsd:complexType>
          </xsd:schema>
          </wsdl:types>
          <wsdl:message name="Request">
          <wsdl:part name="DefaultInput" type="B:BType"></wsdl:part><!-- This is included type from B.xsd -->
          <wsdl:part name="DefaultInput2" element="B:AElement"></wsdl:part><!-- This is nested included element from A.xsd -->
          </wsdl:message>
          <wsdl:message name="Response">
          <wsdl:part name="DefaultOutput"
          type="test:MyComplexType"></wsdl:part>
          <wsdl:part name="DefaultOutput2"
          element="test:ElementOfTypeA"></wsdl:part>
          </wsdl:message>
          <wsdl:portType name="sample_wsdl_import_xsdPortType">
          <wsdl:operation name="sample_wsdl_import_xsd">
          <wsdl:input message="tns:Request"></wsdl:input>
          <wsdl:output message="tns:Response"></wsdl:output>
          </wsdl:operation>
          </wsdl:portType>
          <wsdl:binding name="sample_wsdl_import_xsdSOAPBinding" type='tns:sample_wsdl_import_xsdPortType' >
          <soap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/>
          <wsdl:operation name="sample_wsdl_import_xsd">
          <soap:operation soapAction="urn:ESBP_TO_WSDL/xsd/SampleWSDLS/sample_wsdl_import_xsd:sample_wsdl_import_xsdPortType:sample_wsdl_import_xsdRequest"/>
          <wsdl:input>
          <soap:body namespace="urn:ESBP_TO_WSDL/xsd/SampleWSDLS/sample_wsdl_import_xsd" use="literal"/>
          </wsdl:input>
          <wsdl:output>
          <soap:body namespace="urn:ESBP_TO_WSDL/xsd/SampleWSDLS/sample_wsdl_import_xsd" use="literal"/>
          </wsdl:output>
          </wsdl:operation>
          </wsdl:binding>
          <wsdl:service name="sample_wsdl_import_xsdService">
          <wsdl:port name="sample_wsdl_import_xsdPort" binding='tns:sample_wsdl_import_xsdSOAPBinding' >
          <soap:address location="http://localhost:2580/process/sample_wsdl_import_xsd"/>
          </wsdl:port>
          </wsdl:service>
          </wsdl:definitions>
          

      • Types, elements, attributes and groups defined in included XSD document withing <xsd:schema> section of <wsdl:types> section, should be visible in <wsdl:part> section of <wsdl:message> if the namespace of included XSD document is declared as attribute of <wsdl:definitions>



        • Example: The previous example also explains this point
      • Types, elements, attributes and groups defined in nested included XSD document should be visible inside same <xsd:schema> section of <wsdl:types> as well as inside <wsdl:part> section of <wsdl:message> if included schema’s namespace is defined as attribute of <wsdl:definitions>




        • Example: The previous example also explains this point
    4. Visibility of types, elements, attributes and groups across multiple <xsd:schema> section of <wsdl:types> of WSDL document



      • Types, elements, attributes and groups defined in one <xsd:schema> inside <wsdl:types> should not be by default visible inside another <xsd:schema> section




        • Example

          Sample.wsdl



          <?xml version="1.0" encoding="UTF-8"?>
          <wsdl:definitions xmlns:xsd="http://www.w3.org/2001/XMLSchema"
          xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
          xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
          xmlns:tns="urn:ESBP_TO_WSDL/xsd/SampleWSDLS/sample_wsdl_import_xsd"
          targetNamespace="urn:ESBP_TO_WSDL/xsd/SampleWSDLS/sample_wsdl_import_xsd"
          xmlns:test1="urn:ESBP_TO_WSDL/esbp/test1"
          xmlns:test2="urn:ESBP_TO_WSDL/esbp/test2">
          <wsdl:types>
          <xsd:schema elementFormDefault="qualified"
          targetNamespace="urn:ESBP_TO_WSDL/esbp/test1"
          xmlns:xsd="http://www.w3.org/2001/XMLSchema"
          xmlns:test1="urn:ESBP_TO_WSDL/esbp/test1">
          <xsd:element name="MyComplexElement"
          type="test1:MyComplexType"></xsd:element>
          <xsd:complexType name="MyComplexType">
          <xsd:sequence>
          <xsd:element name="streetNum" type="xsd:int"/>
          <xsd:element name="streetName" type="xsd:string"/>
          <xsd:element name="city" type="xsd:string"/>
          <xsd:element name="state" type="xsd:string"/> s
          </xsd:sequence>
          </xsd:complexType>
          </xsd:schema>
          <xsd:schema elementFormDefault="qualified"
          targetNamespace="urn:ESBP_TO_WSDL/esbp/test2"
          xmlns:xsd="http://www.w3.org/2001/XMLSchema"
          xmlns:test2="urn:ESBP_TO_WSDL/esbp/test2">
          <xsd:element name="MyElement" type="test1:MyComplexType" /><!-- This is not valid since namespace ("urn:ESBP_TO_WSDL/esbp/test1") of another schema section is not imported here  -->
          <xsd:complexType name="AnotherCompleType">
          <xsd:sequence>
          <xsd:element name="streetNum" type="xsd:int"/>
          <xsd:element name="streetName" type="xsd:string"/>
          <xsd:element name="city" type="xsd:string"/>
          <xsd:element name="state" type="xsd:string"/>
          </xsd:sequence>
          </xsd:complexType>
          </xsd:schema>
          </wsdl:types>
          <wsdl:message name="Request">
          <wsdl:part name="DefaultInput" type="test1:MyComplexType"></wsdl:part>
          <wsdl:part name="DefaultInput2" element="test1:MyComplexElement"></wsdl:part>
          </wsdl:message>
          <wsdl:message name="Response">
          <wsdl:part name="DefaultOutput" type="test2:AnotherCompleType"></wsdl:part>
          <wsdl:part name="DefaultOutput2" element="test1:MyComplexElement"></wsdl:part>
          </wsdl:message>
          <wsdl:portType name="sample_wsdl_import_xsdPortType">
          <wsdl:operation name="sample_wsdl_import_xsd">
          <wsdl:input message="tns:Request"></wsdl:input>
          <wsdl:output message="tns:Response"></wsdl:output>
          </wsdl:operation>
          </wsdl:portType>
          <wsdl:binding name="sample_wsdl_import_xsdSOAPBinding" type='tns:sample_wsdl_import_xsdPortType' >
          <soap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/>
          <wsdl:operation name="sample_wsdl_import_xsd">
          <soap:operation soapAction="urn:ESBP_TO_WSDL/xsd/SampleWSDLS/sample_wsdl_import_xsd:sample_wsdl_import_xsdPortType:sample_wsdl_import_xsdRequest"/>
          <wsdl:input>
          <soap:body namespace="urn:ESBP_TO_WSDL/xsd/SampleWSDLS/sample_wsdl_import_xsd" use="literal"/>
          </wsdl:input>
          <wsdl:output>
          <soap:body namespace="urn:ESBP_TO_WSDL/xsd/SampleWSDLS/sample_wsdl_import_xsd" use="literal"/>
          </wsdl:output>
          </wsdl:operation>
          </wsdl:binding>
          <wsdl:service name="sample_wsdl_import_xsdService">
          <wsdl:port name="sample_wsdl_import_xsdPort" binding='tns:sample_wsdl_import_xsdSOAPBinding' >
          <soap:address location="http://localhost:2580/process/sample_wsdl_import_xsd"/>
          </wsdl:port>
          </wsdl:service>
          </wsdl:definitions>
          

      • If the namespace of one <xsd:schema> section is imported inside another <xsd:schema> section of <wsdl:types> then all types, elements, attributes and groups of the first <xsd:schema> section as well as included types, elements, attributes and groups should be visible inside another <xsd:schema> section of<wsdl:types> but imported types inside first <xsd:schema> section should not be visible in the another <xsd:schema> section




        • Example

          Sample.wsdl



          <?xml version="1.0" encoding="UTF-8"?>
          <wsdl:definitions xmlns:xsd="http://www.w3.org/2001/XMLSchema"
          xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
          xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
          xmlns:tns="urn:ESBP_TO_WSDL/xsd/SampleWSDLS/sample_wsdl_import_xsd"
          targetNamespace="urn:ESBP_TO_WSDL/xsd/SampleWSDLS/sample_wsdl_import_xsd"
          xmlns:test1="urn:ESBP_TO_WSDL/esbp/test1"
          xmlns:test2="urn:ESBP_TO_WSDL/esbp/test2">
          <wsdl:types>
          <xsd:schema elementFormDefault="qualified"
          targetNamespace="urn:ESBP_TO_WSDL/esbp/test1"
          xmlns:xsd="http://www.w3.org/2001/XMLSchema"
          xmlns:test1="urn:ESBP_TO_WSDL/esbp/test1">
          <xsd:element name="MyComplexElement"
          type="test1:MyComplexType"></xsd:element>
          <xsd:complexType name="MyComplexType">
          <xsd:sequence>
          <xsd:element name="streetNum" type="xsd:int"/>
          <xsd:element name="streetName" type="xsd:string"/>
          <xsd:element name="city" type="xsd:string"/>
          <xsd:element name="state" type="xsd:string"/>
          </xsd:sequence>
          </xsd:complexType>
          </xsd:schema>
          <xsd:schema elementFormDefault="qualified"
          targetNamespace="urn:ESBP_TO_WSDL/esbp/test2"
          xmlns:xsd="http://www.w3.org/2001/XMLSchema"
          xmlns:test2="urn:ESBP_TO_WSDL/esbp/test2"
          xmlns:test1="urn:ESBP_TO_WSDL/esbp/test1">
          <xsd:import namespace="urn:ESBP_TO_WSDL/esbp/test1"/>
          <xsd:element name="MyElement" type="test1:MyComplexType" /><!-- This is valid since namespace ("urn:ESBP_TO_WSDL/esbp/test1") of another schema section is explicitly imported and hence visible over here -->
          <xsd:complexType name="AnotherCompleType">
          <xsd:sequence>
          <xsd:element name="streetNum" type="xsd:int"/>
          <xsd:element name="streetName" type="xsd:string"/>
          <xsd:element name="city" type="xsd:string"/>
          <xsd:element name="state" type="xsd:string"/>
          </xsd:sequence>
          </xsd:complexType>
          </xsd:schema>
          </wsdl:types>
          <wsdl:message name="Request">
          <wsdl:part name="DefaultInput" type="test1:MyComplexType"></wsdl:part>
          <wsdl:part name="DefaultInput2" element="test1:MyComplexElement"></wsdl:part>
          </wsdl:message>
          <wsdl:message name="Response">
          <wsdl:part name="DefaultOutput" type="test2:AnotherCompleType"></wsdl:part>
          <wsdl:part name="DefaultOutput2" element="test1:MyComplexElement"></wsdl:part>
          </wsdl:message>
          <wsdl:portType name="sample_wsdl_import_xsdPortType">
          <wsdl:operation name="sample_wsdl_import_xsd">
          <wsdl:input message="tns:Request"></wsdl:input>
          <wsdl:output message="tns:Response"></wsdl:output>
          </wsdl:operation>
          </wsdl:portType>
          <wsdl:binding name="sample_wsdl_import_xsdSOAPBinding" type='tns:sample_wsdl_import_xsdPortType' >
          <soap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/>
          <wsdl:operation name="sample_wsdl_import_xsd">
          <soap:operation soapAction="urn:ESBP_TO_WSDL/xsd/SampleWSDLS/sample_wsdl_import_xsd:sample_wsdl_import_xsdPortType:sample_wsdl_import_xsdRequest"/>
          <wsdl:input>
          <soap:body namespace="urn:ESBP_TO_WSDL/xsd/SampleWSDLS/sample_wsdl_import_xsd" use="literal"/>
          </wsdl:input>
          <wsdl:output>
          <soap:body namespace="urn:ESBP_TO_WSDL/xsd/SampleWSDLS/sample_wsdl_import_xsd" use="literal"/>
          </wsdl:output>
          </wsdl:operation>
          </wsdl:binding>
          <wsdl:service name="sample_wsdl_import_xsdService">
          <wsdl:port name="sample_wsdl_import_xsdPort" binding='tns:sample_wsdl_import_xsdSOAPBinding' >
          <soap:address location="http://localhost:2580/process/sample_wsdl_import_xsd"/>
          </wsdl:port>
          </wsdl:service>
          </wsdl:definitions>
          





    References:
    http://www.ws-i.org

    Share |

    Topics

     
    Embed Wave to Blogger