Click here to Skip to main content
15,892,072 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
This is my UI code frome where I want to pass the value to wcf service.
button#show.button Run Report
      |   
      |             
      dialog#window
      form(name='Demo', action='http://localhost:3000/', method='post')
        #datetimepicker.input-append
          input(type='text', name='start', value='Start Time:')
          |                     
          span.add-on
            i(data-time-icon='icon-time', data-date-icon='icon-calendar')
        |                 
        #datetimepicker1.input-append
          input(type='text', name='end', value='End Time:')
          |                     
          span.add-on
            i(data-time-icon='icon-time', data-date-icon='icon-calendar')
        |                 
        br
        |                 
        button.button1(onclick='soap()') OK
        |                 
        button#exit1.button1 Cancel


Here is my service method where i want to pass the request..

public bool OrderReport(SqlConnection conn, ref MarketOrderList MOListObj, long UserID, String AccountID, DateTime FromDate, DateTime ToDate, String ExchangeName, String ProductName, Days days, ref long nErrorCode, ref string strErrorText) 
        {



And this is my node,js code
var express = require('express');
//var bodyParser = require('body-parser');
var app = express();
//app.use(bodyParser());
var parseString = require('xml2js').parseString;
var BasicHttpBinding = require('wcf.js').BasicHttpBinding
        , Proxy = require('wcf.js').Proxy
        , binding = new BasicHttpBinding(
                {
                })

        , proxy = new Proxy(binding, "http://localhost:9877/IDBReport/basicHttp")
        , message = "<Envelope xmlns='http://schemas.xmlsoap.org/soap/envelope/'>" +
        "<Header />" +
        "<Body>" +
        "<OrderReport xmlns='http://tempuri.org/'>" +
        "<value></value>" +
        "<value></value>" +
        "<UserID>3</UserID>" +
        "<AccountID>countodts3</AccountID>" +
        "<FromDate>2016-12-20T08:11:46</FromDate>" +
        "<value></value>" +
        "<ExchangeName></ExchangeName>" +
        "<ProductName></ProductName>" +
        "<days>OneDay</days>" +
        "<value></value>" +
        "<value></value>" +
        "</OrderReport>" +
        "</Body>" +
        "</Envelope>";


proxy.send(message, "http://tempuri.org/IDBReport/OrderReport", function (message, ctx) {
    app.set("view engine", "jade");
   console.log(message);}


How to pass the parameter, I am not getting. Plz help me out.

What I have tried:

I have tried many things but I am not getting how to pass the parameter from UI to WCF service using node.js, Any help would be appreciated.
Posted
Updated 17-Jan-17 20:38pm

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900