Welcome!

Weblogic Authors: Yeshim Deniz, Elizabeth White, Michael Meiner, Michael Bushong, Avi Rosenthal

Related Topics: Weblogic

Weblogic: Article

Creating Web Services

Use your existing WSDL to generate a Service Control

You can create a Java Page Flow application in BEA WebLogic Workshop that utilizes a Service control generated from a Web service.

This article uses the example of an external Web service listed on the XMethods.net site. We will import the WSDL for the Web service into BEA WebLogic Workshop and see the custom Service control that is generated. We will then consume this control within a simple Page Flow application. We can also create a sample JWS file that allows you to quickly test the control.

Getting the WSDL File from XMethods.net
Visit the XMethods.net site. It lists a number of Web services. My example uses the "Dead Or Alive" Web service. The description (taken right from the listing) is, "includes methods to search the DeadOrAlive database by name, and search for people born on or died on a date (dd/mm). Also a method to get today's birthdays."

According to the listing, this Web service runs on .NET technology. The URL to the WSDL is www.abundanttech.com/webservices/deadoralive/deadoralive.wsdl.

There is a link to this WSDL from the Web service listing on the XMethods site. Feel free to use another Web service from that site as you apply this article. You will need the URL to the WSDL file to create the Service control. Or, you can download the WSDL file to your local machine and import it into the Workshop environment. However, in general that is not a good idea as you will not know if the WSDL changes in the future.

Starting WebLogic Workshop
The next step is to set up BEA WebLogic Workshop. I assume that you have basic familiarity with the tool and have the latest release of BEA WebLogic Platform 8.1 installed. If not, you will need to download and install that from the BEA Web site. Launch Workshop and create a new application. Within the application create a new Web project.

Generating the Service Control from the WSDL File/URI
Create a folder in which to store this control. In my example, I named the folder "ServiceControls". Now, create a new Java control and then select Web services. The wizard will prompt you to name the control. Give your control a name like "DeadOrAliveCtrl". The next step is to enter the URI for the Web service. You can point to the URI or to a local copy of the WSDL file. That's it. You're done. WebLogic Workshop will generate a control that consumes this Web service. Figure 1 shows the Service control that is generated for you. If you are interested in it, click the source tab to see the source code.

 

If you have a different Web service as an example, you will see the corresponding control. The same applies if you want to leverage any other Web service, such as the Amazon.com or Google.com Web services within WebLogic Workshop.

You can now use this control as part of any other WebLogic Workshop application. For this article, we will generate a Java Page Flow from this control. Since this is an automated step, it is a quick and easy way to test the consumption of the Web service and the control generated by Workshop.

Generating a Java Page Flow
This is a one-step process. Right-click on your control and select "Generate Page Flow". Use the wizard to give your page flow a name such as "DeadOrAlive", or based on the Web service you selected. Figure 2 shows the generated Java Page Flow.

 

The Page Flow can be used to test your control. Click on the "Start" button from your debug menu. This will start an instance of the BEA WebLogic Server; build and deploy your application, and then load a test browser that allows you to test the operations. Play around a little bit and test the different operations that your control supports. Figure 3 shows the test browser.

 

One thing you will notice is that the results displayed are meaningless. By default, the index.jsp displays something like

[email protected]

for the results. This doesn't help much. You will need to change the Page Flow code to correct this problem.

Generating a Web Service from the Service Control
Another quick way of testing your control is to use the "Generate Test JWS file" option. This option is available by right-clicking on the control and will generate a simple Web service. Once you have generated the JWS file, select it and then click on "Start" from the Debug menu. This will once again bring up the test browser with the Web service. Click on "Start TestDrive" and then "Continue this conversation". This is like a handshake between the Web services and now you can execute operations on the Web service you are consuming, from your Web service (see Figure 4).

 

Summary
In this article I showed you how BEA WebLogic Workshop can be used to consume Web services that are running on other machines. All you need to know is the location of the WSDL file. From that, Workshop can generate everything you need to consume that Web service, in a matter of minutes. This shows you the power, not only of BEA WebLogic Workshop, but of Web services, which enable tools such as Workshop to automate and provide this capability.

