Re: [Dev] [ESB] Sending POST requests with x-www-form-urlencoded content type

2014-01-22 Thread Krishantha Dinesh
Hi Ramindu..
in my case i needed DISABLE_CHUNKING as well



http://schemas.xmlsoap.org/soap/envelope/";>



$1
$2
 







 




  


  



On Wed, Jan 22, 2014 at 6:47 PM, Ramindu Deshapriya wrote:

> Managed to solve this problem through adding a Payload Factory mediator
> with the following format:
>
> 
> 
>  http://schemas.xmlsoap.org/soap/envelope/";>
> 
>  
> 
> $1
>  $2
> 
> 
>  
> 
> 
>  
> 
>  
> 
>
>   scope="axis2" />
>
> Thanks.
>
>
> On Wed, Jan 22, 2014 at 6:39 PM, Chanaka Fernando wrote:
>
>> Hi Ramindu,
>>
>> Please attach your configurations with the mail.
>>
>> Thanks,
>> Chanaka
>>
>>
>>
>>
>
> --
> Au revoir!
> Ramindu Deshapriya.
>
> Member - Sahana Software Foundation http://sahanafoundation.org
> http://rdeshapriya.com
>
> 
> 
> 
>   
>  
>
>
> ___
> Dev mailing list
> Dev@wso2.org
> http://wso2.org/cgi-bin/mailman/listinfo/dev
>
>
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


Re: [Dev] Need help with Cassandra

2014-01-23 Thread Krishantha Dinesh
"when I ran it with sudo it says "Command not found"."

*open the shell script and read. it may have command which is not available
on your platform*


On Thu, Jan 23, 2014 at 1:09 PM, Chamila Wijayarathna wrote:

> Hi all,
> For out intern project, we are using CEP with cassandra output adapter.
> For observation purposes we downloaded cassandra from [1] and tried to run
> ./cqlsh from bin folder. It says that "bash: ./cqlsh: Permission denied",
> when I ran it with sudo it says "Command not found".
>  When I ran chmod u+x cqlsh and then tried ./cqlsh, now it says that
> "Can't locate transport factory function
> cqlshlib.tfactory.regular_transport_factory". What is the problem here?
>
> Thank You.
>
> --
> *Chamila Wijayarathna*
> Engineering Intern,
> WSO2 Inc.
>
>
> ___
> Dev mailing list
> Dev@wso2.org
> http://wso2.org/cgi-bin/mailman/listinfo/dev
>
>
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


Re: [Dev] HTTP POST multipart/form-data via ESB

2014-01-29 Thread Krishantha Dinesh
Update:
I realize this

i have enables this on axis.xml
   

then entire formdata removed when leaving  from ESB

when i put this


its added --MIMEBoundary_f87531fc30be8d54586c12407e50802a83e6f39add1ac30f
as boundary while request comes as
Content-Type: multipart/form-data;
boundary="=_Part_5_1348483079.1390998843200"

messge builder set as
 

in this case problem is parameter not set with value. following combination
is work but problem is override the boundary name






any idea...
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


Re: [Dev] HTTP POST multipart/form-data via ESB

2014-01-29 Thread Krishantha Dinesh
*Pls find the behaviors of output based on axis to relay configuration*


*INPUT to ESB*


POST /services/postPhotoToAlbumHttpSoap11Endpoint HTTP/1.1

Accept-Encoding: gzip,deflate

Content-Type: text/xml;charset=UTF-8

SOAPAction: "urn:mediate"

Content-Length: 488

Host: localhost:8280

Connection: Keep-Alive

User-Agent: Apache-HttpClient/4.1.1 (java 1.5)

X-Forwarded-For: 127.0.0.1





http://schemas.xmlsoap.org/soap/envelope/";>

  

  

  


CAACEdEose0cBAMotx64LhZBfX7VXAgdt1zsHJCnwJRewdi55clZBUIb6FdRdBKoU4INqXPI5NekgGkPEf5FwIk3ASIZBqmJQPkomlOZAxvj2tusLPl57tUk1RZBGvNq8iQmWKuoW1KsUerxhI4vA1Nol5DvQj4oVLqVO6hwTaC9rArNSWIbr99DZApGxIA5YGxFGi8E0JotgZDZD



  

  




output from ESB
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


Re: [Dev] HTTP POST multipart/form-data via ESB

2014-01-29 Thread Krishantha Dinesh
*More information*


*Pls find the behaviors of output based on axis to relay configuration*


*INPUT to ESB*


POST /services/postPhotoToAlbumHttpSoap11Endpoint HTTP/1.1

Accept-Encoding: gzip,deflate

Content-Type: text/xml;charset=UTF-8

SOAPAction: "urn:mediate"

Content-Length: 488

Host: localhost:8280

Connection: Keep-Alive

User-Agent: Apache-HttpClient/4.1.1 (java 1.5)

X-Forwarded-For: 127.0.0.1





http://schemas.xmlsoap.org/soap/envelope/";>

  

  

  


CAACEdEose0cBAMotx64LhZBfX7VXAgdt1zsHJCnwJRewdi55clZBUIb6FdRdBKoU4INqXPI5NekgGkPEf5FwIk3ASIZBqmJQPkomlOZAxvj2tusLPl57tUk1RZBGvNq8iQmWKuoW1KsUerxhI4vA1Nol5DvQj4oVLqVO6hwTaC9rArNSWIbr99DZApGxIA5YGxFGi8E0JotgZDZD



  

  




output from ESB
BinaryRelayBuilder<->ExpandingMessageFormatter

POST /10150897830516344/photos HTTP/1.1

Accept-Encoding: gzip,deflate

X-Forwarded-For: 127.0.0.1

Content-Type: multipart/form-data

SOAPAction: "urn:mediate"

Transfer-Encoding: chunked

Host: graph.facebook.com:443

Connection: Keep-Alive

User-Agent: Synapse-PT-HttpComponents-NIO

X-Forwarded-For: 127.0.0.1, 127.0.0.1



201

http://schemas.xmlsoap.org/soap/envelope/";>http://ws.apache.org/ns/synapse
">CAACEdEose0cBAMotx64LhZBfX7VXAgdt1zsHJCnwJRewdi55clZBUIb6FdRdBKoU4INqXPI5NekgGkPEf5FwIk3ASIZBqmJQPkomlOZAxvj2tusLPl57tUk1RZBGvNq8iQmWKuoW1KsUerxhI4vA1Nol5DvQj4oVLqVO6hwTaC9rArNSWIbr99DZApGxIA5YGxFGi8E0JotgZDZD

0

