WCF is released in basichttpbinding mode ,. net is called according to the Web service method. The automatically generated proxy contains Enumeration type and nullable type parameters. Some differences are found in the proxy, both generate a paired xxspecified field and attribute. You must set this value to true. Otherwise, the corresponding Enumeration type or nullable type will be ignored during WCF serialization. All default values are used, and all values you assign will be ignored, only you can set xxspecified to true.
Code
[Testmethod]
Public Void Testasmxsendhtmlmail ()
{
Localhost. tencentemail mail = New Localhost. tencentemail ();
Mail. emailtype = Localhost. tencentmailtype. send_to_meeting;
Mail. emailtypespecified = True ;
Mail. = " Toby " ;
Mail. From = " Geffzhang " ;
Mail. CC = " Mouse " ;
Mail. bcc = " Geffzhang " ;
Mail. Title = " This's a test mail " ;
Mail. Content = " <H1> This's a test meeting mail. " ;
Mail. bodyformat = Localhost. tencentmailformat. html;
Mail. bodyformatspecified = True ;
Mail. Priority = Localhost. messagepriority. Hight;
Mail. priorityspecified = True ;
Mail. organizer = " Geffzhang " ;
Mail. Location = " Apsara 1003 " ;
Mail. starttime = Datetime. now;
Mail. starttimespecified = True ;
Mail. endtime = Datetime. Now. adddays ( 1 );
Mail. endtimespecified = True ;
Localhost. messageservice = New Localhost. messageservice ();
Messageservice. application_context = New Localhost. applicationcontext () {appkey = " 93ed11c73f7c4ae7a6335ffa9809e4f9 " };
Bool Sendresult;
Bool Sendresultspec;
Messageservice. Sendmail (mail, Out Sendresult, Out Sendresultspec );
Assert. istrue (sendresult );
}