This section describes how you add an attachment to your Web service.
Only String and byte[] type parameters are supported for sending as attachments.
· EJB Module Project
· Service Endpoint implementation
· VI and WSD files for the endpoint
...
1. Select the EJB Module project and choose New → Web Service Deployment Descriptor from the context menu.
2. In the window that is displayed on the right, select Web Service Configurations and choose Add.
3. Enter the required information for creating your Web service and choose Finish.
4. From the Web Service Configurations tree, select your Web service and choose Add to create a new WS configuration. In the dialog box, enter Configuration Name and from the Transport Binding menu, select HTTP SOAP with Attachments, and choose Finish.
5. Open the configuration that you have created and select Attachments.
On the right, there are tabs named after the bean methods. Depending on the methods’ parameters, Input and Output subtabs are displayed listing “in” and “out” parameters. If your methods contain only input parameters, then only the Input tab is displayed. If you want a certain parameter to be sent as an attachment, select the checkbox of that parameter.
a. In the Content Type field, enter the type of the attachment.
This value will be used in the WSDL as well as in the HTTP message. By default, for byte[] parameters this type is application/octetstream and for String parameters – text/plain.
b. In the Content Transfer Encoding field (available only for outgoing parameters), enter the encoding of the attachment data in the message returned by the server. By default, binary is used for byte[] and 8bit for String.
Configuring Incoming Parameter
6. Choose Save.