BinaryRelayBuilder<-> MultipartFormDataFormatter









 fromESB

--MIMEBoundary_4005c93d90f5f09d8bd30c0691e5b1ddf2192b5c862bdf91

Content-Disposition: form-data; name="access_token"

Content-Type: text/plain; charset=US-ASCII

Content-Transfer-Encoding: 8bit



CAACEdEose0cBAMotx64LhZBfX7VXAgdt1zsHJCnwJRewdi55clZBUIb6FdRdBKoU4INqXPI5NekgGkPEf5FwIk3ASIZBqmJQPkomlOZAxvj2tusLPl57tUk1RZBGvNq8iQmWKuoW1KsUerxhI4vA1Nol5DvQj4oVLqVO6hwTaC9rArNSWIbr99DZApGxIA5YGxFGi8E0JotgZDZD

--MIMEBoundary_4005c93d90f5f09d8bd30c0691e5b1ddf2192b5c862bdf91

Content-Disposition: form-data; name="source"

Content-Type: text/plain; charset=US-ASCII

Content-Transfer-Encoding: 8bit





--MIMEBoundary_4005c93d90f5f09d8bd30c0691e5b1ddf2192b5c862bdf91--


MultipartFormDataBuilder<-> ExpandingMessageFormatter


POST /10150897830516344/photos HTTP/1.1

Accept-Encoding: gzip,deflate

X-Forwarded-For: 127.0.0.1

Content-Type: multipart/form-data

SOAPAction: "urn:mediate"

Transfer-Encoding: chunked

Host: graph.facebook.com:443

Connection: Keep-Alive

User-Agent: Synapse-PT-HttpComponents-NIO

X-Forwarded-For: 127.0.0.1, 127.0.0.1



201

http://schemas.xmlsoap.org/soap/envelope/";>http://ws.apache.org/ns/synapse
">CAACEdEose0cBAMotx64LhZBfX7VXAgdt1zsHJCnwJRewdi55clZBUIb6FdRdBKoU4INqXPI5NekgGkPEf5FwIk3ASIZBqmJQPkomlOZAxvj2tusLPl57tUk1RZBGvNq8iQmWKuoW1KsUerxhI4vA1Nol5DvQj4oVLqVO6hwTaC9rArNSWIbr99DZApGxIA5YGxFGi8E0JotgZDZD

0


MultipartFormDataBuilder <-> MultipartFormDataFormatter

POST /10150897830516344/photos HTTP/1.1

Accept-Encoding: gzip,deflate

X-Forwarded-For: 127.0.0.1

Content-Type: multipart/form-data

SOAPAction: urn:mediate

Transfer-Encoding: chunked

Host: graph.facebook.com:443

Connection: Keep-Alive

User-Agent: Synapse-PT-HttpComponents-NIO

X-Forwarded-For: 127.0.0.1, 127.0.0.1



29c

--MIMEBoundary_588b3db44ce49dd52107589eea5fdcdc3d9a943eeeadcc5a

Content-Disposition: form-data; name="access_token"

Content-Type: text/plain; charset=US-ASCII

Content-Transfer-Encoding: 8bit



CAACEdEose0cBAMotx64LhZBfX7VXAgdt1zsHJCnwJRewdi55clZBUIb6FdRdBKoU4INqXPI5NekgGkPEf5FwIk3ASIZBqmJQPkomlOZAxvj2tusLPl57tUk1RZBGvNq8iQmWKuoW1KsUerxhI4vA1Nol5DvQj4oVLqVO6hwTaC9rArNSWIbr99DZApGxIA5YGxFGi8E0JotgZDZD

--MIMEBoundary_588b3db44ce49dd52107589eea5fdcdc3d9a943eeeadcc5a

Content-Disposition: form-data; name="source"

Content-Type: text/plain; charset=US-ASCII

Content-Transfer-Encoding: 8bit





--MIMEBoundary_588b3db44ce49dd52107589eea5fdcdc3d9a943eeeadcc5a--



0



On Thu, Jan 30, 2014 at 12:51 AM, Krishantha Dinesh wrote:

> *Pls find the behaviors of output based on axis to relay configuration*
>
>
> *INPUT to ESB*
>
>
> POST /services/postPhotoToAlbumHttpSoap11Endpoint HTTP/1.1
>
> Accept-Encoding: gzip,deflate
>
> Content-Type: text/xml;charset=UTF-8
>
> SOAPAction: "urn:mediate"
>
> Content-Length: 488
>
> Host: localhost:8280
>
> Connection: Keep-Alive
>
> User-Agent: Apache-HttpClient/4.1.1 (java 1.5)
>
> X-Forwarded-For: 127.0.0.1
>
>
>
> 
>
> http://schemas.xmlsoap.org/soap/envelope/
> ">
>
>   
>
>   
>
>   
>
>
> CAACEdEose0cBAMotx64LhZBfX7VXAgdt1zsHJCnwJRewdi55clZBUIb6FdRdBKoU4INqXPI5NekgGkPEf5FwIk3ASIZBqmJQPkomlOZAxvj2tusLPl57tUk1RZBGvNq8iQmWKuoW1KsUerxhI4vA1Nol5DvQj4oVLqVO6hwTaC9rArNSWIbr99DZApGxIA5YGxFGi8E0JotgZDZD
>
> 
>
>   
>
>   
>
> 
>
>
> output from ESB
>
>
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


[Dev] Exception handling on REST call

2014-02-07 Thread Krishantha Dinesh
I have used following code to handle error on soap call

proxy
==



http://www.w3.org/2003/05/soap-envelope";
value="get-property('FAULT_CODE')" />






Output
==
http://schemas.xmlsoap.org/soap/envelope/";>
   
  
 http://www.w3.org/2003/05/soap-envelope
">123456
 abc
 xyz
  
   



I need to know what is the best approach to handle exception on REST calls.

i tried to apply same way just for try but it only give ERROR_MESSAGE not
another...

my expectation is to deliver all exception to client (caller). eg:
transport error due to unavailable endpoint.. etc
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


Re: [Dev] Exception handling on REST call

2014-02-08 Thread Krishantha Dinesh
Great information. now i can take it forward. thanks for sharing it :)



On Sat, Feb 8, 2014 at 7:30 PM, Dushan Abeyruwan  wrote:

