IBM®
Skip to main content
    Country/region [select]      Terms of use
 
 
      
     Home      Products      Services & solutions      Support & downloads      My account     

IBM developerWorks : XML zone | Java technology
developerWorks
From text to byte code
e-mail it!
Data binding from XML to Java, Part 3

Return to article

Listing 2. WSDL for the Google API

 import java.io.File;
 import org.enhydra.xml.binding.;
 public class TestMapper {
     public static void main([] args) {
         System.out.println("Starting unmarshalling...");
         try {
             File file = new File("xml/example.xml");
             Object o = .(file.toURL());
             System.out.println("Object class: " + o.getClass().getName());   
             System.out.println("Casting to ...");
              config = ()o;
             System.out.println("Successful cast.");
             System.out.println("Name: " + config.getName()); 
             System.out.println("Version: " + config.getVersion());
             System.out.println("Port Number: " + config.getPort().getNumber());
             System.out.println("Port Protocol: " + config.getPort().getProtocol());
         } catch (Exception e) {
             e.printStackTrace();
         }
     }
 }unmarshallerStringunmarshallerunmarshallWebServiceConfigurationWebServiceConfigurationWebServiceConfiguration

Return to article




IBM developerWorks : XML zone | Java technology
developerWorks
  About IBM  |  Privacy  |  Terms of use  |  Contact