Sybase, PowerDesigner Written by the chief architect of Xiao Wang
Web services provide a standard format to allow you to existing or new features, and allows users and applications access them from any location.
PowerDesigner 9.5 is directed against Microsoft. NET and Java Web services into a complete design and build mechanisms. Using PowerDesigner 9.5, you can focus on the design of Web services, but will generate all necessary to achieve the task of construction to be completed PowerDesigner.
Web Services Overview Web services are an interface, which describes the network can be accessed through the SOAP message operation set.
Web services interfaces and deployment location (optional) from the WSDL description. WSDL is a declaration of data types, message, port type and port (optional) the XML document. By WSDL, the user can know which format to send SOAP messages to invoke Web services and why the return message format.
In order to enable users to find the required Web services, service providers may publish in the UDDI registration services WSDL document. In this way, users can use the UDDI registration services to search for Web services.
To call the Web service, users can deploy Web services to the access point URL where to send SOAP messages, or use this call to simplify the process of proxy class. SOAP messages are XML documents.
PowerDesigner PowerDesigner 9.5 of Web services to allow your new Web service component, through reverse engineering to create a WSDL Web service component, browse UDDI, search WSDL, Web service components from the definition of generating WSDL, generates. NET (C # and VB. NET) of the server-side code generation. NET client proxy, generated Java (JAX-RPC and JAXM) of the server-side Java code and generate the client proxy.
In order to design Web service components, PowerDesigner using UML class diagrams, component diagrams and deployment plans. Web service components from the component diagram that only the deployment of Web services component instance from the deployment diagram to represent.
Create a Web service component to create Web services component has five steps. The first is to create object-oriented model (OOM). You can use any of the following languages: C #, Visual Basic. NET or Java. In this model, the WSDL is automatically extended an additional model for the definition of (XEM). XEM definition of the WSDL generation templates and extended attributes.
The second step is to create a class. Is best to first create a program group (Package), then the program group created under this category.
The third step is to use the Web Service wizard will create the class into a Web service component. To do this you can right-click the class, and then select the "Create a Web service component" command, or select the class and select "Tools> Create Web service component" command. Figure 1 shows an example of a Web service wizard. Web interface or service type can be achieved. If you select the "interface", it means that you only want the definition of this Web component and generate the corresponding WSDL. For. NET, the component type is "standard", the Web service will. Asmx file to achieve. For Java, this component type may be "standard", "service program" or "Stateless Session Bean". This type of implementation of several methods of Java components are: the "standard" type using JAX-RPC, "service program" type use JAXM, and "Stateless Session Bean" type will use the J2EE (JSR109) Web services specifications. When the wizard creates a component at the end of the class. Figure 2 shows the component diagram of components of symbolic example.
Figure 1 Web Service Wizard
Figure 2 Component Symbols
The fourth step is to add a Web method. You need to create a new operation (Operation), open the operation of the property page, click the "Web method" check box, and define parameters and return type and the preparation of the operation of the implementation code. Figure 3 shows an example Web method GetStockQuote implementation.
Figure 3 Web method implementation sample GetStockQuote
The final step is to customize the generated WSDL. Can customize the parameters and return values of WSDL data types, operations and components of the property extended attributes and extended attributes. To test the generated WSDL, you can open the WSDL Component property page tab. WSDL can be generated to PowerDesigner to complete the task can also be defined by your own (user defined). If the Web service component of the WSDL from reverse engineering, the original WSDL will be retained. Figure 4 shows an example of the generated WSDL.
Figure 4 Examples of the generated WSDL
You can type property page "preview" tab in the preview of the generated implementation code. You can use the deployment diagram, nodes and components built in imitation of examples of Web services components have been deployed. In addition, you can also "node" is defined in the server's URL and in the "component instance" defined in the service URL.
Reverse engineering of the WSDL WSDL can define Web services interfaces only, you can also define the interface and access point URL. Web service interface may be multiple service providers to provide the same services, of course, these services will have different implementations and the access point. If you have a WSDL document file path or URL, you can reverse engineer it to create a Web service component, and then you can define your own implementation of the method or to create a Web service component stored in the library for later re-use . WSDL you find interesting, you can use the UDDI browser in the registration service in UDDI search.
In order to reverse engineer WSDL, need C #, VB. NET or Java, a language created any OOM. Then select "Language> Import WSDL" command and enter the WSDL file path or URL. After reverse engineering, will create a component component diagram, class diagram in the same time, create a class. Created class will only contain the Web service operation signal, To achieve the Web services, but also the realization of these operations need to define the code.
Registration service in UDDI search WSDL if you want to search in the UDDI registration services registered in WSDL, please open the "Import WSDL" window, then click the "Browse UDDI" button. Through the "Browse UDDI" window (see Figure 5), you can choose to UDDI operators, search conditions and search type, and can be entity names, service names or WSDL name to search. In addition, you can preview found WSDL.
Figure 5 "Browse UDDI" window
Generated. NET Web services for type. NET server-side code, PowerDesigner will generate a. Asmx file. This Web service implementation class in the above. Asmx file is generated, it can be externally generated. The implementation class can be used in the language C # or VB. NET. In the class property page "preview" tab, you can preview. Asmx file and the corresponding implementation class code. Figure 6 shows the C # language. Asmx file example.
Figure 6 C # language. Asmx file example
PowerDesigner can generate the client proxy class to simplify the Web service call. To generate client proxy classes, PowerDesigner use Visual Studio. NET ships wsdl.exe procedures.
To generate WSDL, server-side code and / or client-side proxy, select the "Language> generate C # code" or "language> generate VB. NET code" command. If you want to generate the client proxy, you can "task" tab, select "Generate Web service client proxy" option. Figure 7 shows the available generation task. If the class is not in the. Asmx file generated inside, you will be able to these C # code or VB. NET code is compiled. However, at compile C # or VB. NET file, you must define the CSC or VBC variables to indicate the location of csc.exe or vbc.exe command.
In the deployment of Web services, just to IIS directory. Asmx file and copy the corresponding class file: C: Inetpubwwwroot
Figure 7 Web services generation task
Generated Java type of Web service if the Web service implementation type is "standard", PowerDesigner will use JAX-RP to achieve. If the implementation type is "service program", PowerDesigner will use JAXM to achieve. If the implementation type is "stateless session Bean, the PowerDesigner will use the J2EE (JSR109) Web services specifications to achieve. JSR109 not yet been promulgated."
RPC JAX-RPC defines the type of Web service calls. Although it is easy to develop and use, but in order to avoid the complexity of the object / XML mapping, it can only be limited to a simple message format. The Web services components based on JAXM the more obvious advantages, it allows you the flexibility to handle complex information structure.
To use the JAX-RPC or JAXM, you need to install Java Web Services Developer Pack (JWSDP). This package can be downloaded from Sun's Web site. The deployment of JAX-RPC or the type of Web service components JAXM, the need to support JAX-RPC or JAXM server. Support for JAX-RPC or the Apache Tomcat with JAXM provided JWSDP.
The JAX-RPC for Web-based service component, you need to achieve their Web method code. To generate WSDL, server-side code and / or client-side proxy, select the "Language> generates Java code", then select "Use XRPCC tool to generate WSDL (server side)" and / or "use XRPCC tool to generate Web services Agent code "command (see Figure 8). XRPCC JWSDP command is a tool. It can generate JAX-RPC type of server-side code or client-side proxy. Resulting in the deployment of Web services, the need to create a file that contains all generated. WAR file and the. WAR file to deploy in support of the JAX-RPC servers, such as Apache Tomcat.
Figure 8 JAX-RPC generated task
JAXM of Web-based service component is concerned, you need to achieve their onMessage operation. onMessage operation in accordance with the instructions in the WSDL, receive and process the input SOAP message and build the return message, and this message return. To generate WSDL and Web services JAXM type, select "Language> generate Java code for" command, then select the "Building Web Components to create Web application WAR" command (see Figure 9). This command will compile the code JAXM services and create a WAR file. JAXM services to deploy this program, you can deploy the WAR file servers in support of JAXM, for example, Apache Tomcat.
Figure 9 JAXM generation task
The stateless session Bean on the Web service component, as JSR109 specification not yet been promulgated, it currently can not use.
The next step to enhance the function of J2EE (JSR109) Web services specifications will soon be available for people to use. With it, you can Stateless Session Bean as a Web services implementation tool. It allows existing features to the new Web services emerged, but also can create new Web services. PowerDesigner 9.5 provided with JSR109 specification based on an early version, the version to be further authentication. The official promulgation of such standard, we will provide maintenance release in order to achieve its full support.
PowerDesigner's new version will also support the comprehensive Web services standard.
Conclusion Web services PowerDesigner 9.5 simplifies the design and generation process. As long as know how to create classes and methods, we can know how to create a Web service! You can use PowerDesigner to design, create Web services, and reverse engineer it and to create the document. If you want to re-use of these Web components, you can create a Web service component library, and use the repository (Repository) to manage different versions of the Web components.