> Hi Kirshantha,
>   Handling fault has two flavors,
>
>- Handle internal fault such as service EP not available and all the
>issues related .
>- Handle Service faults.
>
>
>  Ideally when BE is SOAP and if it returns SOAP fault in order to handle
> such queries we normally append FORCE_ERROR_ON_SOAP_FAULT property, this
> works only of BE return Service faults and when such happen if we need to
> divert such responses to the faultSequence that we have defined.
>On the other hand if that is RESTful BE,  we do not have a inbuilt
> function  to determine whether its a fault at transport level, so the
> workaround that we normally do is to use the Filter base on the HTTP_SC.
>   If you look at [1] status codes represents 100 series and 200- series
> regards as non faulty responses, and other than that we can determine them
> as faults or defect, to overcome such station when deal with RESTful
> services personally I am using filters i.e
>
> OutSequence ..etc , below logic just evaluates the response and if that
> not falls between 200 series normally you can add your customize faulty
> response logic ..
>
>  
> 
>
>
>- can include payload
>   - can setup HTTP_SC to axis2 context
>   - can use  mediator to reply client with error.
>
>  ..
>  ..
>
> 
>  
>
>
> [1] http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html
>
>
>
>
>
> On Fri, Feb 7, 2014 at 7:54 PM, Krishantha Dinesh wrote:
>
>> I have used following code to handle error on soap call
>>
>> proxy
>> ==
>>
>> 
>> 
>> http://www.w3.org/2003/05/soap-envelope";
>> value="get-property('FAULT_CODE')" />
>> 
>> 
>> 
>> 
>> 
>>
>> Output
>> ==
>> http://schemas.xmlsoap.org/soap/envelope/";>
>>
>>   
>>  http://www.w3.org/2003/05/soap-envelope
>> ">123456
>>  abc
>>  xyz
>>   
>>
>> 
>>
>>
>> I need to know what is the best approach to handle exception on REST
>> calls.
>>
>> i tried to apply same way just for try but it only give ERROR_MESSAGE not
>> another...
>>
>> my expectation is to deliver all exception to client (caller). eg:
>> transport error due to unavailable endpoint.. etc
>>
>>
>> ___
>> Dev mailing list
>> Dev@wso2.org
>> http://wso2.org/cgi-bin/mailman/listinfo/dev
>>
>>
>
>
> --
> Dushan Abeyruwan | Associate Tech Lead
> Integration Technologies Team
> PMC Member Apache Synpase
> WSO2 Inc. http://wso2.com/
> Blog:http://dushansview.blogspot.com/
> Mobile:(0094)713942042
>
>
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


[Dev] Sending option json parameters

2014-02-09 Thread Krishantha Dinesh
Currently, we are developing a WSO2 ESB connetor for PPal REST API. "Store
Credit Card" API call in PPal is having four required parameters and five
optional parameters as shown in the below link.

https://developer.p--pal.com/webapps/developer/docs/api/#store-a-credit-card

Corresponding message payloadfactory for the aforementioned method was
created as below.



{
"number":"$1",
"type":"$2",
"expire_month":"$3",
"expire_year":"$4",
"payer_id":"$5",
"cvv2":"$6",
"first_name":"$7",
"last_name":"$8",
"billing_address":$9
}







Problem with this approach is that, when an optional parameters is not
passed, API gives a validation error saying "value is missing". The reason
for this is that, even though the value is empty, the attribute is still
there in the payload. Therefore the corresponding attribute/value pair
should be omitted from the payload when an optional parameter is not
passed.

This can be achieved by using filters to check the whether the optional
parameters are empty and creating the payloads accordingly. But when the
number of optional parameters increases, it becomes difficult to track each
and every combination of payload.

Is there a workaround for this issue?
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


Re: [Dev] Exception handling on REST call

2014-02-10 Thread Krishantha Dinesh
Hi Dushan/Dev
I tried ur solution and its work. but i have other question. when it catch
FAULT (500 error) on return message of client http code is 200 OK
for example let say endpoint is fail the it catch that fault. but in client
point of view http respond code of his response is 200

other than 500 client getting correct http response code. the problem may
be this is originate by ESB it self than come as response to ESB. btw is
there any solution for this.



On Sat, Feb 8, 2014 at 7:30 PM, Dushan Abeyruwan  wrote:

> Hi Kirshantha,
>   Handling fault has two flavors,
>
>- Handle internal fault such as service EP not available and all the
>issues related .
>- Handle Service faults.
>
>
>  Ideally when BE is SOAP and if it returns SOAP fault in order to handle
> such queries we normally append FORCE_ERROR_ON_SOAP_FAULT property, this
> works only of BE return Service faults and when such happen if we need to
> divert such responses to the faultSequence that we have defined.
>On the other hand if that is RESTful BE,  we do not have a inbuilt
> function  to determine whether its a fault at transport level, so the
> workaround that we normally do is to use the Filter base on the HTTP_SC.
>   If you look at [1] status codes represents 100 series and 200- series
> regards as non faulty responses, and other than that we can determine them
> as faults or defect, to overcome such station when deal with RESTful
> services personally I am using filters i.e
>
> OutSequence ..etc , below logic just evaluates the response and if that
> not falls between 200 series normally you can add your customize faulty
> response logic ..
>
>  
> 
>
>
>- can include payload
>   - can setup HTTP_SC to axis2 context
>   - can use  mediator to reply client with error.
>
>  ..
>  ..
>
> 
>  
>
>
> [1] http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html
>
>
>
>
>
> On Fri, Feb 7, 2014 at 7:54 PM, Krishantha Dinesh wrote:
>
>> I have used following code to handle error on soap call
>>
>> proxy
>> ==
>>
>> 
>> 
>> http://www.w3.org/2003/05/soap-envelope";
>> value="get-property('FAULT_CODE')" />
>> 
>> 
>> 
>> 
>> 
>>
>> Output
>> ==
>> http://schemas.xmlsoap.org/soap/envelope/";>
>>
>>   
>>  http://www.w3.org/2003/05/soap-envelope
>> ">123456
>>  abc
>>  xyz
>>   
>>
>> 
>>
>>
>> I need to know what is the best approach to handle exception on REST
>> calls.
>>
>> i tried to apply same way just for try but it only give ERROR_MESSAGE not
>> another...
>>
>> my expectation is to deliver all exception to client (caller). eg:
>> transport error due to unavailable endpoint.. etc
>>
>>
>> ___
>> Dev mailing list
>> Dev@wso2.org
>> http://wso2.org/cgi-bin/mailman/listinfo/dev
>>
>>
>
>
> --
> Dushan Abeyruwan | Associate Tech Lead
> Integration Technologies Team
> PMC Member Apache Synpase
> WSO2 Inc. http://wso2.com/
> Blog:http://dushansview.blogspot.com/
> Mobile:(0094)713942042
>
>
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


Re: [Dev] Exception handling on REST call

