Show TOC Start of Content Area

Procedure documentation Creating a Web Service with Attachments  Locate the document in its SAP Library structure

Use

This section describes how you add an attachment to your Web service.

Caution

Only String and byte[] type parameters are supported for sending as attachments.

Prerequisites

·        EJB Module Project

·        Service Endpoint implementation

·        VI and WSD files for the endpoint

Procedure

...

       1.      Select the EJB Module project and choose New Web Service Deployment Descriptor from the context menu. 

This graphic is explained in the accompanying text

       2.      In the window that is displayed on the right, select Web Service Configurations and choose Add.

This graphic is explained in the accompanying text

       3.      Enter the required information for creating your Web service and choose Finish.

This graphic is explained in the accompanying text

       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.

This graphic is explained in the accompanying text

       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

This graphic is explained in the accompanying text

       6.      Choose Save.

End of Content Area