Professional InfoPath 2003 [Electronic resources] نسخه متنی

اینجــــا یک کتابخانه دیجیتالی است

با بیش از 100000 منبع الکترونیکی رایگان به زبان فارسی ، عربی و انگلیسی

Professional InfoPath 2003 [Electronic resources] - نسخه متنی

Ian Williams, Pierre Greborio

| نمايش فراداده ، افزودن یک نقد و بررسی
افزودن به کتابخانه شخصی
ارسال به دوستان
جستجو در متن کتاب
بیشتر
تنظیمات قلم

فونت

اندازه قلم

+ - پیش فرض

حالت نمایش

روز نیمروز شب
جستجو در لغت نامه
بیشتر
توضیحات
افزودن یادداشت جدید











Integrating with Web Services

There are several scenarios where you don’t have direct access to the database. When you are working on extranet and intranet environments, you can’t have direct access for security reasons. To solve this problem, you could send and receive data forms to and from the company through one or more Web services. This isn’t the only solution available, as you will see later in the chapter, but it’s certainly the most flexible, thanks to the flexibility of Web services technology.

As for the database situation, you can design an InfoPath form from a WSDL (Web Service Description Language), which is normally produced by the back-end developers or tools. For example, if you want to use a Microsoft AS.NET Web Service, you can get its WSDL specification referring to the Web Service URL by adding ?WSDL as postfix, such as [http://myserver/myservice.asmx?WSDL]. The WSDL is important because it contains the XML schema of the data exchanged between the client (InfoPath) and the server.


WSDL is a specification defined by W3C that describes how a Web service is callable. The document is divided in several sections; one of these is the XML schema of the data sent and received by the Web method.


There are two ways that you can approach Web service integration:



Design a form from a WSDL.



Design the form and attach the data source to the Web service later.



In both cases the data source structure (and data types) must follow the XML schema defined into WSDL. First you’ll see how to design an InfoPath form starting from a Web service.

When you select Web Service from the Data Source Setup Wizard (see Figure 7-9), you have to load the WSDL source (see Figure 7-10).


Figure 7-9: Data source selection.


Figure 7-10: WSDL selection.

The WSDL can be loaded from the file system as well as from the Web (HTTP connection). A third possibility is to query a UDDI (Universal Description, Discovery, and Integration) repository. UDDI is something like a yellow pages for Web services.

When you selected the WSDL source, the wizard provides a list of functions (formerly operations) available from the selected Web service, as shown in Figure 7-11.


Figure 7-11: Web Service operation selection.

As a last step, the wizard creates the data source based on the parameter list of the operation selected. The design of the form is then similar to that shown in this book (see Figure 7-12).


Figure 7-12: InfoPath form integrated with a Web service.


The template is then bound to the Web service, and each time the user submits the data form, it will be sent to the Web service automatically. There are situations where you don’t have the WSDL available when you start to design the form; in this case, you need to attach the Web service later. InfoPath provides an easy way to bind an existing template to a Web service. You have to select ToolsSubmitting Forms . . . . A new dialog box appears (see Figure 7-13).


Figure 7-13: Submitting Forms dialog box.

If you enable Submit and select the Web service item, InfoPath will propose the same Web service wizard as shown in Figure 7-10. There is only one added step in the wizard where you have to map the InfoPath data source fields with the Web service parameters (see Figure 7-14).


Figure 7-14: Data mapping dialog box.

After that, the template will be bound to the Web service as explained previously. The design process seen in this section is simple, since InfoPath hides all binding complexities needed to attach a general-purpose form to a Web service.

/ 166