2014-02-10 Thread Krishantha Dinesh
Hi Dushan,
Thanks for prompt reply.
I do agree with you. my concern is http response got which client get on
transport headers.
pls refer below

This is what client get as exception

http://cd-rhettige/services/paypal_lookupSale";>

   101503

   Error connecting to the back end





this is the raw content. pls pay your attention for http status code

HTTP/1.1 200 OK

Authorization: Bearer OQaph7mMZJbvNDJ-8u9ICVm4Q4kkJmNj.w5dQJZ5u8E

Host: cd-rhettige:8280

Accept-Encoding: gzip,deflate

Content-Type: application/json

Date: Tue, 11 Feb 2014 05:06:58 GMT

Server: WSO2-PassThrough-HTTP

Transfer-Encoding: chunked

Connection: Keep-Alive



{  "error_code":"101503",

"error_message":"Error connecting to the back end"

 }



On Tue, Feb 11, 2014 at 10:04 AM, Dushan Abeyruwan  wrote:

> Hi,
> No its wrong, we shouldn't response with 200 OK for  exceptions. IMO ideal
> way as I think, to do this by keep the catalog of connector specific error
> code and embedded in the error message and explain those _ _connector
> specific error _ _  catalog in documentation more specifically, and
>  returning a generic error with status code to client.
>
> for error catalogs you could refer [1][2]
> [1]http://www.twilio.com/docs/errors/reference
> [2]
> http://www.stormpath.com/blog/spring-mvc-rest-exception-handling-best-practices-part-1
> e.g
>
>
> {
> "status": 404,
>* "code": 40483,*
> "message": "Oops! It looks like that file does not exist.",
> "developerMessage": "File resource for path /uploads/foobar.txt does not 
> exist.  Please wait 10 minutes until the upload batch completes before 
> checking again.",
> "moreInfo": "http://www.mycompany.com/errors/40483";
> }
>
>
>
> On Tue, Feb 11, 2014 at 9:51 AM, Krishantha Dinesh 
> wrote:
>
>> Hi Dushan/Dev
>> I tried ur solution and its work. but i have other question. when it
>> catch FAULT (500 error) on return message of client http code is 200 OK
>> for example let say endpoint is fail the it catch that fault. but in
>> client point of view http respond code of his response is 200
>>
>> other than 500 client getting correct http response code. the problem may
>> be this is originate by ESB it self than come as response to ESB. btw is
>> there any solution for this.
>>
>>
>>
>> On Sat, Feb 8, 2014 at 7:30 PM, Dushan Abeyruwan  wrote:
>>
>>> Hi Kirshantha,
>>>   Handling fault has two flavors,
>>>
>>>- Handle internal fault such as service EP not available and all the
>>>issues related .
>>>- Handle Service faults.
>>>
>>>
>>>   Ideally when BE is SOAP and if it returns SOAP fault in order to
>>> handle such queries we normally append FORCE_ERROR_ON_SOAP_FAULT property,
>>> this works only of BE return Service faults and when such happen if we need
>>> to divert such responses to the faultSequence that we have defined.
>>>On the other hand if that is RESTful BE,  we do not have a inbuilt
>>> function  to determine whether its a fault at transport level, so the
>>> workaround that we normally do is to use the Filter base on the HTTP_SC.
>>>   If you look at [1] status codes represents 100 series and 200- series
>>> regards as non faulty responses, and other than that we can determine them
>>> as faults or defect, to overcome such station when deal with RESTful
>>> services personally I am using filters i.e
>>>
>>> OutSequence ..etc , below logic just evaluates the response and if that
>>> not falls between 200 series normally you can add your customize faulty
>>> response logic ..
>>>
>>>  
>>> 
>>>
>>>
>>>- can include payload
>>>   - can setup HTTP_SC to axis2 context
>>>   - can use  mediator to reply client with error.
>>>
>>>  ..
>>>  ..
>>>
>>> 
>>>  
>>>
>>>
>>> [1] http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html
>>>
>>>
>>>
>>>
>>>
>>> On Fri, Feb 7, 2014 at 7:54 PM, Krishantha Dinesh 
>>> wrote:
>>>
>>>> I have used following code to handle error on soap call
>>>>
>>>> proxy
>>>> ==
>>>>
>>>&g

Re: [Dev] Exception handling on REST call

2014-02-11 Thread Krishantha Dinesh
problem solved. Thanks Dushan for guidance

regex based on [1]







[1] http://docs.wso2.org/display/ESB460/Error+Handling+and+Error+Codes



On Tue, Feb 11, 2014 at 10:48 AM, Dushan Abeyruwan  wrote:

