已锁定 SMIL in VB.NET

  • 2012年2月21日 5:45
     
     
    How to dynamically create a SMIL XML file in vb.net? I am currently developing an application in vb.net that will send MMS thru internet. I've found an API from Globe Labs that will enable me to send MMS from my application but I dont know how to use their API. They are using SMIL but I dont know how to dynamically create that file in my application. I've subscribed to their trial and they gave me these:


    WSDL: "http://iplaypen.globelabs.com.ph:1881/axis2/services/Platform?wsdl"


    URL endpoint: "http://iplaypen.globelabs.com.ph:1881/axis2/services/Platform"


    API Access Number or Short-code: 2373


    and a username and password. I really have no idea about this. in their documentation page they have this posted:






    -------------------------GLOBE LABS' SEND MMS DOCUMENTATION-------------------------------


    Allows an API user to send a MMS message. The parameters used are similar to the sendSMS function but this SOAP call uses SMIL information instead of text to define content.


    URL endpoint: http://iplaypen.globelabs.com.ph:1881/axis2/services/Platform/


    Parameters Description


    uName A valid username – same as the username used during registration. (Required)


    uPin The PIN that was issued to the user during the API registration process. (Required)


    MSISDN The target cellphone number intended to receive the SMS message. This number must have been defined during the registration process or added subsequently via the Globe Labs website. (Required)


    Subject The subject matter of the message. (Required)


    SMIL A properly formed SMIL XML document. SMIL stands for "Synchronized Multimedia Integration Language" and is a w3c standard for defining how content should appear on a mobile phone. More information about developing using SMIL and details about the document specification can be found athttp://www.w3.org/AudioVideo/. See Appendix 2 for some sample XML to get you started.


    Important notes:


    · In using this service, all fields are necessary in the SOAP envelope, so make sure to include all arguments even if their contents are empty (blankable).


    · Generally, the arguments are strings although the web service does not necessarily do strong type enforcement.


    It's important to include a XML namespace in the function call. The namespace is "http://ESCPlatform/xsd/". This should be defined as an xmlns attribute in the sendSMS soap function call / XML node (e.g. ... ).


    Appendix 2 defines a sample SOAP envelope for the sendMMS method including an example SMIL argument.


    The example below extends the previous SMS example. But instead of providing an SMS argument, the application expects an SMIL string. The console application returns an integer code upon completing the request.


    using System;


    using System.Net;


    class SendMMS {


        public static void Main(string [] args) { 

                const string uName = "user"; 


                const string uPin = "password";


                const string MSISDN = "0917xxxxxxx";


                const string Subject = "Test Message";






                Platform Service1 = new Platform();


                /* uncomment this code block if you need http proxy support


                NetworkCredential myCred = new NetworkCredential("username", "password", "domain"); 


                WebProxy proxyObject = new WebProxy("http://proxy.address:8080/");






                proxyObject.Credentials = myCred; 


                Service1.Proxy = proxyObject;


               */






                String suggestion = Service1.sendMMS(uName, uPin, MSISDN, Subject, args[0]);    






                if (suggestion == null) { 


                        Console.WriteLine("[No response]");


                }       


                else {  


                        Console.WriteLine(suggestion);


                }       


        }       
    }


    Compiling the code using mono is also similar


    mcs /r:Platform.dll sendmms.cs


    And then using the service is as simple as:


    mono sendmms.exe "*smil"


    To get you started, below is an example SMIL file that contains a Globe logo and some text.


    <layout>


      <root-layout height='96' width='122' />


      <region height='67%' fit='meet' id='Image' width='100%' left='0%' top='0%' />


      <region height='33%' fit='scroll' id='Text' width='100%' left='0%' top='67%' />


    </layout>
    <par dur='8000ms'>


      <img src='http://freeformsoftware.org/demo/resource/globelogo.gif' region='Image' />


      <text src='http://freeformsoftware.org/demo/resource/helloworld.txt' region='Text' />


    </par>
    -------------------------GLOBE LABS' SEND MMS DOCUMENTATION-------------------------------


    I hope someone could help me with this. Thank you. I really need it badly. I am just a newbie in vb.net.  Thanks