References

  • Workshop Help: http://edocs.bea.com/workshop/docs81/doc/en/core
  • More Stories By Kunal Mittal

    Kunal Mittal is a consultant for implementation and strategy for Web services and services-oriented architectures. He has co-authored and contributed to several books on Java, WebLogic and Web services.

    Comments (0)

    Share your thoughts on this story.

    Add your comment
    You must be signed in to add a comment. Sign-in | Register

    In accordance with our Comment Policy, we encourage comments that are on topic, relevant and to-the-point. We will remove comments that include profanity, personal attacks, racial slurs, threats of violence, or other inappropriate material that violates our Terms and Conditions, and will block users who make repeated violations. We ask all readers to expect diversity of opinion and to treat one another with dignity and respect.


    @ThingsExpo Stories
    Join IBM November 1 at 21st Cloud Expo at the Santa Clara Convention Center in Santa Clara, CA, and learn how IBM Watson can bring cognitive services and AI to intelligent, unmanned systems. Cognitive analysis impacts today’s systems with unparalleled ability that were previously available only to manned, back-end operations. Thanks to cloud processing, IBM Watson can bring cognitive services and AI to intelligent, unmanned systems. Imagine a robot vacuum that becomes your personal assistant th...
    SYS-CON Events announced today that Avere Systems, a leading provider of hybrid cloud enablement solutions, will exhibit at SYS-CON's 21st International Cloud Expo®, which will take place on Oct 31 – Nov 2, 2017, at the Santa Clara Convention Center in Santa Clara, CA. Avere Systems was created by file systems experts determined to reinvent storage by changing the way enterprises thought about and bought storage resources. With decades of experience behind the company’s founders, Avere got its ...
    SYS-CON Events announced today that Golden Gate University will exhibit at SYS-CON's 21st International Cloud Expo®, which will take place on Oct 31 – Nov 2, 2017, at the Santa Clara Convention Center in Santa Clara, CA. Since 1901, non-profit Golden Gate University (GGU) has been helping adults achieve their professional goals by providing high quality, practice-based undergraduate and graduate educational programs in law, taxation, business and related professions. Many of its courses are taug...
    SYS-CON Events announced today that SIGMA Corporation will exhibit at the Japan External Trade Organization (JETRO) Pavilion at SYS-CON's 21st International Cloud Expo®, which will take place on Oct 31 – Nov 2, 2017, at the Santa Clara Convention Center in Santa Clara, CA. uLaser flow inspection device from the Japanese top share to Global Standard! Then, make the best use of data to flip to next page. For more information, visit http://www.sigma-k.co.jp/en/.
    High-velocity engineering teams are applying not only continuous delivery processes, but also lessons in experimentation from established leaders like Amazon, Netflix, and Facebook. These companies have made experimentation a foundation for their release processes, allowing them to try out major feature releases and redesigns within smaller groups before making them broadly available. In his session at 21st Cloud Expo, Brian Lucas, Senior Staff Engineer at Optimizely, will discuss how by using...
    In this strange new world where more and more power is drawn from business technology, companies are effectively straddling two paths on the road to innovation and transformation into digital enterprises. The first path is the heritage trail – with “legacy” technology forming the background. Here, extant technologies are transformed by core IT teams to provide more API-driven approaches. Legacy systems can restrict companies that are transitioning into digital enterprises. To truly become a lead...
    SYS-CON Events announced today that CAST Software will exhibit at SYS-CON's 21st International Cloud Expo®, which will take place on Oct 31 - Nov 2, 2017, at the Santa Clara Convention Center in Santa Clara, CA. CAST was founded more than 25 years ago to make the invisible visible. Built around the idea that even the best analytics on the market still leave blind spots for technical teams looking to deliver better software and prevent outages, CAST provides the software intelligence that matter ...
    SYS-CON Events announced today that Daiya Industry will exhibit at the Japanese Pavilion at SYS-CON's 21st International Cloud Expo®, which will take place on Oct 31 – Nov 2, 2017, at the Santa Clara Convention Center in Santa Clara, CA. Ruby Development Inc. builds new services in short period of time and provides a continuous support of those services based on Ruby on Rails. For more information, please visit https://github.com/RubyDevInc.
    As businesses evolve, they need technology that is simple to help them succeed today and flexible enough to help them build for tomorrow. Chrome is fit for the workplace of the future — providing a secure, consistent user experience across a range of devices that can be used anywhere. In her session at 21st Cloud Expo, Vidya Nagarajan, a Senior Product Manager at Google, will take a look at various options as to how ChromeOS can be leveraged to interact with people on the devices, and formats th...
    SYS-CON Events announced today that Yuasa System will exhibit at the Japan External Trade Organization (JETRO) Pavilion at SYS-CON's 21st International Cloud Expo®, which will take place on Oct 31 – Nov 2, 2017, at the Santa Clara Convention Center in Santa Clara, CA. Yuasa System is introducing a multi-purpose endurance testing system for flexible displays, OLED devices, flexible substrates, flat cables, and films in smartphones, wearables, automobiles, and healthcare.
    SYS-CON Events announced today that Taica will exhibit at the Japan External Trade Organization (JETRO) Pavilion at SYS-CON's 21st International Cloud Expo®, which will take place on Oct 31 – Nov 2, 2017, at the Santa Clara Convention Center in Santa Clara, CA. Taica manufacturers Alpha-GEL brand silicone components and materials, which maintain outstanding performance over a wide temperature range -40C to +200C. For more information, visit http://www.taica.co.jp/english/.
    SYS-CON Events announced today that SourceForge has been named “Media Sponsor” of SYS-CON's 21st International Cloud Expo, which will take place on Oct 31 – Nov 2, 2017, at the Santa Clara Convention Center in Santa Clara, CA. SourceForge is the largest, most trusted destination for Open Source Software development, collaboration, discovery and download on the web serving over 32 million viewers, 150 million downloads and over 460,000 active development projects each and every month.
    SYS-CON Events announced today that Nihon Micron will exhibit at the Japan External Trade Organization (JETRO) Pavilion at SYS-CON's 21st International Cloud Expo®, which will take place on Oct 31 – Nov 2, 2017, at the Santa Clara Convention Center in Santa Clara, CA. Nihon Micron Co., Ltd. strives for technological innovation to establish high-density, high-precision processing technology for providing printed circuit board and metal mount RFID tags used for communication devices. For more inf...
    Enterprises have taken advantage of IoT to achieve important revenue and cost advantages. What is less apparent is how incumbent enterprises operating at scale have, following success with IoT, built analytic, operations management and software development capabilities – ranging from autonomous vehicles to manageable robotics installations. They have embraced these capabilities as if they were Silicon Valley startups. As a result, many firms employ new business models that place enormous impor...
    SYS-CON Events announced today that MIRAI Inc. will exhibit at the Japan External Trade Organization (JETRO) Pavilion at SYS-CON's 21st International Cloud Expo®, which will take place on Oct 31 – Nov 2, 2017, at the Santa Clara Convention Center in Santa Clara, CA. MIRAI Inc. are IT consultants from the public sector whose mission is to solve social issues by technology and innovation and to create a meaningful future for people.
    Widespread fragmentation is stalling the growth of the IIoT and making it difficult for partners to work together. The number of software platforms, apps, hardware and connectivity standards is creating paralysis among businesses that are afraid of being locked into a solution. EdgeX Foundry is unifying the community around a common IoT edge framework and an ecosystem of interoperable components.
    SYS-CON Events announced today that Dasher Technologies will exhibit at SYS-CON's 21st International Cloud Expo®, which will take place on Oct 31 - Nov 2, 2017, at the Santa Clara Convention Center in Santa Clara, CA. Dasher Technologies, Inc. ® is a premier IT solution provider that delivers expert technical resources along with trusted account executives to architect and deliver complete IT solutions and services to help our clients execute their goals, plans and objectives. Since 1999, we'v...
    SYS-CON Events announced today that TidalScale, a leading provider of systems and services, will exhibit at SYS-CON's 21st International Cloud Expo®, which will take place on Oct 31 - Nov 2, 2017, at the Santa Clara Convention Center in Santa Clara, CA. TidalScale has been involved in shaping the computing landscape. They've designed, developed and deployed some of the most important and successful systems and services in the history of the computing industry - internet, Ethernet, operating s...
    SYS-CON Events announced today that Massive Networks, that helps your business operate seamlessly with fast, reliable, and secure internet and network solutions, has been named "Exhibitor" of SYS-CON's 21st International Cloud Expo ®, which will take place on Oct 31 - Nov 2, 2017, at the Santa Clara Convention Center in Santa Clara, CA. As a premier telecommunications provider, Massive Networks is headquartered out of Louisville, Colorado. With years of experience under their belt, their team of...
    SYS-CON Events announced today that IBM has been named “Diamond Sponsor” of SYS-CON's 21st Cloud Expo, which will take place on October 31 through November 2nd 2017 at the Santa Clara Convention Center in Santa Clara, California.