> Hi
> You can setup HTTP_SC in axis2 context set 400 (which represents bad
> Request)
>
>
> On Tue, Feb 11, 2014 at 10:42 AM, Krishantha Dinesh 
> wrote:
>
>> Hi Dushan,
>> Thanks for prompt reply.
>> I do agree with you. my concern is http response got which client get on
>> transport headers.
>> pls refer below
>>
>> This is what client get as exception
>>
>> http://cd-rhettige/services/paypal_lookupSale";>
>>
>>101503
>>
>>Error connecting to the back end
>>
>> 
>>
>>
>> 
>> this is the raw content. pls pay your attention for http status code
>>
>> HTTP/1.1 200 OK
>>
>> Authorization: Bearer OQaph7mMZJbvNDJ-8u9ICVm4Q4kkJmNj.w5dQJZ5u8E
>>
>> Host: cd-rhettige:8280
>>
>> Accept-Encoding: gzip,deflate
>>
>> Content-Type: application/json
>>
>> Date: Tue, 11 Feb 2014 05:06:58 GMT
>>
>> Server: WSO2-PassThrough-HTTP
>>
>> Transfer-Encoding: chunked
>>
>> Connection: Keep-Alive
>>
>>
>>
>> {  "error_code":"101503",
>>
>> "error_message":"Error connecting to the back end"
>>
>>  }
>>
>>
>>
>> On Tue, Feb 11, 2014 at 10:04 AM, Dushan Abeyruwan wrote:
>>
>>> Hi,
>>> No its wrong, we shouldn't response with 200 OK for  exceptions. IMO
>>> ideal way as I think, to do this by keep the catalog of connector specific
>>> error code and embedded in the error message and explain those _ _connector
>>> specific error _ _  catalog in documentation more specifically, and
>>>  returning a generic error with status code to client.
>>>
>>> for error catalogs you could refer [1][2]
>>> [1]http://www.twilio.com/docs/errors/reference
>>> [2]
>>> http://www.stormpath.com/blog/spring-mvc-rest-exception-handling-best-practices-part-1
>>> e.g
>>>
>>>
>>>
>>> {
>>> "status": 404,
>>>* "code": 40483,*
>>> "message": "Oops! It looks like that file does not exist.",
>>> "developerMessage": "File resource for path /uploads/foobar.txt does 
>>> not exist.  Please wait 10 minutes until the upload batch completes before 
>>> checking again.",
>>> "moreInfo": "http://www.mycompany.com/errors/40483";
>>> }
>>>
>>>
>>>
>>> On Tue, Feb 11, 2014 at 9:51 AM, Krishantha Dinesh >> > wrote:
>>>
>>>> Hi Dushan/Dev
>>>> I tried ur solution and its work. but i have other question. when it
>>>> catch FAULT (500 error) on return message of client http code is 200 OK
>>>> for example let say endpoint is fail the it catch that fault. but in
>>>> client point of view http respond code of his response is 200
>>>>
>>>> other than 500 client getting correct http response code. the problem
>>>> may be this is originate by ESB it self than come as response to ESB. btw
>>>> is there any solution for this.
>>>>
>>>>
>>>>
>>>> On Sat, Feb 8, 2014 at 7:30 PM, Dushan Abeyruwan wrote:
>>>>
>>>>> Hi Kirshantha,
>>>>>   Handling fault has two flavors,
>>>>>
>>>>>- Handle internal fault such as service EP not available and all
>>>>>the issues related .
>>>>>- Handle Service faults.
>>>>>
>>>>>
>>>>>   Ideally when BE is SOAP and if it returns SOAP fault in order to
>>>>> handle such queries we normally append FORCE_ERROR_ON_SOAP_FAULT property,
>>>>> this works only of BE return Service faults and when such happen if we 
>>>>> need
>>>>> to divert such responses to the faultSequence that we have defined.
>>>>>On the other hand if that is RESTful BE,  we do not have a inbuilt
>>>>> function  to determine whether its a fault at transport level, so the
>>>>> workaround that we normally do is to use the Filter base on the HTTP_SC.
>>>>>   If you look at [1] status codes represents 100 series and 200-
>>>>> series regards 

[Dev] sending json body with "colan"

2014-02-13 Thread Krishantha Dinesh
I need to send following json to back end service. [1]
when i send it ESB give error [2] when it parsing.

any idea to achieve this ?

[1]

{

"accessKeyId": "AKIAIGURZM7GJ7TRO6KQ",

"secretAccessKey": "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",

"methodType": "PUT",

"contentType": "application/json",

"bucketName": "imagesBucket5",

"xAmzDate": "true",

"bucketUrl": "http://s3.amazonaws.com/imagesBucket5";,

"uriRemainder": "/?policy",

"bucketPolicy": {

   "Version":"2012-10-17",

   "Statement":[

{

"Sid":"Policy1",

"Effect":"Allow",

"Principal": {

"AWS": "*"},

"Action":["s3:GetObject"],

"Resource":"arn:aws:s3:::imagesBucket5/*",

"Condition":{

  "StringLike":{

 "aws:Referer":[

  "http://www.example.com/*";,

  "http://example.com/*";

 ]

  }

}

}

   ]

  }

}

[2]

Highlighted part is some json policy we should send with the request. This
json policy can be changed according granting permissions and giving access
restrictions to buckets. So according to that policy structure going to be
changed. When "aws:Referer" content included in the policy its gives below
error by the ESB.



[2014-02-13 15:41:50,176] ERROR - NativeWorkerPool Uncaught exception

org.apache.axiom.om.OMException: javax.xml.stream.XMLStreamException: Unbound
prefix: aws

at
org.apache.axiom.om.impl.builder.StAXOMBuilder.next(StAXOMBuilder.java:296)

at
org.apache.axiom.om.impl.llom.OMElementImpl.buildNext(OMElementImpl.java:653)

at
org.apache.axiom.om.impl.llom.OMNodeImpl.getNextOMSibling(OMNodeImpl.java:122)

at
org.apache.axiom.om.impl.llom.OMElementImpl.getNextOMSibling(OMElementImpl.java:343)

at
org.apache.axiom.om.impl.traverse.OMChildrenIterator.getNextNode(OMChildrenIterator.java:36)

at
org.apache.axiom.om.impl.traverse.OMAbstractIterator.hasNext(OMAbstractIterator.java:58)

at
org.apache.synapse.commons.json.JsonUtil.removeIndentations(JsonUtil.java:275)

at
org.apache.synapse.commons.json.JsonUtil.removeIndentations(JsonUtil.java:282)

at
org.apache.synapse.commons.json.JsonUtil.removeIndentations(JsonUtil.java:282)

at
org.apache.synapse.commons.json.JsonUtil.removeIndentations(JsonUtil.java:282)

at
org.apache.synapse.commons.json.JsonUtil.newJsonPayload(JsonUtil.java:390)

at
org.apache.synapse.commons.json.JsonUtil.newJsonPayload(JsonUtil.java:430)

at
org.apache.synapse.mediators.transform.PayloadFactoryMediator.mediate(PayloadFactoryMediator.java:136)

at
org.apache.synapse.mediators.transform.PayloadFactoryMediator.mediate(PayloadFactoryMediator.java:74)

at
org.apache.synapse.mediators.AbstractListMediator.mediate(AbstractListMediator.java:77)

at
org.apache.synapse.mediators.AbstractListMediator.mediate(AbstractListMediator.java:47)

at
org.apache.synapse.mediators.template.TemplateMediator.mediate(TemplateMediator.java:77)

at
org.apache.synapse.mediators.template.InvokeMediator.mediate(InvokeMediator.java:129)

at
org.apache.synapse.mediators.template.InvokeMediator.mediate(InvokeMediator.java:78)

at
org.apache.synapse.mediators.AbstractListMediator.mediate(AbstractListMediator.java:77)

at
org.apache.synapse.mediators.AbstractListMediator.mediate(AbstractListMediator.java:47)

at
org.apache.synapse.mediators.base.SequenceMediator.mediate(SequenceMediator.java:131)

at
org.apache.synapse.core.axis2.ProxyServiceMessageReceiver.receive(ProxyServiceMessageReceiver.java:166)

at org.apache.axis2.engine.AxisEngine.receive(AxisEngine.java:180)

at
org.apache.synapse.transport.passthru.ServerWorker.processNonEntityEnclosingRESTHandler(ServerWorker.java:336)

at
org.apache.synapse.transport.passthru.ServerWorker.processEntityEnclosingRequest(ServerWorker.java:377)

