Web Services Connections

Previous  Home topic  Next  Print this topic Send Feedback

Jump to a Section

Web Services Connections

Crossdomain.xml

Calling Web Services Directly Via Proxy

Direct Web Service Calls

Proxy Web Service Calls

SOAP Headers

 

 

 

Web Services Connections

 

Unlike databases, text files, directory services and forms, Web Service connections do not go via the connection agent. Forms call the Web Service in one of two ways:

 

Directly from the browser
Via a Web service proxy on the PerfectForms™ server

 

Calling the Web Service directly is a little faster than via the proxy but it has some drawbacks and may not run at all in many cases. Because a PerfectForms™ form is a Flash component, Flash uses a security method that prevents data exchange with systems that do not have a special file called crossdomain.xml installed in the root folder of the Web Service URL being called.

 

Many public Web Services may not provide crossdomain.xml support and so you may be better of using the Use Proxy option in the Details section of the connection details.

 

By default, the URL encode params check box will be checked which ensures any data sent to the Web Service is properly encoded.

 

 

Crossdomain.xml

 

Due to the security measures that Flash imposes if your form needs to access data from a Web Service that is not located on the PerfectForms™ server, you need to install a file called crossdomain.xml in the root of that website. This file contains a list of domains that have permission to request data from that site. Many public Web Services may not have installed the crossdomain.xml file.

 

Below are two sample crossdomain.xml files.

 

<?xml version="1.0"?>

 

<!DOCTYPE cross-domain-policy SYSTEM "http://www.macromedia.com/sml/dtds/cross-domain-policy.dtd">

<cross-domain-policy>

   <allow-access-from domain="www.perfectforms.com" />

</cross-domain-policy>

 

<!DOCTYPE cross-domain-policy SYSTEM "http://www.macromedia.com/xml/dtds/cross-domain-policy.dtd">

<cross-domain-policy>

   <allow-access-from domain="*" /> (allows public access)

</cross-domain-policy>

 

 

Calling Web Services Directly or Via Proxy

 

When a form calls a Web Service, it is initiated from the browser. As a PerfectForms™ form is powered by Adobe Flash, the Web Services call is made by Flash. Flash incorporates a security feature which means that the call cannot actually run unless it finds a file named crossdomain.xml within the root directory of the URL being called.

 

 

Direct Web Service Calls

 

If you have full control of the Web Service then direct calls are the most efficient way of communicating with a Web Service. Please note you must place crossdomain.xml in the root folder of the site where the Web Service itself is located. Here are some examples.

 

<?xml version="1.0"?>

<!DOCTYPE cross-domain-policy SYSTEM "http://www.macromedia.com/xml/dtds/cross-domain-policy.dtd">

<cross-domain-policy>

    <allow-access-from domain="www.company.com" />

    <allow-access-from domain="company.com" />

</cross-domain-policy>

 

 

The following example allows access from any PerfectForms™ or other Flash-based component.

 

<?xml version="1.0"?>

<!DOCTYPE cross-domain-policy SYSTEM "http://www.macromedia.com/xml/dtds/cross-domain-policy.dtd">

<cross-domain-policy>

    <allow-access-from domain="*" />

</cross-domain-policy>

 

 

Proxy Web Service Calls

 

In many cases, you will not have any control over the Web Service you are calling and so you should select the Use Proxy check box when defining your Web Service action. This will ensure that the call is made through PerfectForms™ rather than directly to the Web Service.

 

 

SOAP Headers

 

Web Service connection communication enables you to include Send parameters in the header, instead of the body of the SOAP request.

 

The list of Send parameters is not automatically populated with Header parameters by querying the WSDL. They need to be added manually to the list and are differentiated from body parameters by adding a "*" character at the beginning of the name. For example,

 

*username

*password

 

 

Use of Namespaces in Send Parameters

 

In WebService Connection Actions it is possible to include namespaces in send parameters like this:

*wsse:Security[wsse=http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd]

*wsse:Security.Username

*wsse:Securtity.Password

 

Which results in a SOAP header like this:

 

<soap:Header xmlns:wsse=”http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd”>

               <wsse:Security>

                               < wsse:Username>…</ wsse:Username>

                               < wsse:Password>…</ wsse:Password>

               </ wsse:Security>

</soap:Header>

 

Syntax:

- Add namespace prefix before tag name, separated by “:”

- Define namespace by appending [<Prefix>=<URI>]   at the end of the parameter

- The namespace only needs to be defined once, for the first parameter which uses it, all following parameters can just refer to it using the prefix

Updated: 10/04/2012  Page url: http://www.perfectforms.com/Documentation/manual/html/?d_webservicesconnections.htm
PerfectForms™ -- forms software, workflow software, and business process management