Working With the eMail Binding Component WSDL Document
The WSDL document defines an eMail interface for the project. You create and
configure the WSDL document using the New WSDL Wizard, and you can further
configure the interface using the WSDL Editor in NetBeans.
The following topics provides instructions for working with the WSDL document for the
eMail BC:
Creating the eMail BC WSDL Document
The following topics provide instructions for creating email WSDL documents for reading and
sending email messages under different protocols.
For information about the fields you need to fill in on the New
WSDL Wizard, see New WSDL Wizard Properties for the eMail BC.
To Create a WSDL Document to Read email (IMAP or POP3)
- In the NetBeans Projects window, right-click the project or a folder within the
project where you want to add the WSDL document.
- Point to New and then select WSDL Document.
The New WSDL Document Wizard appears.
- Enter a name for the WSDL document, and verify or update the folder
location for the file.
- Select Concrete WSDL Document.
The Binding and Type fields appear.
- For the Binding, select EMAIL; for the Type, do one of the following:
- If your email server uses IMAP, select Read Email (using IMAP).
- If your email server uses POP3, select Read Email (using POP3).
- Click Next.
The IMAP Settings or POP3 Settings window appears.
- Fill in the settings according to your email client's IMAP or POP3 server.
For information about these fields, see New WSDL Wizard Properties for the eMail BC.
- After you enter the email server connection information, click Test Credentials to be
sure you can connect to the server.
- On the New WSDL Document Wizard, click Finish.
To Create a WSDL Document to Send email (SMTP)
- In the NetBeans Projects window, right-click the project or a folder within the
project where you want to add the WSDL document.
- Point to New and then select WSDL Document.
The New WSDL Document Wizard appears.
- Enter a name for the WSDL document, and verify or update the folder
location for the file.
- Select Concrete WSDL Document.
The Binding and Type fields appear.
- For the Binding, select EMAIL; for the Type, select Send Email (using SMTP).
- Click Next.
The SMTP Settings window appears.
- For the Mail To field, click “mailto:” fields, and, in the dialog that
appears, enter the email addresses and email subject for the email messages sent
by the eMail Binding Component.
- Fill in the remaining settings according to your email client's SMTP server.
For information about the SMTP Settings fields, see New WSDL Wizard Properties for the eMail BC.
Note - When you select different message types, the available Payload Processing fields change to
accommodate the type.
- If you select a message type of XML or encoded data, you need
to specify the element or type to use. Click the ellipsis button to
display a list of options to select from.
- If you select a message type of encoded data, you need to specify
the encoding style used; for example, hl7encoder-1.0 for HL7 encoding, customencoder-1.0 for a
custom encoding, or cocoencoder-1.0 for COBOL Copybook encoding.
- After you enter the email server connection information, click Test Credentials to be
sure you can connect to the server.
- On the New WSDL Document Wizard, click Finish.
New WSDL Wizard Properties for the eMail BC
The following tables list and describe the read and send properties for the
eMail BC. These properties are accessed from the protocol settings page of the
New WSDL Wizard.
Table 1 Read email Settings (POP3 and IMAP)
|
|
Email Server |
The name of the computer that hosts the email
server from which you want to read email messages. |
Port |
The port number of the
email server. |
User Name |
The user name to use to connect to the email
server. |
Password |
The password that corresponds to the user name entered above. |
Authentication |
An indicator of
whether to use SSL authentication. Select the check box to use SSL; otherwise
leave it deselected. |
Polling Interval |
The time period (in milliseconds) the eMail BC will
wait between polling for new incoming email messages. |
Mail Folder |
The name of the email
folder from which to read messages. |
Maximum Message Count |
The maximum number of messages
to return from the email server. |
Message Ack Mode |
An indicator of how the
message acknowledgement is handled based on the response from the Normalized Message Router
(NMR). Choose either automatic or manual. When the method is automatic, you need
to select an operation to perform. |
Message Ack Operation |
The type of operation to perform
on the incoming email messages upon message acknowledgement. Select either markAsRead or delete. |
Attachments
Directory |
A local directory where you want to store any attachments from the incoming
email messages being processed. The file name is derived from the attachment name. |
|
Table 2 Send email Settings (SMTP)
|
|
Mail
To |
The recipients of email messages sent from the eMail Binding Component. This field
uses the standard mailto URL scheme (RFC 2368). Special characters must be encoded
(see RFC 2368 and RFC 1378). The corresponding message parts (if any) take
precedence over location headers. |
SMTP Server |
The name of the email server for sending email
messages. |
Port |
The port number of the email server for sending email messages. This property
is optional. |
User Name |
The user name to use to connect to the email
server. |
Password |
The password that corresponds to the user name entered above. |
Use SSL |
An indicator
of whether to use SSL authentication. Select the check box to use SSL;
otherwise leave it deselected. |
Message Type |
The type of message being processed. Select one
of the following options:
text
binary
xml
encoded data
|
Character Encoding |
The encoding to use for body and header text.
Select the encoding type from the list of available options. This setting only
appears when the Message Type is text. |
Send Option |
The format of the email content.
Select one of the following options:
Text Only
HTML Only
XML Only
Both Text and HTML
Both Text and XML
|
Image Handling |
An indicator of whether images are resolved
and embedded in an HTML document (with the tag <img src="absolute_URL_to_image">. The URL must
be the absolute URL in order to be embedded. This setting only appears when
the Send Option is HTML or Both Text and HTML. |
XSD Element/Type |
The element or
type from the schema definition (XSD) for XML or encoded data. Click the
ellipsis button to select from a list of elements and types. Note that
for encoded data, you must select an element and not a type. This setting
only appears when the Message Type is xml or encoded data. |
Encoding Style |
The encoding
style to use. This field only appears when the Message Type is encoded
data. |
Normalized Message Attachments |
An indicator of whether normalized message attachments are included with the
email as message attachments. Select the check box to include them as message
attachments; otherwise leave the check box deselected. |
|
Configuring eMail BC WSDL Attributes
Once you create the eMail BC WSDL document, you can add and update
the WSDL attributes that are specific to the email configuration. The eMail BC
includes both service-level WSDL elements and binding-level WSDL elements.
Perform the following tasks to configure the eMail Binding Component WSDL file after
it is generated by the wizard.
To Configure eMail BC WSDL Attributes
- In the NetBeans IDE, double-click the WSDL document you want to configure.
The document appears in the WSDL Editor in WSDL view.
- To configure binding-level attributes, do the following:
- Expand the Bindings node, the binding name, the operation, and then the input.
- Click the email:* node.
The name of this node begins with “email:” and the rest varies depending
on the type of protocol and whether it is receiving or sending. A
list of properties appears in the right panel.
- Modify the value of any of the properties.
For more information about these properties, see Receiving eMail BC Attributes.
- In the NetBeans toolbar, click Save.
- To configure service attributes, do the following:
- Expand the Services node, the service name, and then the service port.
- Click on the email address node.
The name of this node varies depending on the type of protocol. A
list of properties appears in the right panel.
- Modify the value of any of the properties.
For more information about these properties, see Sending eMail BC Attributes.
- In the NetBeans toolbar, click Save.
To Send email Messages with Attachments
- In the NetBeans IDE, double-click the WSDL document you want to configure.
The document appears in the WSDL Editor in WSDL view.
- Expand the Bindings node, the binding name, the operation, and then the input.
- Right-click the email:* node, and select Add SMTPattachment.
The name of the email: node varies depending on the type of protocol
and whether it is receiving or sending.
- In the Properties Panel on the right, enter values for the attachment properties.
For more information about these properties, see Table 7.
eMail Binding and Service Level WSDL Attributes
The service-level WSDL elements and attributes define connectivity to the email server along
with certain processing information. The binding-level WSDL elements and attributes define and configure
the operation performed along with information about the email messages and content.
Receiving eMail BC Attributes
The eMail Binding Component binding-level WSDL elements include the binding and services extensibility
elements. When you create a WSDL file in the NetBeans IDE, the New
WSDL Wizard generates both the binding element and the service elements based on
information you supplied in the wizard.
For receiving email messages, the binding element defines where to find specific information
in the incoming message and how to handle attachments. The binding element also
specifies that the WSDL document is configured for an email server and also
indicates the protocol. The service element defines connectivity information, such as the server name,
port number, and user authentication. It also defines how often to check for
messages, how many messages to poll, and how to handle acknowledgements.
Table 3 Binding–Level Attributes for Receiving email Messages
|
|
message |
The name of
the message part that contains the body of the email. |
subject |
The name of
the message part that contains the subject line of the email. |
from |
The name of
the message part that contains the email address of the sender. |
to |
The name of
the message part that contains the list of email addresses of the recipients. |
cc |
The
name of the message part that contains the list of recipients who are
copied on the email. |
bcc |
The name of the message part that contains the
list of recipients who are blind copied on the email. |
newsgroups |
The name of the
message part that contains the names of recipient news groups. |
saveAttachmentsToDir |
A local directory where
you want to store any attachments from the incoming email messages being processed.
Attachments are only saved if this property is defined. The file name is
derived from the attachment name. |
|
The following example illustrates the binding element for receiving email messages from an
IMAP server:
<binding name="wsdlEmailBinding" type="tns:wsdlEmailPortType">
<email:IMAPbinding/>
<operation name="ReceiveEmails">
<email:IMAPoperation/>
<input name="input1">
<email:IMAPinput
message="message"
subject="subject"
from="sender"
to="recipients"
saveAttachmentsToDir="C:\EmailProject\email\attachments"/>
</input>
</operation>
</binding>
Table 4 Service–Level Attributes for Receiving email Messages
|
|
emailServer |
The name of the computer that hosts the email server from
which you want to read email messages. |
port |
The port number of the server. |
userName |
The user
name to use to connect to the email server. |
password |
The password that corresponds
to the user name entered above. |
useSSL |
An indicator of whether to use SSL
authentication. Specify true to use SSL; otherwise specify false. |
mailFolder |
The name of the email
folder from which to read messages. |
maxMessageCount |
The maximum number of messages to return
from the email server. |
messageAckMode |
An indicator of how the message acknowledgement is handled
based on the response from the Normalized Message Router (NMR). Choose either automatic or
manual. When the method is automatic, you need to select an operation to
perform. |
messageAckOperation |
The type of operation to perform on the incoming email messages upon message
acknowledgement. Select either markAsRead or delete. |
pollingInterval |
The time period (in milliseconds) the eMail
BC will wait between polling for new incoming email messages. |
|
The following example illustrates the service element for receiving email messages from an
IMAP server:
<service name="wsdlEmailService">
<port name="wsdlEmailPort" binding="tns:wsdlEmailBinding">
<email:IMAPaddress
emailServer="email.mycompany.com"
useSSL="true"
port="994"
userName="gsmythe@mycompany.com"
password="1qazMKO"
mailFolder="Inbox"
maxMessageCount="50"
messageAckMode="automatic"
messageAckOperation="markAsUnread"
pollingInterval="1000"/>
</port>
</service>
Sending eMail BC Attributes
The sending eMail Binding Component binding-level WSDL elements include the binding and services
extensibility elements. The eMail binding extensibility element specifies that the WSDL document is configured
for an email server and also indicates the protocol. When you create a
WSDL file in the NetBeans IDE, the New WSDL Wizard generates both the
binding element and the service elements based on information you supplied in the
wizard.
For sending email messages, the binding element defines where to find specific information
in the incoming message, encoding options, character sets, and how to handle attachments
and images. The service element defines connectivity information, such as the server name, port
number, and user authentication.
Table 5 Binding–Level Attributes for Sending email Messages
|
|
message |
The name of the message part that contains the
body of the email. |
subject |
The name of the message part that contains the
subject line of the email. |
from |
The name of the message part that contains the
email address of the sender. |
to |
The name of the message part that contains the
list of email addresses of the recipients. |
cc |
The name of the message part that
contains the list of recipients who are copied on the email. |
bcc |
The name of
the message part that contains the list of recipients who are blind copied
on the email. |
newsgroups |
The name of the message part that contains the names
of recipient news groups. |
charset |
The encoding to use for body and header text. This
setting is only applicable when the message type is next. |
use |
Either literal or encoded. |
encodingStyle |
The
encoding style to use. Only use this property when the use property is
set to encoded. |
sendOption |
The format of the email content. Select one of the
following options:
Text Only
HTML Only
XML Only
Both Text and HTML
Both Text and XML
|
embedImagedInHTML |
An indicator of whether images are resolved and embedded in an HTML document
(with the tag <img src="absolute_URL_to_image">. The URL must be the absolute URL in
order to be embedded. Only use this property when the sendOption is HTML or
Both Text and HTML. |
|
An indicator of whether normalized message attachments are included with the
email as message attachments. Select the true to include them as message attachments;
otherwise select false. |
|
The following example illustrates the binding element for sending email messages from an
SMTP server:
<binding name="wsdlSendEmailBinding" type="tns:wsdlSendEmailPortType">
<email:SMTPbinding/>
<operation name="SendEmail">
<email:SMTPoperation
<input name="input1">
<email:SMTPinput
message="message"
subject="subject"
from="sender"
to="recipients"
charset="Big5"
use="literal"
sendOption="Text Only"
handleNMAttachments="true"/>
</input>
</operation>
</binding>
Table 6 eMail BC Send WSDL Service Attributes
|
|
location |
The recipients of email messages sent from the eMail Binding Component. This
field uses the standard mailto URL scheme (RFC 2368). Special characters must be
encoded (see RFC 2368 and RFC 1378). The corresponding message parts (if any)
take precedence over location headers. |
emailServer |
The name of the email server for sending email
messages. |
port |
The port number for the email server. |
userName |
The user name to use to
connect to the email server. |
password |
The password that corresponds to the user name
entered above. |
useSSL |
An indicator of whether to use SSL authentication. Specify trueto use
SSL; otherwise specify false. |
|
The following example illustrates the service element for sending email messages from an
SMTP server:
<service name="wsdlSendEmailService">
<port name="wsdlSendEmailPort" binding="tns:wsdlSendEmailBinding">
<email:SMTPaddress
emailServer="email.mycompany.com"
location="mailto:msharpe@mycompany.com?subject=Response+from+JBI&
cc=tmiller@mycompany.com"
useSSL="true"
port="465"
userName="gsmythe@mycompany.com"
password="1qazMKO"
</port>
</service>
Table 7 eMail BC SMTP Attachment WSDL Attributes
|
|
attachmentContentPart |
The name of the message part that contains the attachment content. Select
from the following options:
If both the attachmentContentPart and readFromFile attributes are defined,
the attachmentContentPart takes precedence. |
attachmentFileNamePart |
The part of the message to use to name
the attachment file. If no value is specified, then the value of the
attachmentContentPart property is used for the file name. |
readFromFile |
The name of the file
that contains the attachment content. If a value is specified for the attachmentContentPart, it
overrides the value specified here. |
contentType |
The type of content in the attachment. It
might be useful for the receiver to know what type of content is
contained in the attachment in order to read it. Example of content types
are text/html, message/rfc822, text/plain;charset=UTF-8, and so on. If the content type is invalid, unknown,
or empty, the content is treated as application/octet-stream. |
disposition |
The disposition of the attachment
in the content. Select either ATTACHMENT or INLINE. |
|
The following example illustrates the binding element with the SMTP attachment configuration:
<binding name="wsdlSendEmailBinding" type="tns:wsdlSendEmailPortType">
<email:SMTPbinding/>
<operation name="SendEmail">
<email:SMTPoperation
<input name="input1">
<email:SMTPinput
message="message"
subject="subject"
from="sender"
to="recipients"
charset="Big5"
use="literal"
sendOption="Text Only"
handleNMAttachments="true">
<email:SMTPattachment attachmentContentPart="message"
attachmentFileNamePart="subject"
disposition="ATTACHMENT"/>
</email:SMTPinput>
</input>
</operation>
</binding>