at
org.apache.synapse.transport.passthru.ServerWorker.run(ServerWorker.java:183)

at
org.apache.axis2.transport.base.threads.NativeWorkerPool$1.run(NativeWorkerPool.java:172)

at
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)

at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)

at java.lang.Thread.run(Thread.java:722)

Caused by: javax.xml.stream.XMLStreamException: Unbound prefix: aws

at
de.odysseus.staxon.base.AbstractXMLStreamScope.verify(AbstractXMLStreamScope.java:212)

at
de.odysseus.staxon.base.AbstractXMLStreamScope.setSt

[Dev] send attachment withservice chaining

2014-02-17 Thread Krishantha Dinesh
Use case:

   1. I need to call back end API with file as a attachment
   2. Its involve service chaining ( I need to call auth service first and
   get session from that and pass session along with file)
   3. when i call first service from proxy attachment get removed from
   messageContext when i looking it for process. [ because i am sending
   payload for first service call and request data getting deleted]
   4. then i used "callTemplate" from my template. but when i do so i am
   getting response for first call and i can see request body on tcpmon. but
   for second call i cant see anything on tcpmon and also backend not
   recognize the request

template code:

http://ws.apache.org/ns/synapse";>








http://localhost:/soap.php"; />



http://localhost:/soap.php";
/>









http://www.w3.org/2001/XMLSchema-instance";
xmlns:xsd="http://www.w3.org/2001/XMLSchema";
xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/";
xmlns:sug="http://www.sugarcrm.com/sugarcrm";>


http://schemas.xmlsoap.org/soap/encoding/";>
1671qvfrrqfc62j6kss1kdn30

$1
$2



























WORKING SCENARIO (without call template)
+
note: this result not acceptable as session is hard coded
this is the generated SOAP (got from tcp trace)


http://schemas.xmlsoap.org/soap/envelope/";
 xmlns:xsd="http://www.w3.org/2001/XMLSchema";
 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
 xmlns:sug="http://www.sugarcrm.com/sugarcrm";>
 
 http://schemas.xmlsoap.org/soap/encoding/";>
 http://ws.apache.org/ns/synapse";
xsi:type="xsd:string">1671qvfrrqfc62j6kss1kdn30
 http://ws.apache.org/ns/synapse";
xsi:type="sug:note_attachment">
 
 
 
 
 
 


NOT WORKING (with call
template)==
this is the generated SOAP (got from tcp trace)
still sessionID hard coded. pls ignore it


http://schemas.xmlsoap.org/soap/envelope/";
 xmlns:xsd="http://www.w3.org/2001/XMLSchema";
 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
 xmlns:sug="http://www.sugarcrm.com/sugarcrm";>
 
 http://schemas.xmlsoap.org/soap/encoding/";>
 http://ws.apache.org/ns/synapse";
xsi:type="xsd:string">1671qvfrrqfc62j6kss1kdn30
 http://ws.apache.org/ns/synapse";
xsi:type="sug:note_attachment">
 
 
 
 
 
 


Problem:

*how i can achieve my requirement?*

*how to skeep attachment without deleting when call for service 1 *

*OR*
*how i can fix this code to work with call template*
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


Re: [Dev] Handling Optional Parameter Issue in LinkedIn Connector

2014-02-18 Thread Krishantha Dinesh
Since this is GET method, you can construct URL using script mediator.

eg:
if(count!="")
{
apiUrl=apiUrl+'count='+count;
}

var startId=mc.getProperty('uri.var.startId');
if(startId!="")
{
apiUrl=apiUrl+'&start_id='+startId;
}

var startIndex=mc.getProperty('uri.var.startIndex');
if(startIndex!="")
{
apiUrl=apiUrl+'&start_index='+startIndex;
}


On Tue, Feb 18, 2014 at 3:13 PM, Jay  wrote:

> Hi,
>
> We are currently developing an ESB connector for Linkedin API, and having
> an
> issue in handling optional parameters for one of the API calls.  I have
> mentioned the reference for the API call below.
>
> http://developer.linkedin.com/documents/company-search#
>
> This method is having seven optional parameters and four of them which are
> mentioned below, do not have default values.
>
> *   facet
> *   start
> *   count
> *   sort
>
> The problem we are facing is that, if those parameters with no default
> values are appended to the url, but values are not sent, then the API gives
> a validation error. Therefore we need to check whether the user has passed
> a
> value to a particular parameter (Which do not have a default value) and
> then
> form the endpoint accordingly.
>
>
>   
>  
>
>   
>
> uri-template="{uri.var.apiUrl}/v1/companies/universal-name={uri.var.universalName}?oauth2_access_token={uri.var.accessToken}&keywords={uri.var.keywords}&hq-only={uri.var.hqOnly}&facets={uri.var.facets}&sort={uri.var.sort}&format=json"
> />
>
>  
>   
>
>
> If we follow the aforementioned methodology, we will have to use sixteen
> filters to filter out the optional parameters with no default values and
> form the endpoint accordingly. With sixteen filters, the synapse file will
> become bulky. Is there an alternative way to handle this issue?
>
> Thank you.
>
>
>
>
> --
> View this message in context:
> http://wso2-oxygen-tank.10903.n7.nabble.com/Handling-Optional-Parameter-Issue-in-LinkedIn-Connector-tp92339.html
> Sent from the WSO2 Development mailing list archive at Nabble.com.
> ___
> Dev mailing list
> Dev@wso2.org
> http://wso2.org/cgi-bin/mailman/listinfo/dev
>
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


[Dev] Script mediator vs Filter mediator

2014-02-20 Thread Krishantha Dinesh
Hi,
I have short question.
is there any significant performance hit between script mediator and filter
mediator?
what is recommended to use?
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


Re: [Dev] Script mediator vs Filter mediator

