HTTP POST and open external result

Hi
Now I'm working through payment system.
I created APEX process like this:
DECLARE
post_str VARCHAR2 (4000) := 'p1=A&p2=B';
req UTL_HTTP.req;
resp UTL_HTTP.resp;
v_buffer VARCHAR2 (1024);
BEGIN
req :=
UTL_HTTP.begin_request (url => 'http://www.somesite.com/index.php',
method => 'POST'
UTL_HTTP.set_header (r => req,
NAME => 'Content-Type',
VALUE => 'application/x-www-form-urlencoded'
UTL_HTTP.set_header (r => req,
NAME => 'Content-Length',
VALUE => LENGTH (post_str)
UTL_HTTP.write_text (r => req, DATA => post_str);
resp := UTL_HTTP.get_response (r => req);
LOOP
UTL_HTTP.read_line (resp, v_buffer, TRUE);
DBMS_OUTPUT.put_line (v_buffer);
END LOOP;
UTL_HTTP.end_response (resp);
EXCEPTION
WHEN UTL_HTTP.end_of_body
THEN
UTL_HTTP.end_response (resp);
END;
Generaly it works but on the end I have to receive result from external site (http://www.somesite.com/index.php). In this site is PHP FORM wchich a have to manualy submit, according this probably in my process I have to exit from APEX but I don't know how. Of course exit has to be with this same POST session.

If nobody can halp me, maybe other way will be easier for example:
I want page created in apex with form, but form has to send value to external Web Page. (One condition I can't use link with values /GET method/)

Similar Messages

  • How to submit both HTTP post and a PDF

    I would like to know how to submit HTTP post and a PDF to a HTTPS web server that will have a php code to parse. Any ideas would be great.
    -Dev

    If you drop a regular button on the form and make it a submit button. In teh Submit panel you can control what is being submitted. One of the options is a PDF and another is an XDP (XML Data Package) where you can control what is in th epackage. One of the options for the package is the completed PDF (base64 encoded). If you use the XDP option you will get all of your data in XML and you will get the completed PDF in a separate node. I believe the node is Chunk. Then you can get the Chunk node an decode it and voila there is your data and completed PDF in a single transmission.

  • Difference between HTTP Post and Webservice call

    Hi,
    Can anybody let me know the difference between HTTP Post and Webservice Calls and also how each one of them is acheived through BPEL.
    Thanks,
    Adi

    Hi Adi,
    The protocol may be the same but the "idea" is different...
    I recommend you reading this:
    http://www.w3schools.com/webservices/ws_intro.asp
    Cheers,
    Vlad
    Give points - it is good etiquette to reward an answerer points (5 - helpful; 10 - correct) for their post if they answer your question. If you think this is helpful, please consider giving points.

  • How to link to and open external document with Mac Dreamweaver

    I'm evaluating Dreamweaver on the Mac. I know how to link to
    an external document, such as a Word or Excel document. However, I
    would like for the file to automatically open when the link is
    clicked, rather than taking me to a directory window (where I then
    have to double-click the file icon). Another option would be to
    easily import data from a Word or Excel document, but the Help
    indicates that's only possible when using Dreamweaver on Windows.
    Thanks for any guidance you can provide.

    What you need to do is this:
    1.) back up all your data from your iPod
    2.) reformat it on the Windows machine.
    You'll then be able to use your iPod on both Windows and Mac:) If you need more help, let me know!

  • HTTP POST and Internet Explorer

    Sorry for the cross post, but after reading through this newsgroup, it
              seems that this audience is better suited to answer this question...
              ===========================
              We're running across a very strange bug that is happening only in
              Internet Explorer and only when posting form data. Netscape works
              completely fine every single time.
              The user experience is this:
              Using IE, I get to a JSP that's got a form. I click a button on said
              form that performs either a "Save" or a "Cancel" action and am
              immediately hit with the wonderful "This page cannot be displayed(Cannot
              find server or DNS Error)" IE error message.
              What happens on the server side is this:
              User posts a form to a JSP. The JSP does any processing that it needs
              to, which in the case of "Cancel" is nothing, and issues these commands:
              response.sendRedirect("/some/page.jsp");
              return; //exit program immediately!
              I've verified that the server is executing as expected, sending the
              response and returning out of the program. That's where things seem to
              go awry in Internet Explorer. It's as if IE is not interpreting the
              HTTP response header correctly and just dies not knowing where to go.
              The even stranger thing is that, when running WLS on our internal
              network, this does not happen unless your dialed up. However, when
              hitting our servers that are colocated, this happens on a regular basis.
              One more thing to note is that this does not happen every time. It
              happens more than 90% of the time, but not every time, which is why it's
              very hard for me to recreate.
              Another strange thing is that this error seems to depend on the content
              of the form
              variables, for instance I can have a form with check boxes that errors
              out when the
              check boxes are unchecked, but is fine when the boxes are checked, and
              in both
              cases I'm not doing anything at all with the data that is getting
              posted.
              I've tried everything from changing the http headers to changing the
              post to be
              multipart encoded, and nothing works.
              If you've got a clue or a hint or any suggestions where I should be
              looking, then please let me know. I've got a few more things to check
              out, but I'm running out of ideas.
              Our platform:
              - RedHat Linux 6.0
              - WebLogic Server 4.5.1 Service Pack 5
              - JDK 1.2.2 (Sun/Blackdown)
              These JSPs:
              - Are posting form data ("GET" works for some reason)
              - Are not using any JavaScript
              

    Hi Chris/All,
              Following on from this I contacted WebLogic support (Frederic). They
              suggested I downgrade from 4.5.1 sp8 to 4.5.1 sp7. They also suggested I
              use HttpResponse.encodeURL()...
              This did not solve my problem but I went on to discover the following...
              Hi Frederic,
              We tried with sp7
              I thought HttpResponse.encodeURL just encoded session data where no cookie
              support was in the browser, but I tried it anyway.
              Also tried the following to the page I'm redirecting back to (to prevent
              browser cacheing)
              resp.setHeader("Cache-Control","no-cache"); file://HTTP 1.1
              resp.setHeader("Pragma","no-cache"); file://HTTP 1.0
              resp.setDateHeader ("Expires", 0); file://prevents caching at the proxy
              server
              Also added the following to override the standard implementation
              protected long getLastModified(HttpServletRequest req)
              System.out.println("ServletA.getLastModified"); // ensure lastModified is
              always in the future requiring a reload
              return Long.MAX_VALUE;
              The only way I've been able to force this to work is a bit of a cludge and
              is as follows...
              // add time to queryString to fool IE5 into thinking this is a new web page.
              String parentURL = HttpUtils.getRequestURL(req) + "?" + req.getQueryString()
              + "&t=" + System.currentTimeMillis();
              The following is also of interest
              http://forum.java.sun.com/forum?14@@.787c19c1
              HTH, Let me know
              Thanks, Gary
              Gary <[email protected]> wrote in message
              news:[email protected]...
              > This sounds similar to a problem I'm having with straight Servlets.
              >
              > I have a servlet (ServletA) that has a link to another servlet via <a
              href>
              > tags (ServletB). ServletB does some processing and calls ServletA with
              > original parameters to show the user the changed details. This is done as
              > follows...
              >
              > respose.sendRedirect(ServletA?params);
              > return;
              >
              > Once again this is fine in Netscape 4.07 but only works on IE5 machine
              here
              > to date (which unfortunately happens to be mine, leading to my late
              > discovery of this problem).
              >
              > My IE version is 5.00.2314.1003 if that helps.
              >
              >
              > Chris Fraser <[email protected]> wrote in message
              > news:[email protected]...
              > > Sorry for the cross post, but after reading through this newsgroup, it
              > > seems that this audience is better suited to answer this question...
              > > ===========================
              > > We're running across a very strange bug that is happening only in
              > > Internet Explorer and only when posting form data. Netscape works
              > > completely fine every single time.
              > >
              > > The user experience is this:
              > > Using IE, I get to a JSP that's got a form. I click a button on said
              > > form that performs either a "Save" or a "Cancel" action and am
              > > immediately hit with the wonderful "This page cannot be displayed(Cannot
              > >
              > > find server or DNS Error)" IE error message.
              > >
              > > What happens on the server side is this:
              > > User posts a form to a JSP. The JSP does any processing that it needs
              > > to, which in the case of "Cancel" is nothing, and issues these commands:
              > >
              > > response.sendRedirect("/some/page.jsp");
              > > return; file://exit program immediately!
              > >
              > > I've verified that the server is executing as expected, sending the
              > > response and returning out of the program. That's where things seem to
              > > go awry in Internet Explorer. It's as if IE is not interpreting the
              > > HTTP response header correctly and just dies not knowing where to go.
              > >
              > > The even stranger thing is that, when running WLS on our internal
              > > network, this does not happen unless your dialed up. However, when
              > > hitting our servers that are colocated, this happens on a regular basis.
              > >
              > > One more thing to note is that this does not happen every time. It
              > > happens more than 90% of the time, but not every time, which is why it's
              > >
              > > very hard for me to recreate.
              > >
              > > Another strange thing is that this error seems to depend on the content
              > > of the form
              > > variables, for instance I can have a form with check boxes that errors
              > > out when the
              > > check boxes are unchecked, but is fine when the boxes are checked, and
              > > in both
              > > cases I'm not doing anything at all with the data that is getting
              > > posted.
              > >
              > > I've tried everything from changing the http headers to changing the
              > > post to be
              > > multipart encoded, and nothing works.
              > >
              > > If you've got a clue or a hint or any suggestions where I should be
              > > looking, then please let me know. I've got a few more things to check
              > > out, but I'm running out of ideas.
              > >
              > > Our platform:
              > > - RedHat Linux 6.0
              > > - WebLogic Server 4.5.1 Service Pack 5
              > > - JDK 1.2.2 (Sun/Blackdown)
              > >
              > > These JSPs:
              > > - Are posting form data ("GET" works for some reason)
              > > - Are not using any JavaScript
              > >
              >
              >
              

  • Http post and Alfresco web script

    Hi all,
    I'm wondering how to send the content of an XFA form into an Alfresco ECM instance. So far, I've been using "email submit buttons" by mail, but I think submitting the xml content directly into an Alfresco space could be feasible without too much trouble.
    I'm trying to adapt the online script fromLiveCycle documentation
    http://livedocs.adobe.com/livecycle/8.2/programLC/programmer/help/wwhelp/wwhimpl/common/ht ml/wwhelp.htm?context=sdkHelp&file=001677.html
    same in version 9 : http://help.adobe.com/en_US/livecycle/9.0/programLC/help/index.htm?content=001303.html
    which are about the same docs as the ones on Alfresco wiki (http://wiki.alfresco.com/wiki/Web_Scripts_Examples#File_Upload) although LiveCycle is only based on Alfresco AFAIK.
    I don't want to use an HTML form, but directly send my form from my pdf xfa form. I made a small test using a fixed url on an HttpSubmitButton
    http://localhost:8080/alfresco/s/upload?guest=true&fileName=liveCycleDocument&title=myTitl e&description=myDescription&content=myContent
    On Alfresco, the document is created with the correct args values. But I still don't know how to send the real form content to the URL.
    I checked on this document http://partners.adobe.com/public/developer/en/livecycle/lc_understanding_submit_tip.pdf where I discovered I can use a custom submit button to send the datasets, but still cannot get my form xml data.
    I hope someone will have a clue about LiveCycle/Alfresco communication.
    Thx
    Best regards,
    jgrd

    @Srini
    Yes of course :
    in Data Dictionary/Web Scripts (or Web Scripts extensions): create the 3 files
    You may use spaces for package/subpackages:
    - pdfform.post.desc.xml
         <webscript>
         <shortname>pdf form</shortname>
         <description>processing pdf form</description>
         <url>/pdfform</url>
         <authentication>guest</authentication>
         </webscript>
    - pdfform.post.js :
    upload = companyhome.createFile("form." + companyhome.children.length + "." + args.fileName) ;
    upload.properties.content.content = requestbody.content;
    upload.properties.encoding = "UTF-8";
    upload.properties.title = args.title;
    upload.properties.description = args.description;
    upload.save();
    model.upload = upload
    -pdfform.post.html.ftl (freemarker)
    <html>
    <head>
       <title>Test pdf form</title>
      </head>
    <body>
    done !
    </body>
    </html>
    - Register the script by refreshing the page http://localhost:8080/alfresco/s/index
    or with curl -X POST "-uadmin:admin" -d "reset=on" http://localhost:8080/alfresco/s/index (as mentioned by Jeff Potts)
    - try it with from a pdf
    use a plain button, select "Submit", Submit to URL = "http://localhost:8080/alfresco/s/pdfform?guest=true&fileName=myFileName.xml&title=myTitle& description=myDescription", Sumit As = XDP
    Test done with Alfresco 3.3CE, LiveCycle 8.2.1/Adobe 9.3
    Hope all this will is correct as I'm learning web scripts,
    Regards,
    jgrd

  • HTTP POST and socket

    Hi,
    I'm trying to post data with the code below, using a Socket.
    The server answers with HTTP/1.1 200 OK, but doesn't get the parameters.
    I don't want to use HttpUrlConnection because I do need a timeout.
    So if anyone feels like checking my code, here it is (sample, i've removed the "try-catches" to reduce it):
    Socket soc = new Socket(host, port);
    soc.setSoTimeout(timeout);
    PrintWriter out = new PrintWriter(new OutputStreamWriter(soc.getOutputStream()));
    BufferedReader b = new BufferedReader(new InputStreamReader(soc.getInputStream()));
    //maybe the line below is wrong... I'm searching...
    String data = "name=krosso\notherParameter=value";
    String outString = "POST /useradm/testComm2.htm HTTP/1.0\nContent-Length: "+data.length()+"\n\n"+data;
    System.out.println("Request = ["+outString+"]");
    out.println(outString);
    out.flush();
    System.out.println("Response = [");
    String s;
    while(true)
         s=b.readLine();
         if (s==null) break;
         System.out.println(s);
    System.out.println("]");
    Thanks!

    POST request are writte like GET requests:
    name=myName&address=myAddress ....
    After the Header there is a linefeed carriage return pair:
    \r\n\r\n
    A Header could look like this:
    POST /file.php HTTP/1.0 //-->"\n"
    Content-length: 35 //-->"\r\n\r\n"
    name=myName&address=myAddress
    But it still doesnt work over Socket, don�t ask me why...
    If there you have found the solution please post it here. THX

  • HTTP Post and Java Stack

    Does the java stack need to be installed for ECC5 to send a message via HTTP?
    Edited by: Kim Holloway on Dec 16, 2010 10:55 PM

    ECC is can send the data through ABAP Stack , No java stack required.
    Regards,
    Ravi.

  • HTTP Multi-Form Post - And Config?

    Hey Everyone,
    I'm stuck on a situation where my code in PRD does not behave like my code in DEV and QAS. This code is a simple multi-part HTTP post to an external system. Nothing special. There are two variables in my equation:
    1. DEV and QAS are on a higher kernel level than PRD. The kernel has not migrated that far yet.
    2. I have the cryptographic library active on DEV and QAS, but not on PRD. Like the kernel, it has not migrated there yet.
    Mind you, I've double checked the SICF and SMICM settings to guarantee they are identical in all systems. Is there something else that I have missed?
    I have seen situations before where kernel applications have "tightened the bolts" on weak code, so I thought perhaps my code was "weak." Would someone mind giving a glance over to see if something is missing? Note that it works great in PRD, but not in QAS and DEV. It could be just sloppy code that crumbled under the stringent eye of a new kernel.
    Here is the code...thanks for your attention.
    Greg
    DATA:  http_client       TYPE REF TO if_http_client.
        CALL METHOD cl_http_client=>create
          EXPORTING
            host    = lv_host
            service = '80'
            scheme  = '1'
          IMPORTING
            client  = http_client.
    *These steps fill the HTTP Post basic settings for communication back to the URL that first Posted to SAP.
        http_client->request->set_header_field( name = '~request_uri'     value = sourcetask_http_url ).
        http_client->request->set_header_field( name = '~request_method'  value = 'POST' ).
        http_client->request->set_header_field( name = 'Content_Type'     value = 'multipart/form-data' ).
        http_client->request->set_header_field( name = '~server_protocol' value = 'HTTP/1.1' ).
    * Variable Fields Need to Map to EDMS Form *These steps fill the MIME multi-part form fields with values.
        http_client->request->set_form_field( name = 'taskstatus' value = 'Done').
        http_client->request->set_form_field( name = 'attributes_ref_canddoc_1' value = attributes_ref_canddoc_1 ).
        http_client->request->set_form_field( name = 'wf_status' value = wf_status ).
        http_client->request->set_form_field( name = 'forms_dlm_lbl_form_change_type_1' value = form_change_type_1 ).
        http_client->request->set_form_field( name = 'forms_dlm_lbl_form_change_ref_1' value = form_change_ref_1 ).
        http_client->request->set_form_field( name = 'forms_dlm_lbl_form_dp_repart_1' value = form_dp_repart_1 ).
      *This step sends the HTTP Post to the external system.
        http_client->send( ).
    *This step is necessary to make sure the communication was a success. Without it a failure won't be known.
        CALL METHOD http_client->receive
          EXCEPTIONS
            http_communication_failure = 1
            http_invalid_state         = 2
            http_processing_failed     = 3
            OTHERS                     = 4.

    Update: I've reviewed the system profile, the ICF, the Crypto Library, the RFC, the ICM, rewritten my code in numerous ways, reverted the kernel back to its original level...all to no avail. What did come of it is this...and a lesson I've learned many times and should have been more astute and critical from the start. When the downstream system you are communicating with tells you they have not made a change and it must be SAP...well, make sure they are not lying. "Well, the change we made wouldn't affect that." Oh...really.

  • How to post and get data from server using Get Webrequest

    Hi:-)
    I'm trying to send a username and password argument my server and the server is suppose to send some string back. The following code, that I got of the web, just dies. I think this line:
    HttpWebRequestpreq = result.AsyncState
    asHttpWebRequest;
    is null. Can you kindly fix this for me? Thank you in advance:-)
    notes: I have a few textboxes with the values for the request params
    I'm targeting Windows Phone 8.0 and Windows Phone 8.1 devices
    privatevoidBtnSignUpSubmit_Tab(objectsender,
    RoutedEventArgse)
    //show error if Username == Username
    if(TbUN.Text.ToString() ==
    "Username")
    MessageBox.Show("You
    must fill in your Username in the Username textbox.\nThank you.");
    return;
    //make sure all fields are filled in
    if(TbUN.Text.ToString() ==
    ""|| TbPW.Text.ToString()
    == ""|| TbCPW.Text.ToString()
    == "")
    MessageBox.Show("All
    fields must be filled in.\nThank you.");
    return;
    //make sure Password is the same as Confirm Password
    if(TbPW.Text.CompareTo(TbCPW.Text) !=
    0)
    MessageBox.Show("Your
    Password should be the same as Confirm Password.\nThank you.");
    return;
    //make sure Username contains valid characters
    boolbValid = IsUsernameValid(TbUN.Text);
    if(bValid)
                    bSignUp =
    true;
    //disable textboxes
                    TbUN.IsEnabled =
    false;
                    TbPW.IsEnabled =
    false;
                    TbCPW.IsEnabled =
    false;
                    TbEmail.IsEnabled =
    false;
                    BtnSignUpSubmit.IsEnabled =
    false;
                    title.Text =
    "requesting...";
    //make Post request top-server
    //add parameters
    stringdata =
    "username="+TbUN.Text+"&Password="+TbPW.Text;
    if(TbEmail.Text.Contains("@")
    && TbEmail.Text.Contains("."))
                        data +=
    "&email="+ TbEmail.Text;
                    System.
    UriURL =
    newUri("http://www.iclips.co.za/RegisterUsernameAndPassword.php");
    WebRequestwebRequest =
    WebRequest.Create(URL);
                    webRequest.Method =
    "POST";
                    webRequest.ContentType =
    "application/x-www-form-urlencoded";
                    webRequest.ContentLength = data.Length;
    //we first obtain an input stream to which to write the body of the HTTP POST
                    webRequest.BeginGetRequestStream((
    IAsyncResultresult) =>
    HttpWebRequestpreq = result.AsyncState
    asHttpWebRequest;
    if(preq !=
    null)
    StreampostStream = preq.EndGetRequestStream(result);
    //guess one could just accept a byte[] [via function argument] for arbitrary data types - images, audio,...
    byte[] dataStream =
    Encoding.UTF8.GetBytes(data);
                            postStream.Write(dataStream, 0, dataStream.Length);
                            postStream.Close();
    //we can then finalize the request...
                            preq.BeginGetResponse((
    IAsyncResultfinal_result) =>
    HttpWebRequestreq = final_result.AsyncState
    asHttpWebRequest;
    if(req !=
    null)
    try
    //we call the success callback as long as we get a response stream
    WebResponseresponse = req.EndGetResponse(final_result);
                                        success_callback(response.GetResponseStream());
    catch(WebExceptionwe)
    //otherwise call the error/failure callback
                                        error_callback(we.Message);
    return;
                            }, preq);
                    }, URL);
    privatevoiderror_callback(stringp)
    if(bSignUp)
                    bSignUp =
    false;
    // Show error message
    MessageBox.Show("Connection
    Error!\n\n"+ p);
    //enable input
    //disable textboxes
                    TbUN.IsEnabled =
    true;
                    TbPW.IsEnabled =
    true;
                    TbCPW.IsEnabled =
    true;
                    TbEmail.IsEnabled =
    true;
                    BtnSignUpSubmit.IsEnabled =
    false;
                    title.Text =
    "try again";
    privatevoidsuccess_callback(Streamstream)
    if(bSignUp)
                    bSignUp =
    false;
    // Open the stream using a StreamReader for easy access.
    StreamReaderreader =
    newStreamReader(stream);
    // Read the content.
    stringresponse = reader.ReadToEnd();
    // Display the content.
    MessageBox.Show(response);
    // Clean up the streams.
                    reader.Close();

    // Directives
    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Net;
    using System.Windows;
    using System.Windows.Controls;
    using System.Windows.Navigation;
    using Microsoft.Phone.Controls;
    using Microsoft.Phone.Shell;
    using iClips.Resources;
    using System.ComponentModel;
    using System.Threading;
    using System.IO;
    using System.IO.IsolatedStorage;
    using Microsoft.Devices;
    using System.Windows.Media;
    using Microsoft.Xna.Framework.Media;
    using System.Windows.Media.Imaging;
    using System.Threading.Tasks;
    using System.Text;
    using Windows.Storage;
    using System.Windows.Threading;
    using System.Diagnostics;
    using System.Globalization;
    namespace iClips
    public partial class MainPage : PhoneApplicationPage
    Boolean bSignUp;
    HyperlinkButton BtnSignIn, BtnSignUp, BtnSignUpSubmit;
    TextBox TbUN, TbPW, TbCPW, TbEmail;
    TextBlock un, title;
    System.DateTime startTime;
    // Viewfinder for capturing video.
    private VideoBrush videoRecorderBrush;
    // Source and device for capturing video.
    private CaptureSource captureSource;
    private CaptureDevice vcDevice;
    double w, h;
    // File details for storing the recording.
    private IsolatedStorageFileStream isoVideoFile;
    private FileSink fileSink;
    private string isoVideoFileName = "CameraMovie.mp4";
    // For managing button and application state.
    private enum ButtonState { Initialized, Stopped, Ready, Recording, Playback, Paused, NoChange, CameraNotSupported };
    private ButtonState currentAppState;
    //create reference to SocketClient
    SocketClient sock = new SocketClient();
    // Constructor
    public MainPage()
    InitializeComponent();
    //setup recording
    // Prepare ApplicationBar and buttons.
    PhoneAppBar = (ApplicationBar)ApplicationBar;
    PhoneAppBar.IsVisible = true;
    StartRecording = ((ApplicationBarIconButton)ApplicationBar.Buttons[0]);
    StopPlaybackRecording = ((ApplicationBarIconButton)ApplicationBar.Buttons[1]);
    StartPlayback = ((ApplicationBarIconButton)ApplicationBar.Buttons[2]);
    PausePlayback = ((ApplicationBarIconButton)ApplicationBar.Buttons[3]);
    //display a welcome message
    txtDebug.Text = "Welcome to iClips.";
    string result = sock.Connect("197.189.214.116", 5000);
    txtOutput.Text = result;
    if(result.Contains("success")){
    sock.Send("#testing_");
    SetScreenResolution();
    //set image on load friends
    /*Uri uri = new Uri("/Assets/home_icons/myFriends.png", UriKind.Relative);
    BitmapImage imgSource = new BitmapImage(uri);
    Image image = new Image();
    image.Source = imgSource;
    load_friends.Content = image;*/
    SignIn();
    private void SignIn()
    // remove all elements inside sign grid
    for (int index = MyGrid.Children.Count - 1; index >= 0; index--)
    MyGrid.Children.RemoveAt(index);
    BtnSignIn = new HyperlinkButton();
    BtnSignIn.Content = "<< Sign In >>";
    BtnSignIn.Click += new RoutedEventHandler(SignIn_Tab);
    BtnSignIn.VerticalAlignment = VerticalAlignment.Bottom;
    BtnSignUp = new HyperlinkButton();
    BtnSignUp.Content = "<< I'm new here. Sign Up. >>";
    BtnSignUp.Click += new RoutedEventHandler(SignUp_Tab);
    BtnSignUp.VerticalAlignment = VerticalAlignment.Bottom;
    un = new TextBlock();
    un.Text = "Enter your Username:";
    un.VerticalAlignment = VerticalAlignment.Bottom;
    un.HorizontalAlignment = HorizontalAlignment.Center;
    TextBlock pw = new TextBlock();
    pw.Text = "Enter your Password:";
    pw.VerticalAlignment = VerticalAlignment.Bottom;
    pw.HorizontalAlignment = HorizontalAlignment.Center;
    //setup username textbox
    TbUN = new TextBox();
    TbUN.Opacity = 0.5;
    TbUN.Text = "";
    TbUN.FontSize = 16;
    TbUN.FontWeight = FontWeights.ExtraBold;
    TbUN.Foreground = new SolidColorBrush(Colors.Black);
    TbUN.Background = new SolidColorBrush(Colors.Transparent);
    TbUN.VerticalAlignment = VerticalAlignment.Top;
    TbUN.Height = 70;
    TbUN.Tap += TbUN_Tap;
    //setup password textbox
    TbPW = new TextBox();
    TbPW.Opacity = 0.5;
    TbPW.Text = "";
    TbPW.FontSize = 16;
    TbPW.FontWeight = FontWeights.ExtraBold;
    TbPW.Foreground = new SolidColorBrush(Colors.Black);
    TbPW.Background = new SolidColorBrush(Colors.Transparent);
    TbPW.VerticalAlignment = VerticalAlignment.Top;
    TbPW.Height = 70;
    TbPW.Tap += TbPW_Tap;
    //Show the background color of MyGrid
    MyGrid.Background = new SolidColorBrush(Colors.Blue);
    // Create Row for Username Textblock
    RowDefinition gridRow0 = new RowDefinition();
    gridRow0.Height = new GridLength(60);
    MyGrid.RowDefinitions.Add(gridRow0);
    // Create Row for Username
    RowDefinition gridRow1 = new RowDefinition();
    gridRow1.Height = new GridLength(60);
    MyGrid.RowDefinitions.Add(gridRow1);
    //create row for password Textblock
    RowDefinition gridRow2a = new RowDefinition();
    gridRow2a.Height = new GridLength(60);
    MyGrid.RowDefinitions.Add(gridRow2a);
    //create row for password
    RowDefinition gridRow2 = new RowDefinition();
    gridRow2.Height = new GridLength(60);
    MyGrid.RowDefinitions.Add(gridRow2);
    //create row for << Sign In >>
    RowDefinition gridRow3 = new RowDefinition();
    gridRow3.Height = new GridLength(60);
    MyGrid.RowDefinitions.Add(gridRow3);
    //create row for << Sign Up >>
    RowDefinition gridRow4 = new RowDefinition();
    gridRow4.Height = new GridLength(120);
    MyGrid.RowDefinitions.Add(gridRow4);
    Grid.SetRow(un, 0);
    Grid.SetColumn(un, 0);
    Grid.SetRow(TbUN, 1);
    Grid.SetColumn(TbUN, 0);
    Grid.SetRow(pw, 2);
    Grid.SetColumn(pw, 0);
    Grid.SetRow(TbPW, 3);
    Grid.SetColumn(TbPW, 0);
    Grid.SetRow(BtnSignIn, 4);
    Grid.SetColumn(BtnSignIn, 0);
    Grid.SetRow(BtnSignUp, 5);
    Grid.SetColumn(BtnSignUp, 0);
    MyGrid.Children.Add(un);
    MyGrid.Children.Add(TbUN);
    MyGrid.Children.Add(pw);
    MyGrid.Children.Add(TbPW);
    MyGrid.Children.Add(BtnSignIn);
    MyGrid.Children.Add(BtnSignUp);
    private void SignUp_Tab(object sender, RoutedEventArgs e)
    MessageBox.Show("Welcome to Sign up.\n\nYou need 3 things to create an account:\n1. A unique Case-Sensitive Username. ex 'iClips' is not the same as 'Iclips'\n2. A password to secure you account. \n3. A profile photo for easy recognition.\nThank you.");
    // remove all elements inside sign grid
    for (int index = MyGrid.Children.Count - 1; index >= 0; index--)
    MyGrid.Children.RemoveAt(index);
    //repopulate grid with Sign Up elements
    //create title
    title = new TextBlock();
    title.Text = "--- Sign Up 1/2 ---";
    title.VerticalAlignment = VerticalAlignment.Top;
    title.HorizontalAlignment = HorizontalAlignment.Center;
    //field for Username
    TbUN = new TextBox();
    TbUN.Opacity = 0.5;
    TbUN.Text = "Username";
    TbUN.FontSize = 16;
    TbUN.FontWeight = FontWeights.ExtraBold;
    TbUN.Foreground = new SolidColorBrush(Colors.Black);
    TbUN.Background = new SolidColorBrush(Colors.Transparent);
    TbUN.VerticalAlignment = VerticalAlignment.Top;
    TbUN.Height = 70;
    TbUN.Tap += TbUN_Tap;
    //field for Password
    TbPW = new TextBox();
    TbPW.Opacity = 0.5;
    TbPW.Text = "Password";
    TbPW.FontSize = 16;
    TbPW.FontWeight = FontWeights.ExtraBold;
    TbPW.Foreground = new SolidColorBrush(Colors.Black);
    TbPW.Background = new SolidColorBrush(Colors.Transparent);
    TbPW.VerticalAlignment = VerticalAlignment.Top;
    TbPW.Height = 70;
    TbPW.Tap += TbPW_Tap;
    //field Confirm for Password
    TbCPW = new TextBox();
    TbCPW.Opacity = 0.5;
    TbCPW.Text = "Confirm Password";
    TbCPW.FontSize = 16;
    TbCPW.FontWeight = FontWeights.ExtraBold;
    TbCPW.Foreground = new SolidColorBrush(Colors.Black);
    TbCPW.Background = new SolidColorBrush(Colors.Transparent);
    TbCPW.VerticalAlignment = VerticalAlignment.Top;
    TbCPW.Height = 70;
    TbCPW.Tap += TbCPW_Tap;
    //field for Optional Email
    TbEmail = new TextBox();
    TbEmail.Opacity = 0.5;
    TbEmail.Text = "Email (Optional)";
    TbEmail.FontSize = 16;
    TbEmail.FontWeight = FontWeights.ExtraBold;
    TbEmail.Foreground = new SolidColorBrush(Colors.Black);
    TbEmail.Background = new SolidColorBrush(Colors.Transparent);
    TbEmail.VerticalAlignment = VerticalAlignment.Top;
    TbEmail.Height = 70;
    TbEmail.Tap += TbEmail_Tap;
    HyperlinkButton BtnGoBack = new HyperlinkButton();
    BtnGoBack.Content = "<< Go Back ";
    BtnGoBack.Click += new RoutedEventHandler(BtnGoBack_Tab);
    BtnGoBack.VerticalAlignment = VerticalAlignment.Bottom;
    BtnSignUpSubmit = new HyperlinkButton();
    BtnSignUpSubmit.Content = "<< Sign Up >>";
    BtnSignUpSubmit.Click += new RoutedEventHandler(BtnSignUpSubmit_Tab);
    BtnSignUpSubmit.VerticalAlignment = VerticalAlignment.Bottom;
    // Create Row for title
    RowDefinition gridRow0 = new RowDefinition();
    gridRow0.Height = new GridLength(60);
    MyGrid.RowDefinitions.Add(gridRow0);
    // Create Row for Username
    RowDefinition gridRow1 = new RowDefinition();
    gridRow1.Height = new GridLength(60);
    MyGrid.RowDefinitions.Add(gridRow1);
    //create row for password Textblock
    RowDefinition gridRow2a = new RowDefinition();
    gridRow2a.Height = new GridLength(60);
    MyGrid.RowDefinitions.Add(gridRow2a);
    //create row for Confirm password
    RowDefinition gridRow2 = new RowDefinition();
    gridRow2.Height = new GridLength(60);
    MyGrid.RowDefinitions.Add(gridRow2);
    //create row for email
    RowDefinition gridRow3 = new RowDefinition();
    gridRow3.Height = new GridLength(60);
    MyGrid.RowDefinitions.Add(gridRow3);
    //create row for << Sign Up >>
    RowDefinition gridRow4 = new RowDefinition();
    gridRow4.Height = new GridLength(120);
    MyGrid.RowDefinitions.Add(gridRow4);
    //create row for << Go Back >>
    RowDefinition gridRow5 = new RowDefinition();
    gridRow5.Height = new GridLength(120);
    MyGrid.RowDefinitions.Add(gridRow5);
    Grid.SetRow(title, 0);
    Grid.SetColumn(title, 0);
    Grid.SetRow(TbUN, 1);
    Grid.SetColumn(TbUN, 0);
    Grid.SetRow(TbPW, 2);
    Grid.SetColumn(TbPW, 0);
    Grid.SetRow(TbCPW, 3);
    Grid.SetColumn(TbCPW, 0);
    Grid.SetRow(TbEmail, 4);
    Grid.SetColumn(TbEmail, 0);
    Grid.SetRow(BtnSignUpSubmit, 5);
    Grid.SetColumn(BtnSignUpSubmit, 0);
    Grid.SetRow(BtnGoBack, 6);
    Grid.SetColumn(BtnGoBack, 0);
    MyGrid.Children.Add(title);
    MyGrid.Children.Add(TbUN);
    MyGrid.Children.Add(TbPW);
    MyGrid.Children.Add(TbCPW);
    MyGrid.Children.Add(TbEmail);
    MyGrid.Children.Add(BtnSignUpSubmit);
    MyGrid.Children.Add(BtnGoBack);
    BtnSignUp.Content = "<< Sign Up >>";
    private bool IsUsernameValid(string str)
    int d;
    if (str.Length > 30)
    MessageBox.Show("You may only use a maximum of 30 characters for your Username.\nThank you.");
    return false;
    for (d = 0; d < str.Length; d++)
    if (str.Contains("~") || str.Contains("!") || str.Contains("@") || str.Contains("$")
    || str.Contains("#") || str.Contains("%") || str.Contains("|") || str.Contains("_"))
    MessageBox.Show("Your Username may not contain any of the follwing characters: \n~ ! @ # $ % | _\nThank you.");
    return false;
    return true;
    private void BtnSignUpSubmit_Tab(object sender, RoutedEventArgs e)
    //show error if Username == Username
    if (TbUN.Text.ToString() == "Username")
    MessageBox.Show("You must fill in your Username in the Username textbox.\nThank you.");
    return;
    //make sure all fields are filled in
    if (TbUN.Text.ToString() == "" || TbPW.Text.ToString() == "" || TbCPW.Text.ToString() == "")
    MessageBox.Show("All fields must be filled in.\nThank you.");
    return;
    //make sure Password is the same as Confirm Password
    if (TbPW.Text.CompareTo(TbCPW.Text) != 0)
    MessageBox.Show("Your Password should be the same as Confirm Password.\nThank you.");
    return;
    //make sure Username contains valid characters
    bool bValid = IsUsernameValid(TbUN.Text);
    if (bValid)
    bSignUp = true;
    //disable textboxes
    TbUN.IsEnabled = false;
    TbPW.IsEnabled = false;
    TbCPW.IsEnabled = false;
    TbEmail.IsEnabled = false;
    BtnSignUpSubmit.IsEnabled = false;
    title.Text = "requesting...";
    //make Post request top-server
    //add parameters
    string data = "username="+TbUN.Text+"&Password="+TbPW.Text;
    if(TbEmail.Text.Contains("@") && TbEmail.Text.Contains("."))
    data += "&email=" + TbEmail.Text;
    System.Uri URL = new Uri("http://www.iclips.co.za/RegisterUsernameAndPassword.php");
    WebRequest webRequest = WebRequest.Create(URL);
    webRequest.Method = "POST";
    webRequest.ContentType = "application/x-www-form-urlencoded";
    webRequest.ContentLength = data.Length;
    //we first obtain an input stream to which to write the body of the HTTP POST
    webRequest.BeginGetRequestStream((IAsyncResult result) =>
    HttpWebRequest preq = result.AsyncState as HttpWebRequest;
    if (preq != null)
    Stream postStream = preq.EndGetRequestStream(result);
    //guess one could just accept a byte[] [via function argument] for arbitrary data types - images, audio,...
    byte[] dataStream = Encoding.UTF8.GetBytes(data);
    postStream.Write(dataStream, 0, dataStream.Length);
    postStream.Close();
    //we can then finalize the request...
    preq.BeginGetResponse((IAsyncResult final_result) =>
    HttpWebRequest req = final_result.AsyncState as HttpWebRequest;
    if (req != null)
    try
    //we call the success callback as long as we get a response stream
    WebResponse response = req.EndGetResponse(final_result);
    success_callback(response.GetResponseStream());
    catch (WebException we)
    //otherwise call the error/failure callback
    error_callback(we.Message);
    return;
    }, preq);
    }, URL);
    private void error_callback(string p)
    if (bSignUp)
    bSignUp = false;
    // Show error message
    MessageBox.Show("Connection Error!\n\n" + p);
    //enable input
    //disable textboxes
    TbUN.IsEnabled = true;
    TbPW.IsEnabled = true;
    TbCPW.IsEnabled = true;
    TbEmail.IsEnabled = true;
    BtnSignUpSubmit.IsEnabled = false;
    title.Text = "try again";
    private void success_callback(Stream stream)
    if (bSignUp)
    bSignUp = false;
    // Open the stream using a StreamReader for easy access.
    StreamReader reader = new StreamReader(stream);
    // Read the content.
    string response = reader.ReadToEnd();
    // Display the content.
    MessageBox.Show(response);
    // Clean up the streams.
    reader.Close();
    private void BtnGoBack_Tab(object sender, RoutedEventArgs e)
    SignIn();
    private void TbEmail_Tap(object sender, System.Windows.Input.GestureEventArgs e)
    TbEmail.SelectAll();
    private void TbCPW_Tap(object sender, System.Windows.Input.GestureEventArgs e)
    TbCPW.SelectAll();
    private void SignIn_Tab(object sender, RoutedEventArgs e)
    if (TbUN.Text.ToString() == "" || TbPW.Text.ToString() == "")
    MessageBox.Show("Your Username or Password cannot be empty.\nThank you.");
    return;
    private void TbUN_Tap(object sender, System.Windows.Input.GestureEventArgs e)
    TbUN.SelectAll();
    un.Text = "Usernames are Case-Sensitive.\n'Iclips' is not the same as 'iClips'.";
    private void TbPW_Tap(object sender, System.Windows.Input.GestureEventArgs e)
    TbPW.SelectAll();
    protected override void OnNavigatedTo(NavigationEventArgs e)
    base.OnNavigatedTo(e);
    // Initialize the video recorder.
    InitializeVideoRecorder();
    CameraButtons.ShutterKeyHalfPressed += OnButtonHalfPress;
    // The event is fired when the shutter button receives a full press.
    CameraButtons.ShutterKeyPressed += OnButtonFullPress;
    // The event is fired when the shutter button is released.
    CameraButtons.ShutterKeyReleased += OnButtonRelease;
    protected override void OnNavigatedFrom(NavigationEventArgs e)
    // Dispose of camera and media objects.
    DisposeVideoPlayer();
    DisposeVideoRecorder();
    base.OnNavigatedFrom(e);
    CameraButtons.ShutterKeyHalfPressed -= OnButtonHalfPress;
    CameraButtons.ShutterKeyPressed -= OnButtonFullPress;
    CameraButtons.ShutterKeyReleased -= OnButtonRelease;
    // Ensure that the viewfinder is upright in LandscapeRight.
    protected override void OnOrientationChanged(OrientationChangedEventArgs e)
    if (vcDevice != null)
    if (e.Orientation == PageOrientation.LandscapeLeft)
    txtDebug.Text = "LandscapeLeft";
    videoRecorderBrush.RelativeTransform =
    new CompositeTransform() { CenterX = 0.5, CenterY = 0.5, Rotation = 90 };
    //rotate logo
    if (logo != null)
    RotateTransform rt = new RotateTransform();
    rt.Angle = 90;
    //default rotation is around top left corner of the control,
    //but you sometimes want to rotate around the center of the control
    //to do that, you need to set the RenderTransFormOrigin
    //of the item you're going to rotate
    //I did not test this approach, maybe You're going to need to use actual coordinates
    //so this bit is for information purposes only
    logo.RenderTransformOrigin = new Point(0.5, 0.5);
    logo.RenderTransform = rt;
    //rotate sign in link
    if (MyGrid != null)
    RotateTransform rt = new RotateTransform();
    rt.Angle = 90;
    //default rotation is around top left corner of the control,
    //but you sometimes want to rotate around the center of the control
    //to do that, you need to set the RenderTransFormOrigin
    //of the item you're going to rotate
    //I did not test this approach, maybe You're going to need to use actual coordinates
    //so this bit is for information purposes only
    MyGrid.RenderTransformOrigin = new Point(0.5, 0.5);
    MyGrid.RenderTransform = rt;
    if (e.Orientation == PageOrientation.PortraitUp)
    txtDebug.Text = "PortraitUp";
    videoRecorderBrush.RelativeTransform =
    new CompositeTransform() { CenterX = 0.5, CenterY = 0.5, Rotation = 0 };
    //rotate logo
    if (logo != null)
    RotateTransform rt = new RotateTransform();
    rt.Angle = 0;
    //default rotation is around top left corner of the control,
    //but you sometimes want to rotate around the center of the control
    //to do that, you need to set the RenderTransFormOrigin
    //of the item you're going to rotate
    //I did not test this approach, maybe You're going to need to use actual coordinates
    //so this bit is for information purposes only
    logo.RenderTransformOrigin = new Point(0.5, 0.5);
    logo.RenderTransform = rt;
    //rotate sign in link
    if (MyGrid != null)
    RotateTransform rt = new RotateTransform();
    rt.Angle = 0;
    //default rotation is around top left corner of the control,
    //but you sometimes want to rotate around the center of the control
    //to do that, you need to set the RenderTransFormOrigin
    //of the item you're going to rotate
    //I did not test this approach, maybe You're going to need to use actual coordinates
    //so this bit is for information purposes only
    MyGrid.RenderTransformOrigin = new Point(0.5, 0.5);
    MyGrid.RenderTransform = rt;
    if (e.Orientation == PageOrientation.LandscapeRight)
    txtDebug.Text = "LandscapeRight";
    // Rotate for LandscapeRight orientation.
    //videoRecorderBrush.RelativeTransform =
    //new CompositeTransform() { CenterX = 0.5, CenterY = 0.5, Rotation = 180 };
    //rotate logo
    if (logo != null)
    RotateTransform rt = new RotateTransform();
    rt.Angle = -90;
    //default rotation is around top left corner of the control,
    //but you sometimes want to rotate around the center of the control
    //to do that, you need to set the RenderTransFormOrigin
    //of the item you're going to rotate
    //I did not test this approach, maybe You're going to need to use actual coordinates
    //so this bit is for information purposes only
    logo.RenderTransformOrigin = new Point(0.5, 0.5);
    logo.RenderTransform = rt;
    //rotate sign in link
    if (MyGrid != null)
    RotateTransform rt = new RotateTransform();
    rt.Angle = -90;
    //default rotation is around top left corner of the control,
    //but you sometimes want to rotate around the center of the control
    //to do that, you need to set the RenderTransFormOrigin
    //of the item you're going to rotate
    //I did not test this approach, maybe You're going to need to use actual coordinates
    //so this bit is for information purposes only
    MyGrid.RenderTransformOrigin = new Point(0.5, 0.5);
    MyGrid.RenderTransform = rt;
    if (e.Orientation == PageOrientation.PortraitDown)
    txtDebug.Text = "PortraitDown";
    videoRecorderBrush.RelativeTransform =
    new CompositeTransform() { CenterX = 0.5, CenterY = 0.5, Rotation = 270 };
    // Provide auto-focus with a half button press using the hardware shutter button.
    private void OnButtonHalfPress(object sender, EventArgs e)
    // Focus when a capture is not in progress.
    try
    this.Dispatcher.BeginInvoke(delegate()
    txtDebug.Text = "Half Button Press: Auto Focus";
    catch (Exception focusError)
    // Cannot focus when a capture is in progress.
    this.Dispatcher.BeginInvoke(delegate()
    txtDebug.Text = focusError.Message;
    // Capture the image with a full button press using the hardware shutter button.
    private void OnButtonFullPress(object sender, EventArgs e)
    // Focus when a capture is not in progress.
    try
    this.Dispatcher.BeginInvoke(delegate()
    txtDebug.Text = "Full Button Press: Auto Focus";
    catch (Exception focusError)
    // Cannot focus when a capture is in progress.
    this.Dispatcher.BeginInvoke(delegate()
    txtDebug.Text = focusError.Message;
    // Cancel the focus if the half button press is released using the hardware shutter button.
    private void OnButtonRelease(object sender, EventArgs e)
    try
    this.Dispatcher.BeginInvoke(delegate()
    txtDebug.Text = "Shutter is released: Auto Focus";
    catch (Exception focusError)
    // Cannot focus when a capture is in progress.
    this.Dispatcher.BeginInvoke(delegate()
    txtDebug.Text = focusError.Message;
    // Update the buttons and text on the UI thread based on app state.
    private void UpdateUI(ButtonState currentButtonState, string statusMessage)
    // Run code on the UI thread.
    Dispatcher.BeginInvoke(delegate
    switch (currentButtonState)
    // When the camera is not supported by the phone.
    case ButtonState.CameraNotSupported:
    StartRecording.IsEnabled = false;
    StopPlaybackRecording.IsEnabled = false;
    StartPlayback.IsEnabled = false;
    PausePlayback.IsEnabled = false;
    break;
    // First launch of the application, so no video is available.
    case ButtonState.Initialized:
    StartRecording.IsEnabled = true;
    StopPlaybackRecording.IsEnabled = false;
    StartPlayback.IsEnabled = false;
    PausePlayback.IsEnabled = false;
    break;
    // Ready to record, so video is available for viewing.
    case ButtonState.Ready:
    StartRecording.IsEnabled = true;
    StopPlaybackRecording.IsEnabled = false;
    StartPlayback.IsEnabled = true;
    PausePlayback.IsEnabled = false;
    break;
    // Video recording is in progress.
    case ButtonState.Recording:
    StartRecording.IsEnabled = false;
    StopPlaybackRecording.IsEnabled = true;
    StartPlayback.IsEnabled = false;
    PausePlayback.IsEnabled = false;
    break;
    // Video playback is in progress.
    case ButtonState.Playback:
    StartRecording.IsEnabled = false;
    StopPlaybackRecording.IsEnabled = true;
    StartPlayback.IsEnabled = false;
    PausePlayback.IsEnabled = true;
    break;
    // Video playback has been paused.
    case ButtonState.Paused:
    StartRecording.IsEnabled = false;
    StopPlaybackRecording.IsEnabled = true;
    StartPlayback.IsEnabled = true;
    PausePlayback.IsEnabled = false;
    break;
    default:
    break;
    // Display a message.
    txtDebug.Text = statusMessage;
    // Note the current application state.
    currentAppState = currentButtonState;
    public void InitializeVideoRecorder()
    if (captureSource == null)
    // Create the VideoRecorder objects.
    captureSource = new CaptureSource();
    fileSink = new FileSink();
    vcDevice = CaptureDeviceConfiguration.GetDefaultVideoCaptureDevice();
    // Add eventhandlers for captureSource.
    captureSource.CaptureFailed += new EventHandler<ExceptionRoutedEventArgs>(OnCaptureFailed);
    // Initialize the camera if it exists on the phone.
    if (vcDevice != null)
    // Create the VideoBrush for the viewfinder.
    videoRecorderBrush = new VideoBrush();
    videoRecorderBrush.SetSource(captureSource);
    // Display the viewfinder image on the rectangle.
    viewfinderRectangle.Fill = videoRecorderBrush;
    // Start video capture and display it on the viewfinder.
    captureSource.Start();
    // Set the button state and the message.
    UpdateUI(ButtonState.Initialized, "Tap record to start recording...");
    else
    // Disable buttons when the camera is not supported by the phone.
    UpdateUI(ButtonState.CameraNotSupported, "A camera is not supported on this phone.");
    // Set recording state: start recording.
    private void StartVideoRecording()
    try
    // Connect fileSink to captureSource.
    if (captureSource.VideoCaptureDevice != null
    && captureSource.State == CaptureState.Started)
    captureSource.Stop();
    // Connect the input and output of fileSink.
    fileSink.CaptureSource = captureSource;
    fileSink.IsolatedStorageFileName = isoVideoFileName;
    // Begin recording.
    if (captureSource.VideoCaptureDevice != null
    && captureSource.State == CaptureState.Stopped)
    captureSource.Start();
    // Set the button states and the message.
    UpdateUI(ButtonState.Recording, "Recording...");
    StartTimer();
    // If recording fails, display an error.
    catch (Exception e)
    this.Dispatcher.BeginInvoke(delegate()
    txtDebug.Text = "ERROR: " + e.Message.ToString();
    //start the timer
    private void StartTimer()
    dispatcherTimer = new System.Windows.Threading.DispatcherTimer();
    dispatcherTimer.Tick += new EventHandler(dispatcherTimer_Tick);
    dispatcherTimer.Interval = new TimeSpan(0, 0, 1);
    dispatcherTimer.Start();
    startTime = System.DateTime.Now;
    private void StopTimer()
    dispatcherTimer.Stop();
    private void dispatcherTimer_Tick(object sender, EventArgs e)
    System.DateTime now = System.DateTime.Now;
    txtRecTime.Text = now.Subtract(startTime).ToString();
    // Set the recording state: stop recording.
    private void StopVideoRecording()
    try
    // Stop recording.
    if (captureSource.VideoCaptureDevice != null
    && captureSource.State == CaptureState.Started)
    captureSource.Stop();
    // Disconnect fileSink.
    fileSink.CaptureSource = null;
    fileSink.IsolatedStorageFileName = null;
    // Set the button states and the message.
    UpdateUI(ButtonState.Stopped, "Preparing viewfinder...");
    StopTimer();
    StartVideoPreview();
    // If stop fails, display an error.
    catch (Exception e)
    this.Dispatcher.BeginInvoke(delegate()
    txtDebug.Text = "ERROR: " + e.Message.ToString();
    // Set the recording state: display the video on the viewfinder.
    private void StartVideoPreview()
    try
    // Display the video on the viewfinder.
    if (captureSource.VideoCaptureDevice != null
    && captureSource.State == CaptureState.Stopped)
    // Add captureSource to videoBrush.
    videoRecorderBrush.SetSource(captureSource);
    // Add videoBrush to the visual tree.
    viewfinderRectangle.Fill = videoRecorderBrush;
    captureSource.Start();
    // Set the button states and the message.
    UpdateUI(ButtonState.Ready, "Ready to record.");
    // If preview fails, display an error.
    catch (Exception e)
    this.Dispatcher.BeginInvoke(delegate()
    txtDebug.Text = "ERROR: " + e.Message.ToString();
    // Start the video recording.
    private void StartRecording_Click(object sender, EventArgs e)
    // Avoid duplicate taps.
    StartRecording.IsEnabled = false;
    StartVideoRecording();
    // Handle stop requests.
    private void StopPlaybackRecording_Click(object sender, EventArgs e)
    // Avoid duplicate taps.
    StopPlaybackRecording.IsEnabled = false;
    // Stop during video recording.
    if (currentAppState == ButtonState.Recording)
    StopVideoRecording();
    // Set the button state and the message.
    UpdateUI(ButtonState.NoChange, "Recording stopped.");
    // Stop during video playback.
    else
    // Remove playback objects.
    DisposeVideoPlayer();
    StartVideoPreview();
    // Set the button state and the message.
    UpdateUI(ButtonState.NoChange, "Playback stopped.");
    // Start video playback.
    private void StartPlayback_Click(object sender, EventArgs e)
    // Avoid duplicate taps.
    StartPlayback.IsEnabled = false;
    // Start video playback when the file stream exists.
    if (isoVideoFile != null)
    VideoPlayer.Play();
    // Start the video for the first time.
    else
    // Stop the capture source.
    captureSource.Stop();
    // Remove VideoBrush from the tree.
    viewfinderRectangle.Fill = null;
    // Create the file stream and attach it to the MediaElement.
    isoVideoFile = new IsolatedStorageFileStream(isoVideoFileName,
    FileMode.Open, FileAccess.Read,
    IsolatedStorageFile.GetUserStoreForApplication());
    VideoPlayer.SetSource(isoVideoFile);
    // Add an event handler for the end of playback.
    VideoPlayer.MediaEnded += new RoutedEventHandler(VideoPlayerMediaEnded);
    // Start video playback.
    VideoPlayer.Play();
    // Set the button state and the message.
    UpdateUI(ButtonState.Playback, "Playback started.");
    // Pause video playback.
    private void PausePlayback_Click(object sender, EventArgs e)
    // Avoid duplicate taps.
    PausePlayback.IsEnabled = false;
    // If mediaElement exists, pause playback.
    if (VideoPlayer != null)
    VideoPlayer.Pause();
    // Set the button state and the message.
    UpdateUI(ButtonState.Paused, "Playback paused.");
    private void DisposeVideoPlayer()
    if (VideoPlayer != null)
    // Stop the VideoPlayer MediaElement.
    VideoPlayer.Stop();
    // Remove playback objects.
    VideoPlayer.Source = null;
    isoVideoFile = null;
    // Remove the event handler.
    VideoPlayer.MediaEnded -= VideoPlayerMediaEnded;
    private void DisposeVideoRecorder()
    if (captureSource != null)
    // Stop captureSource if it is running.
    if (captureSource.VideoCaptureDevice != null
    && captureSource.State == CaptureState.Started)
    captureSource.Stop();
    // Remove the event handler for captureSource.
    captureSource.CaptureFailed -= OnCaptureFailed;
    // Remove the video recording objects.
    captureSource = null;
    vcDevice = null;
    fileSink = null;
    videoRecorderBrush = null;
    // If recording fails, display an error message.
    private void OnCaptureFailed(object sender, ExceptionRoutedEventArgs e)
    this.Dispatcher.BeginInvoke(delegate()
    txtDebug.Text = "ERROR: " + e.ErrorException.Message.ToString();
    // Display the viewfinder when playback ends.
    public void VideoPlayerMediaEnded(object sender, RoutedEventArgs e)
    // Remove the playback objects.
    DisposeVideoPlayer();
    StartVideoPreview();
    public void SetScreenResolution()
    w = Application.Current.Host.Content.ActualWidth;
    h = Application.Current.Host.Content.ActualHeight;
    setResViewF(w, h);
    public void setResViewF(double width, double height)
    viewfinderRectangle.Width = width;
    viewfinderRectangle.Height = height;
    resMI.Content = "resolution: " + width + "*" + height;
    private void resMI_Click(object sender, RoutedEventArgs e)
    switch (resMI.Content.ToString())
    case "resolution: 176*220":
    setResViewF(240, 320);
    break;
    case "resolution: 240*320":
    setResViewF(360, 480);
    break;
    case "resolution: 360*480":
    setResViewF(480, 800);
    break;
    case "resolution: 480*800":
    setResViewF(1440, 720);
    break;
    case "resolution: 1440*720":
    setResViewF(1920, 1080);
    break;
    case "resolution: 1920*1080":
    setResViewF(176, 220);
    break;
    default:
    setResViewF(176, 220);
    break;
    public void WriteToFile(string key, string value)
    var Iso_settings = System.IO.IsolatedStorage.IsolatedStorageSettings.ApplicationSettings;
    if (!Iso_settings.Contains(key))
    Iso_settings.Add(key, value);
    Iso_settings.Save();//This will save your data in isolated storage.
    public string ReadFromFile(string key)
    var Iso_settings = System.IO.IsolatedStorage.IsolatedStorageSettings.ApplicationSettings;
    if (Iso_settings.Contains(key))
    return (string)Iso_settings[key];
    else
    return null;
    public DispatcherTimer dispatcherTimer { get; set; }
    private void ToggleZoom(MediaElement media)
    if (media.Stretch != Stretch.UniformToFill)
    // zoom
    media.Stretch = Stretch.UniformToFill;
    else
    // unzoom
    media.Stretch = Stretch.Uniform;
    BtnSignUpSubmit_Tab is the HyperLinkButton that would trigger the web request process. I need this code to work perfectly because a lot of people will use this. If you can simplify the http web request that already feels so good. Thank you. 

  • How to Invoke service using HTTP POST in BPEL?

    I have a client using .net service with a web page http://.../httpreceive.aspx which is invoke through an http post. How can we post xml message using http post to the url in BPEL. Are there any documentation on doing this? Will this require writing a java class to do an http post the xml message to the url?
    Edited by: sns724 on Feb 12, 2009 11:56 AM

    I created a wsdl with the http-binding to do a HTTP Post and I'm getting a com.collaxa.cube.ws.wsif.providers.http.WSIFOperation_HTTP@1ac9964 : Could not invoke 'process'; nested exception is: java.lang.NullPointerException.
    Here's my wsdl with the binding:
    <definitions name="TestHTTPost" targetNamespace="http://test.com"
    xmlns="http://schemas.xmlsoap.org/wsdl/"
    xmlns:tns="http://test.com"
    xmlns:http="http://schemas.xmlsoap.org/wsdl/http/"
    xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/"
    xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/"
    xmlns:plnk="http://schemas.xmlsoap.org/ws/2003/05/partner-link/"
    xmlns:xsd="http://www.w3.org/2001/XMLSchema"
    xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/">
    <types>
    <schema attributeFormDefault="qualified" elementFormDefault="qualified"
    targetNamespace="http://hyphen.com"
    xmlns="http://www.w3.org/2001/XMLSchema">
    <element name="AddressBookEntry">
    <complexType>
    <sequence>
    <element name="AddressBookNumber" type="string"/>
    <element name="Name" type="string"/>
    <element name="AddressLine1" type="string"/>
    <element name="AddressLine2" type="string"/>
    <element name="City" type="string"/>
    <element name="State" type="string"/>
    <element name="PostalCode" type="string"/>
    <element name="Phone" type="string"/>
    <element name="Fax" type="string"/>
    <element name="Email" type="string"/>
    <element name="ElectDest" type="string"/>
    </sequence>
    </complexType>
    </element>
    <element name="PostMessageResult">
    <complexType>
    <sequence>
    <element name="Result" type="string"/>
    <element name="Errors">
    <complexType>
    <sequence>
    <element name="Error">
    <complexType>
    <sequence>
    <element name="ErrorDescription" type="string"/>
    <element name="ErrorSource" type="string"/>
    </sequence>
    </complexType>
    </element>
    </sequence>
    </complexType>
    </element>
    </sequence>
    </complexType>
    </element>
    </schema>
    </types>
    <message name="HTTPPostServiceRequestMessage">
    <part name="payload" element="tns:AddressBookEntry"/>
    </message>
    <message name="HTTPPostServiceResponseMessage">
    <part name="payload" element="tns:PostMessageResult"/>
    </message>
    <portType name="HTTPPostService">
    <operation name="process">
    <input message="tns:HTTPPostServiceRequestMessage" />
    <output message="tns:HTTPPostServiceResponseMessage"/>
    </operation>
    </portType>
    <binding name="HTTPPost" type="tns:HTTPPostService">
    <http:binding verb="POST"/>
    <operation name="process">
    <http:operation location="/httpreceive.aspx"/>
    <input>
    <mime:mimeXml part="payload"/>
    <mime:content type="text/xml"/>
    </input>
    <output>
    <mime:mimeXml part="payload"/>
    <mime:content type="text/xml"/>
    </output>
    </operation>
    </binding>
    <service name="HTTPPostService">
    <port name="HTTPPost" binding="tns:HTTPPost">
    <http:address location="https://testxml.solutions.com"/>
    </port>
    </service>
    <!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    PARTNER LINK TYPE DEFINITION
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
    <plnk:partnerLinkType name="HTTPPostService">
    <plnk:role name="HTTPPostServiceProvider">
    <plnk:portType name="tns:HTTPPostService"/>
    </plnk:role>
    </plnk:partnerLinkType>
    </definitions>

  • How to receive XML from Flex HTTP POST

    Hi,
    We curreontly have a setup where we have a FLEX frontend send an XML through a HTTP POST and awaiting a response also in XML. On the backend this is handled relatively simply by a PHP script that basically does the following:
    read data (in XML)from FlEX HTTP POST into a new temp XML file.
    execute a c++ program with the XML file as one of the parameter.
    return the result to FLEX
    We have decided to move to BlazeDS for various reasons.
    Looking at the examples bundled with BlazeDS they have a jsp example that returns an XML result to FLEX so that part is fine. I am trying to find an example of JSP (or Servlet) that is able to read the XML data from FLEX and write it into a temp XML file. I would then try to use runtime.exec to invoke a local C++ program to process the XML file the result of which will be sent back to FLEX.
    Any help will be very much appreciated!

    <div class=Section1><br /><br /><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";<br />color:#1F497D'>I&#8217;d avoid calling an executable just to process XML &#8211;your<br />application server would provide enough support for reading and writing XML, no?<br />Also, if you&#8217;re only planning on working with XML then even BlazeDS might<br />be overkill because its focus is on sending strongly typed ActionScript data efficiently<br />to and from a client (it&#8217;s true that it does have a proxy service, but<br />that is not involved with processing the actual XML data).<o:p></o:p></span></p><br /><br /><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";<br />color:#1F497D'><o:p> </o:p></span></p><br /><br /><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";<br />color:#1F497D'>How complex is your XML? Do you need to resolve ids and<br />references or can you parse it top down in a single pass? There are several<br />well known libraries in Java for dealing with XML &#8211; the choice depends on<br />how you need to interact with the XML. Most of them take an InputStream as a<br />source for reading XML and you can get the InputStream from the servlet<br />request. Googling should turn up numerous examples.<o:p></o:p></span></p><br /><br /><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";<br />color:#1F497D'><o:p> </o:p></span></p><br /><br /><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";<br />color:#1F497D'>Pete<o:p></o:p></span></p><br /><br /><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";<br />color:#1F497D'><o:p> </o:p></span></p><br /><br /><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";<br />color:#1F497D'><o:p> </o:p></span></p><br /><br /><div style='border:none;border-left:solid blue 1.5pt;padding:0in 0in 0in 4.0pt'><br /><br /><div><br /><br /><div style='border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0in 0in 0in'><br /><br /><p class=MsoNormal><b><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'>From:</span></b><span<br />style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'> khwong<br />[mailto:[email protected]] <br><br /><b>Sent:</b> Sunday, September 28, 2008 12:09 PM<br><br /><b>To:</b> [email protected]<br><br /><b>Subject:</b> How to receive XML from Flex HTTP POST<o:p></o:p></span></p><br /><br /></div><br /><br /></div><br /><br /><p class=MsoNormal><o:p> </o:p></p><br /><br /><p class=MsoNormal style='margin-bottom:12.0pt'>A new discussion was started by<br />khwong in <br><br /><br><br /><b>General Discussion</b> --<br><br />  How to receive XML from Flex HTTP POST<br><br /><br><br />Hi, <br><br /><br><br />We curreontly have a setup where we have a FLEX frontend send an XML through a<br />HTTP POST and awaiting a response also in XML. On the backend this is handled<br />relatively simply by a PHP script that basically does the following: <br><br /><br><br />read data (in XML)from FlEX HTTP POST into a new temp XML file. <br><br />execute a c++ program with the XML file as one of the parameter. <br><br />return the result to FLEX <br><br /><br><br />We have decided to move to BlazeDS for various reasons. <br><br /><br><br />Looking at the examples bundled with BlazeDS they have a jsp example that<br />returns an XML result to FLEX so that part is fine. I am trying to find an<br />example of JSP (or Servlet) that is able to read the XML data from FLEX and<br />write it into a temp XML file. I would then try to use runtime.exec to invoke a<br />local C++ program to process the XML file the result of which will be sent back<br />to FLEX. <br><br /><br><br />Any help will be very much appreciated! <o:p></o:p></p><br /><br /><div class=MsoNormal><br /><br /><hr size=2 width=200 style='width:150.0pt' align=left><br /><br /></div><br /><br /><p class=MsoNormal style='margin-bottom:12.0pt'>View/reply at <a<br />href="http://www.adobeforums.com/webx?13@@.59b69b23">How to receive XML from<br />Flex HTTP POST</a><br><br />Replies by email are OK.<br><br />Use the <a<br />href="http://www.adobeforums.com/webx?280@@.59b69b23!folder=.3c061a83">unsubscribe</a>< br />form to cancel your email subscription.<o:p></o:p></p><br /><br /></div><br /><br /></div>

  • Beginner question: support to HTTP POST om Oracle AS

    Hi!
    I don't know if this is a suitable forum but since i use JDeveloper and Oracle BPEL I'll try my luck here :).
    I have a Java web application built in JDeveloper and a couple of BPEL processes.
    In these processes I use Java embedding (a piece of Java code) that opens a connection to a given URL and post a XML message to this URL. I didn't have much problems creating these processes.
    Now I have to provide a support to HTTP POST on my side. Since web application and services development are quite new to me I hope someone can point me the right way to do this. The requirements I have are: I can have a single URL to which the http POSTs will be issued.
    If I understand correctly I cant use a web service since I have to enable different types of XML posts. What are my options? Can I create some kind of listener for http POSTs? Can I create a jspx that will 'wait' for http posts and than call some of mine BPEL processes? Is there a way to create a BPEL process that 'waits' for http POSTs? Are there other options.
    I'd really appreciate any pointers on this.
    Regards,
    BB.

    Frank,
    I've tried creating a Servlet listener that implements HttpSessionListener interface. Now I have two methods, sessionCreated and sessionDestroyed but I don't know where to go next. I can't find any documentation on this issue yet.
    Should I create a jspx page with form node that has method attribute set to POST or maybe I don't even need a web page? I already have a login page that has a form with method set to POSt, will this pose any kind of troubles for me?
    I apologize for any stupid questions but as I said I have no experience in doing this and las couple of days I'm searching and reading different documentation on this topic so any more pointers would be appreciated.
    BB

  • Beginner question: support to HTTP POST at Oracle AS

    I tried same post on Application Server - General forum, but had no success.
    I have a Java web application built in JDeveloper and a couple of BPEL processes.
    In these processes I use Java embedding (a piece of Java code) that opens a connection to a given URL and post a XML message to this URL. I didn't have much problems creating these processes.
    Now I have to provide a support to HTTP POST on my side. Since web application and services development are quite new to me I hope someone can point me the right way to do this. The requirements I have are: I can have a single URL to which the http POSTs will be issued.
    If I understand correctly I cant use a web service since I have to enable different types of XML posts. What are my options? Can I create some kind of listener for http POSTs? Can I create a jspx that will 'wait' for http posts and than call some of mine BPEL processes? Is there a way to create a BPEL process that 'waits' for http POSTs? Are there other options.
    I'd really appreciate any pointers on this.
    Regards,
    BB.

    Frank,
    I've tried creating a Servlet listener that implements HttpSessionListener interface. Now I have two methods, sessionCreated and sessionDestroyed but I don't know where to go next. I can't find any documentation on this issue yet.
    Should I create a jspx page with form node that has method attribute set to POST or maybe I don't even need a web page? I already have a login page that has a form with method set to POSt, will this pose any kind of troubles for me?
    I apologize for any stupid questions but as I said I have no experience in doing this and las couple of days I'm searching and reading different documentation on this topic so any more pointers would be appreciated.
    BB

  • HTTP Post Action Block

    Greetings all,
    I am using a HTTP Post Action in BLS - Vs 11.5. 
    The objective is to return a HTTP string from a jsp page, so I can scrap the page. 
    The URL:  http://mospublic.ercot.com/ercot/jsp/balancing_services_mcp.jsp?marketdate=2008-06-16   (obviously you might have to change the date to Yesterdays Date)
    I have set up the HTTP Post Action with
    URL Address of:   http://mospublic.ercot.com/ercot/jsp/balancing_services_mcp.jsp
    Post Document:   marketdate=2008-06-16
    Encoding: UTF-8
    ID and Password are provided
    Content Type:   application/x-www-form-urlencoded
    Post_0.ReturnAsString comes back with typical HTML content for Today's Date.
    Testing has shown that on a fresh IE window.  Using the above url will show today's data. 
    Hitting this url again the second time will get the browser to yesterday's data.
    So any suggestions on how to make this happen. 
    (btw, I have no control over the external public ERCOT website so changing thier jsp page isn't an option.)
    Anyway we could emulate that action in BLS - v11.5?
    Thanks
    Dennis

    It's not working for me???
    Did that work for you?
    I have attached my sample... It's a repeater, a http Post and a tracer. 
    <?xml version="1.0" encoding="UTF-8"?>
    <Transaction xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
         <TransactionAttributes>
              <ContextItem>
                   <Name>Description</Name>
                   <Description>Transaction Description</Description>
                   <MinRange>0</MinRange>
                   <MaxRange>0</MaxRange>
                   <Value xsi:type="xsd:string"/>
                   <ReadOnly>true</ReadOnly>
              </ContextItem>
         </TransactionAttributes>
         <Name>west_test/html Post Question</Name>
         <Version>1</Version>
         <WriterRoles/>
         <ReaderRoles/>
         <Context/>
         <Local/>
         <Layout>
              <GUILayoutItem>
                   <Name>Sequence</Name>
                   <X>8</X>
                   <Y>8</Y>
                   <Width>120</Width>
                   <SpacingWidth>120</SpacingWidth>
                   <DescendantWidth>120</DescendantWidth>
                   <Height>96</Height>
              </GUILayoutItem>
              <GUILayoutItem>
                   <Name>Post_0</Name>
                   <X>16</X>
                   <Y>24</Y>
                   <Width>104</Width>
                   <SpacingWidth>0</SpacingWidth>
                   <DescendantWidth>0</DescendantWidth>
                   <Height>72</Height>
              </GUILayoutItem>
              <GUILayoutItem>
                   <Name>Sequence_0</Name>
                   <X>8</X>
                   <Y>136</Y>
                   <Width>120</Width>
                   <SpacingWidth>120</SpacingWidth>
                   <DescendantWidth>0</DescendantWidth>
                   <Height>96</Height>
              </GUILayoutItem>
              <GUILayoutItem>
                   <Name>Tracer_0</Name>
                   <X>16</X>
                   <Y>152</Y>
                   <Width>104</Width>
                   <SpacingWidth>0</SpacingWidth>
                   <DescendantWidth>0</DescendantWidth>
                   <Height>72</Height>
              </GUILayoutItem>
         </Layout>
         <Actions>
              <ContextItem>
                   <Name>Post_0</Name>
                   <Description/>
                   <MinRange>0</MinRange>
                   <MaxRange>0</MaxRange>
                   <Value xsi:type="Post">
                        <URL>http://mospublic.ercot.com/ercot/jsp/balancing_services_mcp.jsp?marketdate=2008-06-18</URL>
                        <Encoding>UTF-8</Encoding>
                        <ContentType>text/html</ContentType>
                        <Timeout>60</Timeout>
                        <UserName>YOUSUPPLY</UserName>
                        <PostData/>
                        <UserPassword>YOUROWN</UserPassword>
                        <ReturnAsString/>
                        <ReturnAsXML>
                             <ReferenceDocumentSource/>
                        </ReturnAsXML>
                   </Value>
                   <ReadOnly>false</ReadOnly>
              </ContextItem>
              <ContextItem>
                   <Name>Tracer_0</Name>
                   <Description/>
                   <MinRange>0</MinRange>
                   <MaxRange>0</MaxRange>
                   <Value xsi:type="Tracer">
                        <Level>INFO</Level>
                        <Message/>
                   </Value>
                   <ReadOnly>false</ReadOnly>
              </ContextItem>
         </Actions>
         <Steps>
              <Step xsi:type="ActionSequence">
                   <Name>Sequence</Name>
                   <Description/>
                   <Steps>
                        <Step xsi:type="ActionSequence">
                             <Name>Sequence_0</Name>
                             <Description/>
                             <Steps/>
                             <Actions>
                                  <Action>
                                       <Name>Tracer_0</Name>
                                       <Description/>
                                       <IncomingLinks>
                                            <Assign xsi:type="Assign">
                                                 <Name/>
                                                 <Description/>
                                                 <To>Tracer_0.Message</To>
                                                 <From>Post_0.ReturnAsString</From>
                                            </Assign>
                                       </IncomingLinks>
                                       <OutgoingLinks/>
                                  </Action>
                             </Actions>
                        </Step>
                   </Steps>
                   <Actions>
                        <Action>
                             <Name>Post_0</Name>
                             <Description/>
                             <IncomingLinks>
                                  <Assign xsi:type="Assign">
                                       <Name/>
                                       <Description/>
                                       <To>Post_0.URL</To>
                                       <From>"http://mospublic.ercot.com/ercot/jsp/balancing_services_mcp.jsp?marketdate=" &amp; datefromxmlformat( datenow, "yyyy-MM-dd")"</From>
                                  </Assign>
                             </IncomingLinks>
                             <OutgoingLinks/>
                        </Action>
                   </Actions>
              </Step>
         </Steps>
    </Transaction>

Maybe you are looking for