Hi Nuwan,

I have two files bamUtil.js and bam.jag

bamUtil.js

*var createStream = function(createStreamDefnURL , streamDefn,
optionalHeaders){
var result = post(createStreamDefnURL, streamDefn, optionalHeaders);
 };

*
bam.jag

<%
         var bamUtils = require("bamUtil.js");
    var streamDefn = stringify( {
      "name":"stockquote.stream",
      "version": "1.0.2",
      "nickName": "Stock Quote Information",
      "description": "Some Desc",
      "tags":["foo", "bar"],
      "metaData":[
       {
         "name":"ipAdd",
         "type":"STRING"
       }
      ],
      "payloadData":[
      {
        "name":"symbol",
        "type":"string"
      },
      {
        "name":"price",
        "type":"double"
      },
      {
        "name":"volume",
        "type":"int"
      },
      {
        "name":"max",
        "type":"double"
      },
      {
        "name":"min",
        "type":"double"
      }
     ]
    });

    var events = stringify([
     {
       "payloadData" : ["IBM", 26.0, 848, 43.33, 2.3] ,
       "metaData" : ["123.233.0.1"] ,
       "timeStamp" : 1312345432
     },
     {
      "payloadData" : ["MSFT", 22.0, 233, 22.22, 4.3] ,
      "metaData" : ["5.211.1.1"]
     }
    ]);
    var optionalHeaders = {
    "Accept": "application/json",
        "Content-Type": "application/json",
    "Authorization": "Basic YWRtaW46YWRtaW4="};
       var createStreamDefnURL = '
https://localhost:9443/datareceiver/1.0.0/streams';
     var publishEventURL = '
https://localhost:9443/datareceiver/1.0.0/stream/stockquote.stream/1.0.2/';
    var result = bamUtils.createStream(createStreamDefnURL,streamDefn,
optionalHeaders);
    //var result1 = bamUtils.publishEvent(publishEventURL,events,
optionalHeaders);

   %>

This is for the record Nuwan. Manu has fixed it thanks Manu and noted.



On Wed, May 29, 2013 at 10:33 AM, Nuwan Bandara <[email protected]> wrote:

> Can you share you jaggery code that does the HTTP call.
>
> Regards,
> /Nuwan
>
>
> On Wed, May 29, 2013 at 10:17 AM, Gayan Dhanushka <[email protected]> wrote:
>
>> Hi,
>>
>> Note $subject as we discovered yesterday. It is there in the latest
>> jaggery-0.9.0.ALPHA3-wso2v6 pack as well.
>>
>> I'm sending a rest call to BAM using Jaggery and following are my
>> optional headers.
>>
>> *{
>>     "Accept": "application/json",
>>     "Content-Type": "application/json",
>>     "Authorization": "Basic YWRtaW46YWRtaW4="
>> }
>>
>> *
>> In the BAM server log it says,
>>
>> *No operation matching request path "/datareceiver/1.0.0/streams" is
>> found, Relative Path: /, HTTP Method: POST, ContentType:
>> application/x-www-form-urlencoded;charset=UTF-8, Accept: application/json
>> *
>>
>> I may proceed correcting this manually. What is the path for the .js file
>> which contains post method implementation?
>>
>> Thanks.
>>
>> --
>>
>> Gayan Dhanushka
>> Software Engineer
>> WSO2 Inc.
>> http://wso2.com
>>
>> Mobile : 0716662327
>>
>> _______________________________________________
>> Dev mailing list
>> [email protected]
>> http://wso2.org/cgi-bin/mailman/listinfo/dev
>>
>>
>
>
> --
> *Thanks & Regards,
>
> Nuwan Bandara
> Technical Lead & Member, MC, Development Technologies
> WSO2 Inc. - lean . enterprise . middleware |  http://wso2.com
> blog : http://nuwanbando.com; email: [email protected]; phone: +94 11 763
> 9629
> *
> <http://www.nuwanbando.com/>
>



-- 

Gayan Dhanushka
Software Engineer
WSO2 Inc.
http://wso2.com

Mobile : 0716662327
_______________________________________________
Dev mailing list
[email protected]
http://wso2.org/cgi-bin/mailman/listinfo/dev

Reply via email to