2014-02-20 Thread Krishantha Dinesh
currently i am involving some significant development with WSO2 ESB. for
that i need to to some comparison and URL construction. (basically string
operations) those task can do using filter mediator as well as script
mediator. but when use filter mediator code become so bulky and ugly :(
when use script mediator its easy to read , maintainable and nice...
since those are non functional iam concern about performance.

for example (given two example are NOT same or relevant)

[1]




[2] filter


































































___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


Re: [Dev] ESB: Issue with setting timeout values dynamically

2014-02-21 Thread Krishantha Dinesh
try this

http://ws.apache.org/ns/synapse";>
> 
> 
> 
> 
>
> 
> 
> 
> $timout_duration
> fault
> 
> 
>
> $initial_duration
>
> $progressafactor
>
> $maximumDuration
> 
> 
> 
> 
>
> Call the endpoint:
> 
>  template="[timeout template path]">
>  value="6000" />
>  value="2000" />
>  value="2.0" />
>  value="3000" />
> 
> 
>
> Questions:
>
> 1. . How to set
> "timout_duration" parameter value dynamically? ex: taken from SOAP request
> and set value through expression="get-property('timeoutDuration')"
>
> 2. Anyway I tried, without timeout template, inside my synapse template
> with: 
> call:
> 
> 
> 
> 
> $timeoutDuration
> fault
> 
> 
> 2000
> 1.5
> 3000
> 
> 
> 
> 
>
> when template deployed:
> "Caused by: org.apache.synapse.SynapseException: Endpoint timeout duration
> expected as a number but was not a number", comes.
> if this way is poible, how to make $timeoutDuration as number?
>
>
>
> --
> View this message in context:
> http://wso2-oxygen-tank.10903.n7.nabble.com/ESB-Issue-with-setting-timeout-values-dynamically-tp92461.html
> Sent from the WSO2 Development mailing list archive at Nabble.com.
> ___
> Dev mailing list
> Dev@wso2.org
> http://wso2.org/cgi-bin/mailman/listinfo/dev
>
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


[Dev] send file content in message body

2014-02-25 Thread Krishantha Dinesh
Hi,
I need to send file content in message body.
how i can achieve this ? any idea

i am referring this [1]

PUT /my-image.jpg HTTP/1.1
Host: myBucket.s3.amazonaws.com
Date: Wed, 12 Oct 2009 17:50:00 GMT
Authorization: *authorization string*
Content-Type: text/plain
Content-Length: 11434
Expect: 100-continue
[11434 bytes of object data]


[1] http://docs.aws.amazon.com/AmazonS3/latest/API/RESTObjectPUT.html
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


[Dev] remove multiple header from response

2014-02-27 Thread Krishantha Dinesh
I'm  in the process of developing a connector for a backend API. As a part
of the response header, I get multiple "Set-Cookie" headers as shown below.

Set-Cookie: JSESSIONID="ajax:1613288983512332665"; Version=1; Path=/
Set-Cookie: bcookie="v=2&d90f407e-0cc7-4cdd-ab41-24118a8e9e8f"; Version=1;
Domain=linkedin.com; Max-Age=63072000; Expires=Sat, 27-Feb-2016 12:08:56
GMT; Path=/
Set-Cookie: lang="v=2&lang=en-us"; Version=1; Domain=linkedin.com; Path=/
Set-Cookie:
leo_auth_token="GST:U8wI3me16vI-3Gir1CPfA4eSCgdwXDOiITwqRR6PwedBfY4bxbeO69:1393502936:c5fe592b5d6cace7d781cf09a83a90f839598eb0";
Version=1; Max-Age=1799; Expires=Thu, 27-Feb-2014 12:38:55 GMT; Path=/
Set-Cookie: lidc="b=LB25:g=55:u=3:i=1393487710:t=1393522107:s=3827678994";
Expires=Thu, 27 Feb 2014 17:28:27 GMT; domain=.linkedin.com; Path=/
Set-Cookie: s_leo_auth_token="delete me"; Version=1; Max-Age=0;
Expires=Thu, 01-Jan-1970 00:00:10 GMT; Path=/
Set-Cookie: sl="delete me"; Version=1; Domain=.api.linkedin.com; Max-Age=0;
Expires=Thu, 01-Jan-1970 00:00:10 GMT; Path=/
Set-Cookie: sl="delete me"; Version=1; Max-Age=0; Expires=Thu, 01-Jan-1970
00:00:10 GMT; Path=/
Set-Cookie: visit="v=1&G"; Version=1; Max-Age=63072000; Expires=Sat,
27-Feb-2016 12:08:56 GMT; Path=/

I used the below mentioned code to remove  those "Set-Cookie" headers, but
it removed only one.



I tried using the same code with "Set-Cookie" header suffixes (eg:
JSESSIONID, bcookie) and also with asterisk (*), but it doesn't remove any
of the headers. Is there a workaround to solve this issue?
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


Re: [Dev] HTTP Patch support by ESB 4.8.1

2014-04-22 Thread Krishantha Dinesh
this is already experienced issue with above patch. hope malaka can help
you on solve this as he is already solve this on other connector

Malaka can you share the solution please


On Tue, Apr 22, 2014 at 5:09 PM, Madhawa Bandara  wrote:

> Hi,
> I applied the above patches and the requests with HTTP PATCH method work
> well now.
> But now I get a new exception for the requests in which a JSON payload is
> used (inside the script mediator with language="js"):
>
> com.sun.phobos.script.util.ExtendedScriptException:
> org.mozilla.javascript.EcmaError: ReferenceError: "JSON" is not defined.
>
> Note that these methods worked fine *before *applying the patch. Any
> suggestions?
>
>
> On Mon, Apr 21, 2014 at 10:38 AM, Malaka Silva  wrote:
>
>> Hi Kasun,
>>
>> It's already done.
>>
>> https://wso2.org/jira/browse/ESBJAVA-3051
>> https://wso2.org/jira/browse/ESBJAVA-3061
>>
>> Best Regards,
>> Malaka
>>
>>
>> On Mon, Apr 21, 2014 at 10:23 AM, Kasun Indrasiri  wrote:
>>
>>> Have we committed this in to trunk? If not please do so.
>>>
>>>
>>> On Mon, Apr 21, 2014 at 10:21 AM, Malaka Silva  wrote:
>>>
 Hi Mahawa,

 Currently it's not supported. It'll be available with the next release.
 ESB 4.9.0

 But there is a patch for this.

 Best Regards,
 Malaka


 On Mon, Apr 21, 2014 at 10:13 AM, Madhawa Bandara wrote:

> Hi,
> Does the ESB 4.8.1 support the HTTP patch method?
> When I make a http patch request, it is shown as an HTTP POST on the
> wire.
>
> --
> Regards,
>
> *Madhawa Bandara*
> Software Engineer
> WSO2, Inc.
> lean.enterprise.middleware
>
> Mobile - *+94777487726 <%2B94777487726>*
> Blog* - *classdeffound.blogspot.com
>
> ___
> Dev mailing list
> Dev@wso2.org
> http://wso2.org/cgi-bin/mailman/listinfo/dev
>
>


 --

 Best Regards,

 Malaka Silva
 Senior Tech Lead
 M: +94 777 219 791
 Tel : 94 11 214 5345
 Fax :94 11 2145300
 Skype : malaka.sampath.silva
 LinkedIn : http://www.linkedin.com/pub/malaka-silva/6/33/77
 Blog : http://mrmalakasilva.blogspot.com/

 WSO2, Inc.
 lean . enterprise . middleware
 http://www.wso2.com/
 http://www.wso2.com/about/team/malaka-silva/

 Save a tree -Conserve nature & Save the world for your future. Print
 this email only if it is absolutely necessary.

 ___
 Dev mailing list
 Dev@wso2.org
 http://wso2.org/cgi-bin/mailman/listinfo/dev


>>>
>>>
>>> --
>>> Kasun Indrasiri
>>> Software Architect
>>> WSO2, Inc.; http://wso2.com
>>> lean.enterprise.middleware
>>>
>>> cell: +94 77 556 5206
>>> Blog : http://kasunpanorama.blogspot.com/
>>>
>>
>>
>>
>> --
>>
>> Best Regards,
>>
>> Malaka Silva
>> Senior Tech Lead
>> M: +94 777 219 791
>> Tel : 94 11 214 5345
>> Fax :94 11 2145300
>> Skype : malaka.sampath.silva
>> LinkedIn : http://www.linkedin.com/pub/malaka-silva/6/33/77
>> Blog : http://mrmalakasilva.blogspot.com/
>>
>> WSO2, Inc.
>> lean . enterprise . middleware
>> http://www.wso2.com/
>> http://www.wso2.com/about/team/malaka-silva/
>>
>> Save a tree -Conserve nature & Save the world for your future. Print this
>> email only if it is absolutely necessary.
>>
>
>
>
> --
> Regards,
>
> *Madhawa Bandara*
> Software Engineer
> WSO2, Inc.
> lean.enterprise.middleware
>
> Mobile - *+94777487726 <%2B94777487726>*
> Blog* - *classdeffound.blogspot.com
>
> ___
> Dev mailing list
> Dev@wso2.org
> http://wso2.org/cgi-bin/mailman/listinfo/dev
>
>
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


Re: [Dev] HTTP Patch support by ESB 4.8.1

2014-04-23 Thread Krishantha Dinesh
Agreed with Miyuru. however this is experienced ONLY on WSO2 environment.
but not in our local environments.  that's why no idea what is the cause.
however i have noted this only cause when we use java script mediator.
appriciate any idea to solve this as few integration testing onhold due to
this un identified issue :)


