<rt id="bn8ez"></rt>
<label id="bn8ez"></label>

  • <span id="bn8ez"></span>

    <label id="bn8ez"><meter id="bn8ez"></meter></label>

    hengheng123456789

      BlogJava :: 首頁 :: 聯(lián)系 :: 聚合  :: 管理
      297 Posts :: 68 Stories :: 144 Comments :: 0 Trackbacks

    You can create of Web services using a top-down approach (which starts with a WSDL file) or a bottom-up approach (which starts with a Java bean or EJB).

    建立Web services有兩種方式:

    top-down :是從WSDL 開始,Top-down Web services development involves creating a Web service from a WSDL file.

    bottom-up :是從Java bean or EJB開始,Bottom-up Web services development involves creating a Web service from a Java? bean or enterprise bean.

    通用的開發(fā)步驟有以下幾步:

    1. Create a Web project.
    2. Create or import an artifact to be turned into a Web service.
    3. Create a Web service.
    4. Publish a business entity.
    5. Publish a Web service.

    首先介紹一下top-down方式:

    1. Switch to the J2EE perspective (Window > Open Perspective > J2EE).
    2. In the Project Explorer view, select the WSDL file that you created or imported into the Web Content folder of your Web project.
    3. Click File > New > Other. Select Web Services in order to display the various Web service wizards. Select the Web Service wizard. Click Next.
    4. Web Services page: select Top down Java bean Web service as your Web service type. You can optionally choose to do the following:
      • Start the Web service in a Web project - if you do not select this option you will have to manually start the Web service. You must select this option to enable the other options on this page.
      • Launch the Web Services Explorer to publish your Web service to a UDDI registry.
      • Generate a Java?bean client proxy to the Web service. The Java bean client proxy that is generated provides a remote procedure call interface to the Web service.
      • Test the Web service - this allows you to test the Web service in the Web Service Explorer before a proxy is generated.
      • Send the Web service traffic through the TCP/IP Monitor, which allows you to watch the SOAP traffic generated by the Web service and to test this traffic for WS-I compliance. Note that this is only supported for Tomcat v4.0 and v4.1. If you are using Tomcat v5.0 and want to monitor the Web service traffic, you need to manually set up a TCP/IP monitor?
    5. Web Service Selection page: Enter the URI to the WSDL, WSIL, or HTML file that will be used to generate the Java bean. If you have selected the WSDL file before starting the wizard, this information should be prefilled. You can optionally generate a WSIL file from this file as well. Ensure that there are no spaces at the beginning of the URI or you may generate a null pointer exception.
    6. Service Deployment Configuration page: specify the server and client deployment settings.
      1. Click Edit and select the Apache Axis run-time environment and select the server on which you want to run your Web service and Web service client.
      2. Select the Web project in which you want your Web service created. The wizard will create this for you if they do not already exist.
      3. Select the type and name of project in which you want the Web service client created. If you enter the name of an existing project, the project type field must match that of the existing project. If you enter a name of a project that does not already exist, the wizard will create the project for you. Note that the only project type supported for Axis and SOAP run-time clients is a Web project. If you want the client to be created in a Java, EJB, or Application Client project, you must select the WebSphere? ?run-time environment for your client.
    7. Web Services Skeleton Java Bean Configuration page: Select the folder where the generated Java will be stored. If you want to review or edit the mappings between packages and namespaces, select the Define custom mapping for namespace to package check box. Click Next.
    8. Web Service Namespace to Package Mappings page: if you selected Define custom mapping for package to namespace on the previous panel, you can enter your custom mapping pairs on this panel by clicking Add. Click Next.
    9. Web Service Test page: If you selected to test the Web service, select the test facility for the generated Web service. This will open the Web service in the Web Services Explorer. Select the operation you want to test, enter the required information, and click Go. The result will display in the Status pane. Click Next.
    10. Web Service Proxy page: If you have selected to generate a proxy, this page shows the options for the proxy. It lists the folder where the proxy will be generated, and you can optionally create custom mappings between namespaces and packages. Click Next.
    11. Web Service Client Test page: Use this page to select the following options:
      1. Select your test facility. You can test the generated proxy in the Universal Test Client or the Web Service Explorer, or you can generate a sample Web service JSP.
      2. If you selected to test the proxy through a JSP, you can select the folder where the JSP will be located, and you can select the methods that will be included in the JSP.
      3. Select Run test on server to start the server for you automatically.
    12. Web Service Publication page: If you have selected to publish your Web service to a UDDI registry, use this page to launch the Web Services Explorer and select the UDDI registry to which the Web service will be published. Click Finish.

    bottom-up方式:

    1. Switch to the J2EE perspective ( Window > Open Perspective > J2EE).
    2. In the Project Explorer view, select the bean that you created or imported into the source folder of your Web project.
    3. Click File > New > Other. SelectWeb Services in order to display the various Web service wizards. Select the Web Service wizard. Click Next.
    4. Web Services page: select Bottom up Java bean Web service as your Web service type. You can optionally choose to do the following:
      • Start the Web service in a Web project - if you do not select this option you will have to manually start the Web service. You must select this option to enable the other options on this page.
      • Launch the Web Services Explorer to publish your Web service to a UDDI registry.
      • Generate a Java bean client proxy to the Web service. The Java bean client proxy that is generated provides a remote procedure call interface to the Web service.
      • Test the Web service - this allows you to test the Web service in the Web Service Explorer before a proxy is generated.
      • Send the Web service traffic through the TCP/IP Monitor, which allows you to watch the SOAP traffic generated by the Web service and to test this traffic for WS-I compliance. Note that this is only supported for Tomcat v4.0 and v4.1. If you are using Tomcat v5.0 and want to monitor the Web service traffic, you need to manually set up a TCP/IP monitor?
    5. Object selection page: select the Java bean from which the Web service will be created.
    6. Service Deployment Configuration page: specify the server and client deployment settings.
      1. Click Edit and select the Apache Axis run-time environment and select the server on which you want to run your Web service and Web service client.
      2. Select the Web project in which you want your Web service created, and the EAR with which it will be associated. The wizard will create these for you if they do not already exist.
      3. Select the type and name of project in which you want the Web service client created. If you enter the name of an existing project, the project type field must match that of the existing project. If you enter a name of a project that does not already exist, the wizard will create the project for you. Note that the only project type supported for Axis and SOAP run-time clients is a Web project. If you want the client to be created in a Java, EJB, or Application Client project, you must select the WebSphere ?run-time environment for your client.
      4. Select an existing EAR or enter a unique name to associate the Web service client with a different EAR than the Web service EAR. Note: Selecting different EARs for the Web service and Web service client can reduce the chance of encountering run time errors, but will use more system resources.
    7. A message will display stating that you have made a WS-I non-compliant selection. The Apache Axis run-time environment is not WS-I compliant. Select Ignore.
    8. Web Service Java Bean Identity page: the Web service URI and WSDL name will be listed. You?have the following options:
      • Select the methods to expose.
      • Select the encoding style. RPC/Encoded is the recommended encoding style for the Axis run-time environment. This encoding method is not WS-I compliant.
      • Select if you want to customize the package to namespace mappings.
      Click Next
    9. Web Service Package to Namespace Mappings page: if you selected Define custom mapping for package to namespace on the previous panel, you can enter your custom mapping pairs on this panel by clicking Add.
    10. Web Service Test page: If you selected to test the Web service, select the test facility for the generated Web service. This will open the Web service in the Web Services Explorer. Select the operation you want to test, enter the required information, and clickGo. The result will display in the Status pane. Click Next.
    11. Web Service Proxy page: if you have selected to generate a proxy, select if you want to customize the package to namespace mappings.
    12. Web Service Client Test page: Use this page to select the following options:
      1. Select your test facility. You can test the generated proxy in the Universal Test Client or the Web Service Explorer, or you can generate a sample Web service JSP.
      2. If you selected to test the proxy through a JSP, you can select the folder where the JSP will be located, and you can select the methods that will be included in the JSP.
      3. Select Run test on server to start the server for you automatically.
    13. Web Service Publication page: Select whether or not you want to publish this Web service to a UDDI registry. Click Finish . Note: you may see a warning stating Error in generating WSDL from Java. ClassNotFound: <bean name>. This error can be safely ignored.

    最后我們可建立Web Service?Client來驗(yàn)證Web Service?的使用。

    首先需要發(fā)現(xiàn)Web services,步驟如下:

    從UDDI?查找:

    1. Launch the Web Services Explorer
    2. Click UDDI Main.
    3. In the Actions pane select a registry from the drop-down list and click Go.
    4. In the Actions pane toolbar click the Find icon A picture of the Find icon..
    5. In the Actions pane, enter the name of the query, what you are searching for, the type of search that you want to perform, and any query information:
      1. Search for? This list allows you to search for businesses, services, or service interfaces.
        • Businesses Once you locate a business in the registry, use the icons in the Action pane toolbar to do the following:
          • View and edit business details
          • Get the services associated with that business
          • Publish a service
          • Manage referenced services
          • Manage publisher assertions
          • Add the business to Favorites
          • Unpublish the business
        • Services Once you locate a service in the registry, use the icons in the Action pane toolbar to do the following:
          • View and edit service details
          • Get the business associated with that service
          • Get the service interfaces associated with that service
          • Import the service WSDL file to the Eclipse workbench
          • Import the service WSDL file to the file system
          • Launch the Web Service wizards
          • Add the service to Favorites
          • Unpublish the service
        • Service interfaces Once you locate a service interface in the registry, use the icons in the Action pane toolbar to do the following:
          • View and edit interface details
          • Get the services associated with that service interface
          • Get the businesses associated with that service interface
          • Import the service interface WSDL file to the Eclipse workbench
          • Import the service interface WSDL file to the file system
          • Launch the Web Service wizards
          • Add the service interface to Favorites
          • Unpublish the service interface
      2. Type of search? These radio buttons allow you to specify a simple or advanced search, or a search by a Universal Unique Identifier (UUID).
        Simple
        Type the name of the businesses, services, or service interfaces for which you are searching. Note: The search set size is set to 100 and the maximum number of returned results is set to 10 by default.? If you would like to override the defaults, use the Advanced search.
        Advanced
        Allows you to enter more search options to focus the scope of your search. Select this option if you would like to search for multiple businesses or services.
        UUID
        Allow you to enter the UUID key.? The UUID key is the identifier that is associated with the published object.
    6. Once you have searched and discovered the business service description you desired, select the service or the service interface and click the Import icon to:
      • import the WSDL document into your Web project
      • import the WSDL document into the WSDL Explorer for testing
      • launch the Web Service Skeleton Creation wizard or Web Service Client wizard directly from the Web Services Explorer.

    從WSIL 查找:

    1. From the Web Services Explorer toolbar, click the WSIL Page icon Picture of the WSIL Page icon..
    2. In the Navigator pane, click WSIL Main.
    3. In the URL to document field of the Actions pane enter the URL to the WSIL document or HTTP document that contains links to a WSIL document. Details on how an HTTP file can contain links to WSIL can be found here: http://www.ibm.com/developerworks/webservices/library/ws-wsilspec.html
    4. Once you have located the WSIL document, use the icons in the Action pane toolbar to do the following:
      • View WSIL document details
      • List all of the WSDL services associated with that WSIL document
      • List all of the UDDI services associated with that WSIL document
      • List all of the UDDI businesses associated with that WSIL document
      • List all of the WSIL links associated with that WSIL document
      • Import the WSIL document to the file system
      • Add the WSIL document to Favorites
      Important: If the IBM Web Services Explorer does not display the project that you would like to import your WSDL file to, ensure that you have created the project and/or click the Refresh icon.

    建立Web Service?Client:

    1. Switch to the J2EE perspective (Window > Open Perspective > J2EE).
    2. In the Navigator view, select the Web project in which you want to generate a sample application.
    3. Click File > New > Other. Select Web Services in order to display the various Web service wizards. Select the Web Service Client wizard. Click Next.
    4. Web Services page: Select the type of proxy to be generated, and whether or not it will be tested.
    5. Client Environment Configuration page: Select the run-time environment and the server for your Web service client.
      1. Click Explore Options and select the Apache Axis run-time environment and select the server on which you want to run your Web service client.
      2. Select the type and name of project in which you want the Web service client created.
        • If you enter the name of an existing project, the project type field must match that of the existing project. Ensure that the project selected as the Client Web Project is different from the Service Web Project, or the service will be overwritten by the client's generated artifacts.
        • If you enter a name of a project that does not already exist, the wizard will create the project for you.
        • Note that the only project type supported for Axis and SOAP run-time clients is a Web project. If you want the client to be created in a Java, EJB, or Application Client project, you must select the WebSphere run-time environment for your client.
    6. Web Service Selection page: Enter the URI to the WSDL, WSIL, or HTML file that will be used to generate the client. You can optionally generate a WSIL file from this file as well.
    7. Web Service Proxy page: This panel shows the options for the proxy. It lists the folder where the proxy will be generated, and you can optionally create custom mappings between namespaces and packages.
    8. Web Service Namespace to Package Mappings page: if you selected Define custom mapping for namespace to package on the previous page, you can enter your custom mapping pairs on this page by clicking Add.
    9. Web Service Client Test page: Select the test facility that you will use to test the proxy, and the methods that you want included in the proxy. Note that the Universal Test Client (UTC) is only compatible with Web service clients deployed on WebSphere servers.
    10. Click Finish. If you have selected to test the proxy, the test client will open in a browser window.
    posted on 2007-02-28 16:40 哼哼 閱讀(4655) 評(píng)論(0)  編輯  收藏 所屬分類: JAVA-Web
    主站蜘蛛池模板: 日韩精品无码人妻免费视频| 亚洲欧洲免费无码| 亚洲AV蜜桃永久无码精品| 精品女同一区二区三区免费站| 亚洲国产成人影院播放| 一个人看的www在线观看免费| 亚洲无线一二三四区| 久久久久无码专区亚洲av| 免费无码又爽又高潮视频| 免费国产作爱视频网站| 久99久精品免费视频热77| 中文字幕在线观看免费| 男人扒开添女人下部免费视频| 亚洲欧洲精品成人久久曰影片| 青青操视频在线免费观看| 污视频网站免费观看| 亚洲人成人无码.www石榴| 亚洲国产精品一区二区久| 麻豆亚洲AV永久无码精品久久| 免费高清av一区二区三区| 99爱在线精品免费观看| 最近中文字幕2019高清免费| 男人都懂www深夜免费网站| 国产黄在线播放免费观看| 免费一区二区无码视频在线播放 | 亚洲理论片在线观看| 国产V亚洲V天堂A无码| 久久久久无码专区亚洲av| 免费大黄网站在线观看| 免费人成在线观看播放国产 | 亚洲欧洲日产国码无码网站 | 精品无码一区二区三区亚洲桃色| 好大好深好猛好爽视频免费| 亚洲精品视频免费看| 免费人妻无码不卡中文字幕系| 国产成人高清亚洲一区91 | 男人j进入女人j内部免费网站| 亚洲国产精品精华液| 亚洲男人天堂2018av| 亚洲中文字幕无码久久| 亚洲6080yy久久无码产自国产|