WebPostMms Function

Action

Posts the MMS to the specified MMSC by means of HTTP POST. The returned value only indicates whether or not the post operation was successful. To determine if the MMSC answered with a response status of OK, locate the response (WebParseDataBound), parse the MMS (MmsParseMms) and check its response status header (MmsGetHeader).

Include file

MmsLib.bdh

Syntax

WebPostMms( in sUrl : string,
            in hMms : number ): boolean;

Return value

  • true if successful

  • false otherwise

Parameter Description
sUrl Complete URL to the MMSC.
hMms Handle for the MMS returned by a call to MmsCreateMms.

Example

transaction TInit
  var
    hMms : number;
  begin
    MmsCreateMms(hMms);
    MmsSetHeader(hMms, MMS_HEADER_MsgType, MMS_M_SEND_REQ);
    MmsSetHeader(hMms, MMS_HEADER_MmsVersion, MMS_MSGVERSION_10);
    MmsSetHeader(hMms, MMS_HEADER_ContentType,
        WAP_CONTENT_ApplicationVndWapMultipartRelated);
    MmsSetHeaderString(hMms, MMS_HEADER_From, "31743678001");
    MmsSetHeaderString(hMms, MMS_HEADER_To, "31743689031");
    MmsSetHeaderString(hMms, MMS_HEADER_TransactionId, "17");
    MmsAddFile(hMms, "smile.gif", WAP_CONTENT_ImageGif,
        "smile.gif", "smile.gif");
    WebPostMms("http://10.5.8.12:8899/mmsc", hMms);
    MmsDeleteMms(hMms);
  end TInit;