Changeset 18605 in vbox for trunk/src/VBox/Main/webservice
- Timestamp:
- Apr 1, 2009 4:11:51 PM (16 years ago)
- Location:
- trunk/src/VBox/Main/webservice
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/webservice/Makefile.kmk
r18422 r18605 366 366 endif 367 367 VBOX_JAR = jar 368 # Keep in sync with G_virtualBoxPackage and G_virtualBoxPackage2 in glue-jaxws.xsl 369 # Bump up once incompatible API version takes place 370 VBOX_JAVA_PACKAGE = org.virtualbox22 368 371 369 372 VBOXWEB_OTHERS += \ … … 622 625 $(QUIET)$(MKDIR) -p $(VBOXWEB_JAVALIB)/gen15 623 626 $(call MSG_GENERATE,,$@,JAX-WS for Java 1.5 bindings using $(VBOXWEBSERVICE_WSDL)) 624 $(QUIET)$(VBOX_WSIMPORT15) - d $(VBOXWEB_JAVALIB)/gen15 $(VBOXWEBSERVICE_WSDL)627 $(QUIET)$(VBOX_WSIMPORT15) -p $(VBOX_JAVA_PACKAGE) -d $(VBOXWEB_JAVALIB)/gen15 $(VBOXWEBSERVICE_WSDL) 625 628 $(call MSG_L1,Compiling bridge code) 626 629 $(QUIET)$(VBOX_JAVAC15) -cp \ … … 637 640 $(MKDIR) -p $(VBOXWEB_JAVALIB)/gen16 638 641 $(call MSG_GENERATE,,$@,JAX-WS for Java 1.6 bindings using $(VBOXWEBSERVICE_WSDL)) 639 $(QUIET)$(VBOX_WSIMPORT16) - d $(VBOXWEB_JAVALIB)/gen16 $(VBOXWEBSERVICE_WSDL)642 $(QUIET)$(VBOX_WSIMPORT16) -p $(VBOX_JAVA_PACKAGE) -d $(VBOXWEB_JAVALIB)/gen16 $(VBOXWEBSERVICE_WSDL) 640 643 $(call MSG_L1,Compiling bridge code) 641 644 $(QUIET)$(VBOX_JAVAC16) -cp $(VBOXWEB_JAVALIB)/gen16 \ -
trunk/src/VBox/Main/webservice/glue-jaxws.xsl
r16951 r18605 40 40 <xsl:variable name="G_xsltFilename" select="'glue-jaxws.xsl'" /> 41 41 42 <!-- Keep in sync with VBOX_JAVA_PACKAGE in webservices/Makefile.kmk --> 43 <xsl:variable name="G_virtualBoxPackage" select="'org.virtualbox22'" /> 44 <xsl:variable name="G_virtualBoxPackage2" select="'com.sun.xml.ws.commons.virtualbox22'" /> 45 42 46 <xsl:include href="websrv-shared.inc.xsl" /> 43 47 … … 47 51 select="//interface[@wsmap='suppress']" /> 48 52 53 49 54 <xsl:template name="fileheader"> 50 55 <xsl:param name="name" /> 51 <xsl:text> 52 /** 53 * Copyright (C) 2006-2008 Sun Microsystems, Inc. 56 <xsl:text>/** 57 * Copyright (C) 2006-2009 Sun Microsystems, Inc. 54 58 * 55 59 * This file is part of VirtualBox Open Source Edition (OSE), as … … 65 69 * additional information or have any questions. 66 70 * 67 * This file is autogenerated by glue-jaxws.xsl, DO NOT EDIT! 71 </xsl:text> 72 <xsl:value-of select="concat(' * ',$name)"/> 73 <xsl:text> 74 * 75 * DO NOT EDIT! This is a generated file. 76 * Generated from: src/VBox/Main/idl/VirtualBox.xidl (VirtualBox's interface definitions in XML) 77 * Generator: src/VBox/Main/webservice/glue-jaxws.xsl 68 78 */ 69 79 … … 87 97 </xsl:when> 88 98 <xsl:when test="//enum[@name=$name] or //enum[@name=$origname]"> 89 <xsl:value-of select="concat( 'org.virtualbox.', $name)" />99 <xsl:value-of select="concat($G_virtualBoxPackage, concat('.', $name))" /> 90 100 </xsl:when> 91 101 <xsl:when test="$collPrefix and //interface[@name=$origname]/@wsmap='managed'"> 92 <xsl:value-of select="concat( 'org.virtualbox.', $name)" />102 <xsl:value-of select="concat($G_virtualBoxPackage, concat('.', $name))" /> 93 103 </xsl:when> 94 104 <xsl:when test="//interface[@name=$name]/@wsmap='struct' or //interface[@name=$origname]/@wsmap='struct'"> 95 <xsl:value-of select="concat( 'org.virtualbox.', $name)" />105 <xsl:value-of select="concat($G_virtualBoxPackage, concat('.', $name))" /> 96 106 </xsl:when> 97 107 <xsl:otherwise> 98 <xsl:value-of select="concat( 'com.sun.xml.ws.commons.virtualbox.', $name)" />108 <xsl:value-of select="concat($G_virtualBoxPackage2, concat('.', $name))" /> 99 109 </xsl:otherwise> 100 110 </xsl:choose> … … 231 241 </xsl:variable> 232 242 <xsl:choose> 233 <xsl:when test="contains($elemtype, 'org.virtualbox')">243 <xsl:when test="contains($elemtype, $G_virtualBoxPackage)"> 234 244 <xsl:value-of select="concat($value,'.getArray()')" /> 235 245 </xsl:when> … … 315 325 </xsl:template> 316 326 327 <xsl:template name="startFile"> 328 <xsl:param name="file" /> 329 330 <xsl:value-of select="concat(' // ##### BEGINFILE "', $file, '" ')" /> 331 <xsl:call-template name="fileheader"> 332 <xsl:with-param name="name" select="$file" /> 333 </xsl:call-template> 334 package <xsl:value-of select="$G_virtualBoxPackage2" />; 335 336 import <xsl:value-of select="$G_virtualBoxPackage" />.VboxPortType; 337 import <xsl:value-of select="$G_virtualBoxPackage" />.VboxService; 338 import <xsl:value-of select="$G_virtualBoxPackage" />.InvalidObjectFaultMsg; 339 import <xsl:value-of select="$G_virtualBoxPackage" />.RuntimeFaultMsg; 340 import javax.xml.ws.WebServiceException; 341 </xsl:template> 342 343 <xsl:template name="endFile"> 344 <xsl:param name="file" /> 345 <xsl:value-of select="concat(' // ##### ENDFILE "', $file, '" ')" /> 346 </xsl:template> 317 347 318 348 <!-- - - - - - - - - - - - - - - - - - - - - - - … … 321 351 322 352 <xsl:template match="/idl"> 323 <xsl:text><![CDATA[ 324 /* DO NOT EDIT! This is a generated file. 325 * Generated from: src/VBox/Main/idl/VirtualBox.xidl (VirtualBox's interface definitions in XML) 326 * Generator: src/VBox/Main/webservice/glue-jaxws.xsl 327 */ 328 329 // ##### BEGINFILE "IUnknown.java" 330 package com.sun.xml.ws.commons.virtualbox; 331 332 import org.virtualbox.service.VboxPortType; 333 import org.virtualbox.service.InvalidObjectFaultMsg; 334 import org.virtualbox.service.RuntimeFaultMsg; 335 import javax.xml.ws.WebServiceException; 336 353 <xsl:call-template name="startFile"> 354 <xsl:with-param name="file" select="'IUnknown.java'" /> 355 </xsl:call-template> 356 357 <xsl:text><![CDATA[ 337 358 public class IUnknown 338 359 { … … 383 404 // not only as common baseclass 384 405 } 385 386 // ##### ENDFILE "IUnknown.java" 387 388 // ##### BEGINFILE "Helper.java" 389 390 package com.sun.xml.ws.commons.virtualbox; 406 ]]></xsl:text> 407 408 <xsl:call-template name="endFile"> 409 <xsl:with-param name="file" select="'IUnknown.java'" /> 410 </xsl:call-template> 411 412 <xsl:call-template name="startFile"> 413 <xsl:with-param name="file" select="'Helper.java'" /> 414 </xsl:call-template> 415 416 <xsl:text><![CDATA[ 391 417 392 418 import java.util.List; … … 396 422 import java.lang.reflect.Constructor; 397 423 import java.lang.reflect.InvocationTargetException; 398 import org.virtualbox.service.InvalidObjectFaultMsg;399 import org.virtualbox.service.RuntimeFaultMsg;400 import org.virtualbox.service.VboxService;401 import org.virtualbox.service.VboxPortType;402 424 403 425 class Helper { … … 441 463 } 442 464 } 443 444 // ##### ENDFILE "Helper.java" 445 446 // ##### BEGINFILE "IWebsessionManager.java" 447 448 449 /** 450 * Copyright (C) 2006-2008 Sun Microsystems, Inc. 451 * 452 * This file is part of VirtualBox Open Source Edition (OSE), as 453 * available from http://www.virtualbox.org. This file is free software; 454 * you can redistribute it and/or modify it under the terms of the GNU 455 * General Public License (GPL) as published by the Free Software 456 * Foundation, in version 2 as it comes in the "COPYING" file of the 457 * VirtualBox OSE distribution. VirtualBox OSE is distributed in the 458 * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind. 459 * 460 * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa 461 * Clara, CA 95054 USA or visit http://www.sun.com if you need 462 * additional information or have any questions. 463 * 464 * This file is autogenerated by glue-jaxws.xsl, DO NOT EDIT! 465 */ 466 467 package com.sun.xml.ws.commons.virtualbox; 468 465 ]]></xsl:text> 466 467 <xsl:call-template name="endFile"> 468 <xsl:with-param name="file" select="'Helper.java'" /> 469 </xsl:call-template> 470 471 <xsl:call-template name="startFile"> 472 <xsl:with-param name="file" select="'IWebsessionManager.java'" /> 473 </xsl:call-template> 474 475 <xsl:text><![CDATA[ 469 476 import java.net.URL; 470 477 import java.math.BigInteger; … … 477 484 import javax.xml.ws.Holder; 478 485 import javax.xml.ws.WebServiceException; 479 import com.sun.xml.ws.commons.virtualbox.IUnknown;480 481 import org.virtualbox.service.InvalidObjectFaultMsg;482 import org.virtualbox.service.RuntimeFaultMsg;483 import org.virtualbox.service.VboxService;484 import org.virtualbox.service.VboxPortType;485 486 486 487 class PortPool … … 624 625 625 626 626 public void disconnect( com.sun.xml.ws.commons.virtualbox.IVirtualBox refIVirtualBox)627 public void disconnect(IVirtualBox refIVirtualBox) 627 628 { 628 629 logoff(refIVirtualBox); … … 641 642 [return] IVirtualBox return) 642 643 */ 643 public com.sun.xml.ws.commons.virtualbox.IVirtualBox logon(String username, String password) {644 public IVirtualBox logon(String username, String password) { 644 645 try { 645 646 String retVal = port.iWebsessionManagerLogon(username, password); 646 return new com.sun.xml.ws.commons.virtualbox.IVirtualBox(retVal, port);647 return new IVirtualBox(retVal, port); 647 648 } catch (InvalidObjectFaultMsg e) { 648 649 throw new WebServiceException(e); … … 656 657 [return] ISession return) 657 658 */ 658 public com.sun.xml.ws.commons.virtualbox.ISession getSessionObject(com.sun.xml.ws.commons.virtualbox.IVirtualBox refIVirtualBox) {659 public ISession getSessionObject(IVirtualBox refIVirtualBox) { 659 660 try { 660 661 String retVal = port.iWebsessionManagerGetSessionObject(((refIVirtualBox == null)?null:refIVirtualBox.getRef())); 661 return new com.sun.xml.ws.commons.virtualbox.ISession(retVal, port);662 return new ISession(retVal, port); 662 663 } catch (InvalidObjectFaultMsg e) { 663 664 throw new WebServiceException(e); … … 670 671 [in] IVirtualBox refIVirtualBox) 671 672 */ 672 public void logoff( com.sun.xml.ws.commons.virtualbox.IVirtualBox refIVirtualBox) {673 public void logoff(IVirtualBox refIVirtualBox) { 673 674 try { 674 675 port.iWebsessionManagerLogoff(((refIVirtualBox == null)?null:refIVirtualBox.getRef())); … … 680 681 } 681 682 } 682 683 // ##### ENDFILE "IWebsessionManager.java"684 685 683 ]]></xsl:text> 684 <xsl:call-template name="endFile"> 685 <xsl:with-param name="file" select="'IWebsessionManager.java'" /> 686 </xsl:call-template> 686 687 687 688 <xsl:text>// ######## COLLECTIONS </xsl:text> … … 694 695 <xsl:value-of select="concat(' // ##### BEGINFILE "', $filename, '.java" ')" /> 695 696 696 <xsl:call-template name=" fileheader">697 <xsl:with-param name=" name" select="$filename" />697 <xsl:call-template name="startFile"> 698 <xsl:with-param name="file" select="concat($filename, '.java')" /> 698 699 </xsl:call-template> 699 700 <xsl:text>package com.sun.xml.ws.commons.virtualbox; </xsl:text>701 700 702 701 <xsl:text>import java.util.ArrayList; </xsl:text> … … 721 720 <xsl:text> } </xsl:text> 722 721 <xsl:text>} </xsl:text> 723 724 <xsl:value-of select="concat(' // ##### ENDFILE "', $filename, '.java" ')" /> 722 <xsl:call-template name="endFile"> 723 <xsl:with-param name="file" select="concat($filename, '.java')" /> 724 </xsl:call-template> 725 725 726 </xsl:for-each> 726 727 … … 731 732 <xsl:variable name="filename" select="$enumname" /> 732 733 733 <xsl:value-of select="concat(' // ##### BEGINFILE "', $filename, '.java" ')" /> 734 735 <xsl:call-template name="fileheader"> 736 <xsl:with-param name="name" select="$filename" /> 734 <xsl:call-template name="startFile"> 735 <xsl:with-param name="file" select="concat($filename, '.java')" /> 737 736 </xsl:call-template> 738 737 739 <xsl:text>package com.sun.xml.ws.commons.virtualbox; </xsl:text>740 738 <xsl:text>import javax.xml.bind.annotation.XmlEnum; </xsl:text> 741 739 <xsl:text>import javax.xml.bind.annotation.XmlEnumValue; </xsl:text> … … 781 779 <xsl:text>} </xsl:text> 782 780 783 <xsl:value-of select="concat(' // ##### ENDFILE "', $filename, '.java" ')" /> 781 <xsl:call-template name="endFile"> 782 <xsl:with-param name="file" select="concat($filename, '.java')" /> 783 </xsl:call-template> 784 784 785 785 </xsl:for-each> … … 794 794 795 795 <xsl:if test="not($wsmap='suppress') and not($wsmap='struct') and not ($wsmap='global')"> 796 <xsl:value-of select="concat(' // ##### BEGINFILE "', $filename, '.java" ')" /> 797 798 <xsl:call-template name="fileheader"> 799 <xsl:with-param name="name" select="$filename" /> 796 <xsl:call-template name="startFile"> 797 <xsl:with-param name="file" select="concat($filename, '.java')" /> 800 798 </xsl:call-template> 801 802 <xsl:text>package com.sun.xml.ws.commons.virtualbox; </xsl:text>803 799 804 800 <xsl:text>import java.math.BigInteger; </xsl:text> … … 806 802 <xsl:text>import java.util.UUID; </xsl:text> 807 803 <xsl:text>import javax.xml.ws.Holder; </xsl:text> 808 <xsl:text>import javax.xml.ws.WebServiceException; </xsl:text> 809 <xsl:text>import com.sun.xml.ws.commons.virtualbox.IUnknown; </xsl:text> 810 <xsl:text>import org.virtualbox.service.InvalidObjectFaultMsg; </xsl:text> 811 <xsl:text>import org.virtualbox.service.RuntimeFaultMsg; </xsl:text> 812 <xsl:text>import org.virtualbox.service.VboxService; </xsl:text> 813 <xsl:text>import org.virtualbox.service.VboxPortType; </xsl:text> 804 <xsl:text>import javax.xml.ws.WebServiceException; </xsl:text> 814 805 815 806 <xsl:choose> … … 1127 1118 <xsl:text>} </xsl:text> 1128 1119 <xsl:value-of select="concat(' // ##### ENDFILE "', $filename, '.java" ')" /> 1120 <xsl:call-template name="endFile"> 1121 <xsl:with-param name="file" select="concat($filename, '.java')" /> 1122 </xsl:call-template> 1129 1123 </xsl:if> 1130 1124 </xsl:for-each> -
trunk/src/VBox/Main/webservice/samples/java/jax-ws/clienttest.java
r16124 r18605 19 19 * additional information or have any questions. 20 20 */ 21 import com.sun.xml.ws.commons.virtualbox .*;21 import com.sun.xml.ws.commons.virtualbox22.*; 22 22 import java.util.*; 23 23 import javax.xml.ws.Holder; 24 import org.virtualbox .*;24 import org.virtualbox22.*; 25 25 26 26 public class clienttest … … 121 121 { 122 122 int i = 0; 123 for (IMachine m : vbox.getMachines 2())123 for (IMachine m : vbox.getMachines()) 124 124 { 125 125 System.out.println("Machine " + (i++) + ": " + " [" + m.getId() + "]" + " - " + m.getName());
Note:
See TracChangeset
for help on using the changeset viewer.