On Wed, Apr 23, 2014 at 7:19 AM, Miyuru Wanninayaka  wrote:

> I can't imagine a way which fixed done in [1],[2] cause JSON issues in
> script mediator, it's a only minor change to http request factory and
> nothing to do with script mediator.  It should be a some other fix done
> early causing this issue.
>
> [1] https://wso2.org/jira/browse/ESBJAVA-3051
> [2] https://wso2.org/jira/browse/ESBJAVA-3061
>
>
> On Tue, Apr 22, 2014 at 1:14 PM, Krishantha Dinesh 
> wrote:
>
>> this is already experienced issue with above patch. hope malaka can help
>> you on solve this as he is already solve this on other connector
>>
>> Malaka can you share the solution please
>>
>>
>> On Tue, Apr 22, 2014 at 5:09 PM, Madhawa Bandara wrote:
>>
>>> Hi,
>>> I applied the above patches and the requests with HTTP PATCH method work
>>> well now.
>>> But now I get a new exception for the requests in which a JSON payload
>>> is used (inside the script mediator with language="js"):
>>>
>>> com.sun.phobos.script.util.ExtendedScriptException:
>>> org.mozilla.javascript.EcmaError: ReferenceError: "JSON" is not defined.
>>>
>>> Note that these methods worked fine *before *applying the patch. Any
>>> suggestions?
>>>
>>>
>>> On Mon, Apr 21, 2014 at 10:38 AM, Malaka Silva  wrote:
>>>
>>>> Hi Kasun,
>>>>
>>>> It's already done.
>>>>
>>>> https://wso2.org/jira/browse/ESBJAVA-3051
>>>> https://wso2.org/jira/browse/ESBJAVA-3061
>>>>
>>>> Best Regards,
>>>> Malaka
>>>>
>>>>
>>>> On Mon, Apr 21, 2014 at 10:23 AM, Kasun Indrasiri wrote:
>>>>
>>>>> Have we committed this in to trunk? If not please do so.
>>>>>
>>>>>
>>>>> On Mon, Apr 21, 2014 at 10:21 AM, Malaka Silva wrote:
>>>>>
>>>>>> Hi Mahawa,
>>>>>>
>>>>>> Currently it's not supported. It'll be available with the next
>>>>>> release. ESB 4.9.0
>>>>>>
>>>>>> But there is a patch for this.
>>>>>>
>>>>>> Best Regards,
>>>>>> Malaka
>>>>>>
>>>>>>
>>>>>> On Mon, Apr 21, 2014 at 10:13 AM, Madhawa Bandara 
>>>>>> wrote:
>>>>>>
>>>>>>> Hi,
>>>>>>> Does the ESB 4.8.1 support the HTTP patch method?
>>>>>>> When I make a http patch request, it is shown as an HTTP POST on the
>>>>>>> wire.
>>>>>>>
>>>>>>> --
>>>>>>> Regards,
>>>>>>>
>>>>>>> *Madhawa Bandara*
>>>>>>> Software Engineer
>>>>>>> WSO2, Inc.
>>>>>>> lean.enterprise.middleware
>>>>>>>
>>>>>>> Mobile - *+94777487726 <%2B94777487726>*
>>>>>>> Blog* - *classdeffound.blogspot.com
>>>>>>>
>>>>>>> ___
>>>>>>> Dev mailing list
>>>>>>> Dev@wso2.org
>>>>>>> http://wso2.org/cgi-bin/mailman/listinfo/dev
>>>>>>>
>>>>>>>
>>>>>>
>>>>>>
>>>>>> --
>>>>>>
>>>>>> Best Regards,
>>>>>>
>>>>>> Malaka Silva
>>>>>> Senior Tech Lead
>>>>>> M: +94 777 219 791
>>>>>> Tel : 94 11 214 5345
>>>>>> Fax :94 11 2145300
>>>>>> Skype : malaka.sampath.silva
>>>>>> LinkedIn : http://www.linkedin.com/pub/malaka-silva/6/33/77
>>>>>> Blog : http://mrmalakasilva.blogspot.com/
>>>>>>
>>>>>> WSO2, Inc.
>>>>>> lean . enterprise . middleware
>>>>>> http://www.wso2.com/
>>>>>> http://www.wso2.com/about/team/malaka-silva/<http://wso2.com/about/team/malaka-silva/>
>>>>>>
&