Filtering SOAP attachments is something which is a very common feature implemented on a
Gateway such as the Vordel Gateway. Here is a step-by-step guide to how to set this up:
If you've already registered a WSDL, skip forward to step 4.
Step 1: Open the Vordel Policy Studio. Connect to the Gateway you wish to configure your policy on. Either connect directly or login through Policy Director (which allows you to push configuration to multiple Gateways at once).
Once you connect, choose "Edit Active Configuration".
You will see the screen below. New Web Services are registered in the "Web Service Repository" which is accessed under the "Policies" group on the left-hand-side.
Step 2: Right-click on the "Web Service Repository" and choose "Register Web Service". Note that the Web Services are arranged in groups, and you can rename these groups.
Step 3: Select your WSDL (either via URL, file, or UDDI) and then walk through the wizard. Choose the location to deploy your virtualized service. Out of the box, there is a set of services called "Default Services" on port 8080 in the Vordel Gateway, but you can rename this or change the port. You can also add a new service group (e.g. called "SSL Services") with a different listening interface, such as SSL (create the new services, then right-click and choose "Add interface"). You can even add a JMS listener, or a file folder scanner.
Don't check the box right now to "Secure this Web Service". You'll then see a "Summary" screen in the wizard, which says what path the Virtual Service has been deployed on. Take note of this path. Press OK and then press the "Deploy" button on Policy Studio to deploy. Now open the WSDL in the browser. Note that
the Vordel Gateway will automatically virtualize the service hostname in the WSDL.
Step 4: Right-click on "Policies" in the Vordel Studio and select "Add Policy". If you already have created a contained to contain your policies, you can right-click on your container and make your policy there. Note that containers are a way to group policies together, e.g. for importing and exporting them together, but don't affect the running of the policies.
Call your new policy "Filter Attachments"
Step 5. Drag in a "Content Type" filter, which you can find in the "Content Filtering" group. We are filtering the message based on its content type. Configure it as shown in the screenshot below, where only XML and PDFs are allowed (i.e. a SOAP/XML message with a PDF attachment).

Note that you must have "multipart/*" selected also, because that is used by the SOAP-with-Attachments standard to deliniate attachments. If you have not got this selected, all SOAP attachments will be blocked (note: this may be intended in some use cases).
When you drag in the filter on to the policy canvas, it is initially gray because it is not being used yet. Right-click on this filter and choose "Set as start". Now it is no longer grayed out. However, it is outlined in red because it requires an input (the message itself) which it is not getting at the moment. For it to get this input, it must be "wired up" to policy that is receiving a message through a listening interface.
Step 6: In Policy Studio, look under "Policies" and then "Generated Circuits" to find the service you've registered in Step 3. Double-click on the filter called "Service Handler for '
'. Then open the "Message Interception Points" tab. Under "Before Operation-specific Policy" press on the "..." button to choose the policy you made in step 5 to filter attachments. Once it is mapped, you should see the mapping set as in the screenshot below.

Make sure you press the "Deploy" button on the Studio toolbar to deploy this policy.
Step 7: Open SOAPbox (grab your free copy from Vordel). We will be using SOAPbox to test our attachments policy. Open the Virtual Service WSDL which you obtained from Step 3. [Tip: The Service Manager interface, under :8090/ , also allows you to see the Virtual Service WSDL, if you connect with a role which allows you to use Service Manager]. In SOAPbox, press on the import WSDL and import the Virtualized WSDL (note: not the actual WSDL from the back-end service you've registered, otherwise you'll simply send your messages to the back-end services and not through the Vordel Gateway).
Step 8: You'll see a sample message created for you in SOAPbox. Click on the "Attachments" tab on the botton of SOAPbox
. Choose to add an attachment which is not allowed (i.e. something other than a PDF, since in Step 5 you chose that a PDF was the only allowable attachment. Send the message through to the Vordel Gateway in SOAPbox, by pressing the green triangular "play" button. These steps are shown in below.

The message will be blocked. Note that you can customize the response message, since in a production system it is not usual to return a SOAP Fault to clients.
Step 9: View the blocked message in the Vordel Gateway's Real-Time Monitoring by pointing a browser to :8090/ and then clicking on "Real-Time Monitoring". Note that you'll have to login as a user with a role which allows viewing of Real-Time Monitoring (e.g. an "operator" or "auditor" role):
Step 10: Import the WSDL into SOAPbox and send it through the Gateway without the SOAP Attachment. Note that SOAPbox
allows you to have multiple messages saved, which you can see if you click on the small down-arrow button beside the green "play" button, and choose "Request Settings".
Other steps: Note that the Vordel Gateway includes a filter called "Remove Attachment" which you can use to remove attachments. You may use it similar to the process outlined above. In addition, the Message Size filter will block large messages based on (optionally) attachments as well as the message itself.