Re: [Dev] Purpose of BOSH package 'common'

2018-01-16 Thread Imesh Gunaratne
Hi Chiranga,

On Wed, Jan 17, 2018 at 1:22 AM, Chiranga Alwis  wrote:

> Hi all,
>
> when analyzing the existing PCF BOSH implementations [1] [2], I
> encountered a package defined named 'common'. The rationale behind the
> existence of this package is not clear to me.
>

​The purpose of the common package is to manage utility functions required
by the packages available in the bosh release:
https://github.com/cf-platform-eng/sample-boshrelease/blob/master/src/common/utils.sh

Thanks
Imesh
​

>
>
> ​
>
> As you may know, BOSH packages provide the required information to prepare
> the binaries and dependencies for the jobs we define [3].
>
> Your help, ideas and suggestions are highly appreciated.
>
> [1]: https://github.com/wso2/pivotal-cf-is
> [2]: https://github.com/wso2/pivotal-cf-apim
> [3]: https://bosh.io/docs/create-release.html#pkg-skeletons
>
> --
> Yours sincerely,
>
> *Chiranga Alwis*
> Software Engineer | WSO2
>
> *Mobile : *+94775930497 <+94%2077%20593%200497>
> *Email: *chirangaal...@gmail.com
> *LinkedIn: *https://lk.linkedin.com/in/chiranga-alwis-391342a9
> *Medium:* https://medium.com/@chirangaalwis
>
> 
>



-- 
*Imesh Gunaratne*
WSO2 Inc: http://wso2.com
T: +94 11 214 5345 M: +94 77 374 2057
W: https://medium.com/@imesh TW: @imesh
lean. enterprise. middleware
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


Re: [Dev] [IAM] Access Token revocation in OAuthAdminService

2018-01-16 Thread Maduranga Siriwardena
Apart from the above, "triggerPostRevokeListeners" method invocation is
happening inside the loop sending the whole "AccessTokenDO" always [1].

So if the "AccessTokenDO" set has "n" number of objects,
"triggerPostRevokeListeners" method invocation is happening "n" times and
in each time, an array of "n" number of tokens are passed to the method.

[1]
https://github.com/wso2-extensions/identity-inbound-auth-oauth/blob/v5.5.178/components/org.wso2.carbon.identity.oauth/src/main/java/org/wso2/carbon/identity/oauth/OAuthAdminService.java#L706

Thanks,

On Wed, Jan 17, 2018 at 10:50 AM, Hasanthi Purnima Dissanayake <
hasan...@wso2.com> wrote:

> Hi All,
>
> In the method [1] which is used to revoke access tokens by resource
> owners, it iterates all ACTIVE or EXPIRED access tokens for the particular
> client authorized by the user.
>
> // retrieve all ACTIVE or EXPIRED access tokens for particular client 
> authorized by this user
>
>
> Set accessTokenDOs = OAuthTokenPersistenceFactory.g
> etInstance()
> .getAccessTokenDAO().getAccessTokens(appDTO.getOauthConsumerKey(),
> user, userStoreDomain, true);
> Inside the foreach the auth cache is cleared for the tokens one by one
> which is fetched from the accessTokenDOs.
>
> for (AccessTokenDO accessTokenDO : accessTokenDOs) { ...
> OAuthUtil.clearOAuthCache(accessTokenDO.getAccessToken());
>
>
> // retrieve latest access token for particular client, user and scope
> combination if its ACTIVE or EXPIRED
> scopedToken = OAuthTokenPersistenceFactory.getInstance().getAccessTokenDAO().
> getLatestAccessToken(appDTO.getOauthConsumerKey(), user, userStoreDomain,
> Auth2Util.buildScopeString(accessTokenDO.getScope()), true);  //Revoking
> token from database
> OAuthTokenPersistenceFactory.getInstance().getAccessTokenDAO()
> .revokeAccessTokens(new String[]{scopedToken.getAccessToken()});
>
> ...
> }
>
> Then inside the for each it self it retrieves the latest access token for
> the particular client, user and for the particular scope if the token is
> ACTIVE or EXPIRED. This token is revoked from the db inside the for each.
>
> I have two questions here.
>
> 1. We clear the auth cache based on the access token which is fetched from
> accessTokensDo  and revoke the scopedToken from the db which can be
> different.
>
> 2. As there are multiple db calls are happening here can't we move the
> logic of revoking token from db to out side of the for each as the DAO
> method is supporting for batch operations.
>
> Highly appreciate your feedback on this.
>
> [1] https://github.com/wso2-extensions/identity-inbound-
> auth-oauth/blob/master/components/org.wso2.carbon.
> identity.oauth/src/main/java/org/wso2/carbon/identity/
> oauth/OAuthAdminService.java#L627
>
> Thanks.
>
> --
>
> Hasanthi Dissanayake
>
> Senior Software Engineer | WSO2
>
> E: hasan...@wso2.com
> M :0718407133| http://wso2.com 
>



-- 
Maduranga Siriwardena
Senior Software Engineer
WSO2 Inc; http://wso2.com/

Email: madura...@wso2.com
Mobile: +94718990591
Blog: *https://madurangasiriwardena.wordpress.com/
*

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


Re: [Dev] [IS] Implemeting SAML SSO Agent in .NET

2018-01-16 Thread Chiran Wijesekara
[UPDATED]

Hi all,
I have updated the repo with by removing the SSOAgentAppListener class and
having SSO properties defined in an XML block inside web.config and wiring
it. Thus, there isn't any .settings file in the web application's
directory.
All the SSO related settings will have to be defined in the web.config
file(under appSettings section). Those properties will be initialized in
the init() method of the FilteringHTTPModule  (note: FilteringHTTPModule is
extended from IHttpModule )

Thanks!

On Wed, Jan 17, 2018 at 10:24 AM, Chiran Wijesekara 
wrote:

> [UPDATED]
>
> Hi all,
> I have updated the repo with by removing the SSOAgentAppListener class and
> having SSO properties defined in an XML block inside web.config and
> wiring it. Thus, there isn't any .settings file in the web application's
> directory.
> All the SSO related settings will have to be defined in the web.config
> file(under appSettings section). Those properties will be initialized in
> the init() method of the FilteringHTTPModule  (note: FilteringHTTPModule is
> extended from IHttpModule )
>
> Thanks!
>
> On Sat, Jan 13, 2018 at 7:09 AM, Chiran Wijesekara 
> wrote:
>
>> Hi TharinduE,
>> Thanks for your valuable comments. I will update the Readme file too.
>> Thanks.
>>
>> On Fri, Jan 12, 2018 at 8:32 PM, Tharindu Edirisinghe > > wrote:
>>
>>> Hi Chiran,
>>>
>>> If the repo size gets increased significantly due to the dependent DLLs,
>>> you can just add a readme to the repo pointing to all the dependencies and
>>> download links. This way those who want to test this out can download the
>>> dependencies manually, if those are missing in the environment.
>>>
>>> Thanks,
>>> TharinduE
>>>
>>> On Thu, Jan 11, 2018 at 10:32 PM, Chiran Wijesekara 
>>> wrote:
>>>
 Hi Tharindu,
 Thanks for the feedback. However, the reason was I omitted .dlls using
 .gitinore to keep the repo from getting too large in size.If it is better
 to have those .dlls in the repo, then I will add those to the next commit.
 Thanks

 On Fri, Jan 12, 2018 at 2:30 AM, Tharindu Edirisinghe <
 tharin...@wso2.com> wrote:

> Hi Chiran,
>
> It seems you hare using some external DLLs in the project *(see
> references.png)*, which are not packaged to the project. So when
> someone runs the solution, these DLLs might not be present in that
> environment and should be imported manually.
>
> So, IMO it's better to use "Copy Local" option *(see
> local_references.png)* for such references, so that the DLLs would be
> included in the project itself.
>
> This way, anybody would be able to simply run the project in Visual
> Studio and get it to working.
>
> Thanks,
> TharinduE
>
> On Thu, Jan 11, 2018 at 7:36 AM, Chiran Wijesekara 
> wrote:
>
>> Hi all,
>>
>> I am in the process of developing the $subject. This agent should be
>> pluggable to any ASP.NET web application. Repo is available at [1]
>> it has the sample and also the agent. Currently, I have developed it
>> with Http module(resides inside agent) and a listener(resides inside
>> agent) class. Furthermore, I am calling SSOAgentAppListener class
>> from Global.asax in the ASP.NET web application.
>>
>> However, I am also thinking about removing the SSOAgentAppListener
>> class by having SSO properties in an XML block inside web.config and
>> wiring it. Would be glad to have any recommendations on this.
>>
>> [1] https://github.com/chirankavinda123/saml-sso-agent-DOT-NET
>>
>> Thank you.
>>
>> --
>> *Chiran Wijesekara*
>>
>>
>> *Software Engineering Intern | WSO2*Email: chir...@wso2.com
>> Mobile: +94712990173web: www.wso2.com
>>
>> [image: https://wso2.com/signature] 
>>
>> ___
>> Dev mailing list
>> Dev@wso2.org
>> http://wso2.org/cgi-bin/mailman/listinfo/dev
>>
>>
>
>
> --
>
> Tharindu Edirisinghe
> Senior Software Engineer | WSO2 Inc
> Platform Security Team
> Blog : http://tharindue.blogspot.com
> mobile : +94 775181586 <+94%2077%20518%201586>
>



 --
 *Chiran Wijesekara*


 *Software Engineering Intern | WSO2*Email: chir...@wso2.com
 Mobile: +94712990173web: www.wso2.com

 [image: https://wso2.com/signature] 

>>>
>>>
>>>
>>> --
>>>
>>> Tharindu Edirisinghe
>>> Senior Software Engineer | WSO2 Inc
>>> Platform Security Team
>>> Blog : http://tharindue.blogspot.com
>>> mobile : +94 775181586 <+94%2077%20518%201586>
>>>
>>
>>
>>
>> --
>> *Chiran Wijesekara*
>>
>>
>> *Software Engineering Intern | WSO2*Email: chir...@wso2.com
>> Mobile: +94712990173web: www.wso2.com
>>
>> [image: 

[Dev] [Architecture][IS 5.5.0] Conditional steps based on HTTP context

2018-01-16 Thread Sathya Bandara
Hi all,

We are currently working on improving the conditional authentication
support using JavaScript feature [1] to be able to handle authentication
conditions based on HTTP context.

Following is the approach taken to achieve this requirement.

In order to store the HTTP request and response I have modified the default
AuthenticationContext class to have additional state variables for the
authentication request and response(current request and response). These
variables are declared as transient such that they will not be used for the
object state at serialization. Furthermore, an additional variable will be
used to keep a reference to the initial authentication request
(initialRequest). When the second request comes, we will only update the
current request and response variables.

The DefaultRequestCoordinator will be replaced with
ConditionalRequestCoordinator. In ConditionalRequestCordinator, inside
initializeFlow() method which gets called for the initial authentication
request, we instantiate an AuthenticationContext object. To this object, I
will set the current request, current response and initial request which is
the same as current request for the initial case. From the second request
for the ConditionalRequestCoordinator, only the current request and
response will be updated.

In addition to the changes in the authentication framework, I have
implemented JavaScript wrapper classes for the HttpServletRequest and
HttpServletResponse Java classes in order to provide access to the
request/response state variables within JavaScript. Following are some
examples.

*Request headers (context.request.headers)*

context.request.headers.Authorization - this will give the value of the
Authorization header.

*Request parameters (context.request.params)*

context.request.params.redirect_uri - this will give the value of the
request parameter redirect_uri

*Cookies in request (context.request.cookies)*

context.cookies.commonAuthId - this will create a JavaScript wrapper for
the Cookie Java Class. We can access individual cookie attributes using
this wrapper as follows.

context.request.cookies.commonAuthId.domain
context.request.cookies.commonAuthId.value

In request, we can only query existing attributes (headers and request
parameters). cannot add or modify existing values.

Similar approach was used for the HttpServletResponse class as well.
However in HttpServletResponse, we have the capability to add new headers
to the response.

*Adding headers to the response*

In order to wrap the setHeader() in JavaScript, I used the following
implementation.

public class JsHeaders extends AbstractJSObject {

private Map wrapped;
private HttpServletResponse response;

public JsHeaders(Map wrapped, HttpServletResponse response) {

this.wrapped = wrapped;
this.response = response;
}

@Override
public void setMember(String name, Object value) {

if (wrapped == null) {
super.setMember(name, value);
} else {
wrapped.put(name, value);
response.setHeader(name, (String) value); //replaces the value
if the name exists.
}
}
}

Here, I keep the existing headers in a map. Whenever
context.response.headers is called , an instance of the JsHeaders wrapper
is returned which contains the header map and a reference to the response.
Once a new header is added as in example context.response.headers.Authorization
= "sample_value", the setMember() function is called. It will add the
header (header name and value) to the referenced response.

e.g. context.response.headers["Content-Type"] = 'application/json'


*Adding cookies to the response *

Similarly, when adding a new cookie to the response, we will add a new
header to the response with the header name 'set-cookie'. This is similar
to the approach used in nodejs [2].

response.headers["set-cookie"] or response.headers.set-cookie can be used.

An example would be as follows.

response.headers.["Set-Cookie"] = ['crsftoken=xssometokenx',
'language=javascript']

Highly appreciate your thoughts and suggestions.

[1] [Architecture] Conditional Authentication Support on WSO2 Identity
Server
[2] https://nodejs.org/api/http.html#http_response_setheader_name_value


Thanks,
Sathya

-- 
Sathya Bandara
Software Engineer
WSO2 Inc. http://wso2.com
Mobile: (+94) 715 360 421 <+94%2071%20411%205032>

<+94%2071%20411%205032>
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


Re: [Dev] Select Error Codes section does not work properly when configuring an EndPoint

2018-01-16 Thread Malaka Gangananda
Hi Manuri/Heshitha,

Thanks for the input as you mentioned when html content is directly added
to the popup dialog body without encoding it as text it works fine.

Thanks,

On Wed, Jan 17, 2018 at 10:27 AM, Heshitha Hettihewa 
wrote:

> Hi Malaka,
>
> It seems the message(Popup body content) we are passing to the
> CARBON.showPopupDialog() function is html encoded inside the function[1].
> So the html content we are passing is considered as text and shown as text
> content inside the popup window body. So IMO we need to set the html
> content directly to the popup dialog body without encoding it as text.
>
> [1]. https://github.com/wso2/carbon-kernel/blob/4.4.x/core/
> org.wso2.carbon.ui/src/main/resources/web/dialog/js/dialog.js#L231
>
> Thanks,
> Heshitha.
>
> On Wed, Jan 17, 2018 at 10:14 AM, Malaka Gangananda 
> wrote:
>
>> Select Error Codes section does not work properly when configuring
>> advance properties of end points.
>> When Select Error Codes section is selected while trying to configure
>> suspend or timeout error codes in Address Endpoints it just pop up a html
>> code rather than showing the actual error codes as shown in below.
>>
>>
>> ​
>>
>>
>>
>>
>>
>> Reason behind this is in endpoint-utils.js code it uses
>> the CARBON.showPopupDialog method, and it passes the html code which needs
>> to create the pop up menu into this method.
>> But in showPopupDialog method it uses the htmlEncode method and convert
>> the html content into text and put within a newly created html section.
>> So the popup menu shown as text as mentioned above.
>> CARBON.showPopupDialog  method has been used to edit inline throttle
>> policy as well and that section also shows this error.
>> So how to proceed with this ?
>>
>> Thanks,
>> --
>> Malaka.
>> --
>> Malaka Gangananda - Software Engineer | WSO2
>> Email : mala...@wso2.com
>> Mobile : +94713564340 <+94%2071%20356%204340>
>> Web : http://wso2.com
>>   
>>
>
>
>
> --
> Heshitha Hettihewa
> *Software Engineer*
> Mobile : +94716866386
> <%2B94%20%280%29%20773%20451194>
> heshit...@wso2.com
>



-- 
Malaka.
-- 
Malaka Gangananda - Software Engineer | WSO2
Email : mala...@wso2.com
Mobile : +94713564340
Web : http://wso2.com
  
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


[Dev] Enrich mediator inside for-each not working properly. Please guide

2018-01-16 Thread vikram nayak
Hi,
Apologies I am raising the same issue again but this time with improved subject 
and content.Please consider what I have tried so far and Please Guide.
I have to add(suffix) a random number, to the values present in below tags in 
input request xml. 1) _JsonReader_PS_id2) _JsonReader_PS_ref
Input xml, Current Output xml,  Expected Output xml are attached.
After executing the sequences  attached in mail (UpdatingIds.xml, 
Sequence.xml), I expected that the value at line 63 in 
foreach_currentOutput.xml would be modified .
 <_JsonReader_PS_ref>1
It should have got modified to 
 <_JsonReader_PS_ref>16869
Similarly the value at line 27 , should not have been modified.
I also tried modifying other ids, by calling Sequence.xml from inside "For-each 
in Sequence.xml" if xpath=//Children/Children exists . But that also lead to 
many other wrong updations
Thanks

http://schemas.xmlsoap.org/soap/envelope/;>
	
		
			<_JsonReader_PS_id>16869
			

	<_JsonReader_PS_ref>16869

			
			
<_JsonReader_PS_id>46869



	<_JsonReader_PS_id>5	
	
		<_JsonReader_PS_id>6		
		
		
			<_JsonReader_PS_id>7			
			
			
<_JsonReader_PS_id>8


	<_JsonReader_PS_ref>76869

			
			
<_JsonReader_PS_id>10


	<_JsonReader_PS_ref>7

			
			
<_JsonReader_PS_id>12


	<_JsonReader_PS_ref>7


			
<_JsonReader_PS_id>14


	<_JsonReader_PS_ref>7

			
			
<_JsonReader_PS_id>16


	<_JsonReader_PS_ref>7

			
			
<_JsonReader_PS_ref>6
			
		
		
			<_JsonReader_PS_ref>5
		
		
	b5c75f37-6381-45f8-806b-c22a49ab6962
	
	
		<_JsonReader_PS_ref>4
	
	

	<_JsonReader_PS_ref>1

			
			
<_JsonReader_PS_id>196869


	<_JsonReader_PS_ref>16869

			
<_JsonReader_PS_id>216869


	<_JsonReader_PS_ref>16869


			
<_JsonReader_PS_id>236869


	<_JsonReader_PS_ref>16869

		
		
	

http://schemas.xmlsoap.org/soap/envelope/;>
	
		
			<_JsonReader_PS_id>16869
			

	<_JsonReader_PS_ref>16869

			
			
<_JsonReader_PS_id>46869



	<_JsonReader_PS_id>56869	
	
		<_JsonReader_PS_id>66869		
		
		
			<_JsonReader_PS_id>76869			
			
			
<_JsonReader_PS_id>86869


	<_JsonReader_PS_ref>76869

			
			
<_JsonReader_PS_id>106869


	<_JsonReader_PS_ref>76869

			
			
<_JsonReader_PS_id>126869


	<_JsonReader_PS_ref>76869


			
<_JsonReader_PS_id>146869


	<_JsonReader_PS_ref>76869

			
			
<_JsonReader_PS_id>166869


	<_JsonReader_PS_ref>76869

			
			
<_JsonReader_PS_ref>66869
			
		
		
			<_JsonReader_PS_ref>56869
		
		
	b5c75f37-6381-45f8-806b-c22a49ab6962
	
	
		<_JsonReader_PS_ref>46869
	
	

	<_JsonReader_PS_ref>16869

			
			
<_JsonReader_PS_id>196869


	<_JsonReader_PS_ref>16869

			
<_JsonReader_PS_id>216869


	<_JsonReader_PS_ref>16869


			
<_JsonReader_PS_id>236869


	<_JsonReader_PS_ref>16869

		
		
	

http://schemas.xmlsoap.org/soap/envelope/;>
	
		
			<_JsonReader_PS_id>1
			

	<_JsonReader_PS_ref>1

			
			
<_JsonReader_PS_id>4



	<_JsonReader_PS_id>5	
	
		<_JsonReader_PS_id>6		
		
		
			<_JsonReader_PS_id>7			
			
			
<_JsonReader_PS_id>8


	<_JsonReader_PS_ref>7

			
			
<_JsonReader_PS_id>10


	<_JsonReader_PS_ref>7

			
			
<_JsonReader_PS_id>12


	<_JsonReader_PS_ref>7


			
<_JsonReader_PS_id>14


	<_JsonReader_PS_ref>7

			
			
<_JsonReader_PS_id>16


	<_JsonReader_PS_ref>7

			
			
<_JsonReader_PS_ref>6
			
		
		
			<_JsonReader_PS_ref>5
		
		
	b5c75f37-6381-45f8-806b-c22a49ab6962
	
	
		<_JsonReader_PS_ref>4
	
	

	<_JsonReader_PS_ref>1

			
			
<_JsonReader_PS_id>19


	<_JsonReader_PS_ref>1

			
<_JsonReader_PS_id>21


	<_JsonReader_PS_ref>1


			
<_JsonReader_PS_id>23


	

Re: [Dev] Could not locate library smooks-libs/antlr-2.7.7.jar in bundle org.wso2.developerstudio.eclipse.esb.libraries, when adding library

2018-01-16 Thread Nipuni Chandrasoma
Hi Heshitha,

Thanks for the prompt response. I'll try out the mentioned resolutions and
let know if any other problem occurs.

Thanks,
Nipuni

On Tue, Jan 16, 2018 at 11:12 PM, Heshitha Hettihewa 
wrote:

> Hi Thomas/Nipuni,
>
> Thanks for pointing out. It seems Smooks libraries are not correctly
> packed with the developer studio distribution. I've added smooks libs to
> the org.wso2.developerstudio.eclipse.esb.libraries project build path
> with this[1] PR. This change will be released with the next Developer
> Studio release. Or else you can build from source[1] and install the built
> p2 to eclipse. As another workaround you can add these libraries manually
> to eclipse build path (As external jars pointing the file system location).
> You can find the list of jars here[3].
>
> [1]. https://github.com/wso2/devstudio-tooling-esb/pull/302
> [2]. https://github.com/wso2/devstudio-tooling-esb/
> [3]. https://github.com/Drifftr/devstudio-tooling-esb/tree/
> master/plugins/org.wso2.developerstudio.eclipse.esb.libraries/smooks-libs
>
> Thanks,
> Heshitha.
>
> On Tue, Jan 16, 2018 at 1:40 PM, Nipuni Chandrasoma 
> wrote:
>
>>
>> Hi all,
>>
>> I have tried the same scenario which is "Creating a Smooks configuration
>> artifact" by referring the documentation [1] and I get exactly the same
>> error [2] as mentioned.
>>
>> Any input on this is highly appreciated.
>>
>> [1]. https://docs.wso2.com/display/DVS380/Creating+ESB+Artif
>> acts#CreatingESBArtifacts-CreatingaSmooksconfigurationartifact
>> [2]. "Could not locate library smooks-libs/antlr-2.7.7.jar in bundle
>> org.wso2.developerstudio.eclipse.esb.libraries." and this is valid for
>> each runtime library file in the list.
>>
>>
>> Thanks
>> Nipuni
>>
>>
>> On Tue, Jan 16, 2018 at 1:28 PM, Sewmini Jayaweera 
>> wrote:
>>
>>> [Adding NipuniC]
>>>
>>> Sewmini Jayaweera
>>> *Software Engineer - Support Team*
>>> Mobile: +94 (0) 773 381 250 <+94%2077%20338%201250>
>>> sewm...@wso2.com
>>>
>>> On Wed, Dec 14, 2016 at 6:56 PM, Schürpf, Thomas <
>>> thomas.schue...@koch-it.ch> wrote:
>>>
 We are using the WSO2 ESB Tooling 5.0 and installed it as described at
 https://docs.wso2.com/display/ESB500/Installing+WSO2+ESB+Tooling .



 I am using the description from this link:
 https://docs.wso2.com/display/ESB500/Working+with+ESB+Artifacts .


 Following the instructions in section "Creating a Smooks configuration
 artifact" I get the following error when trying to add the libraries from
 the Smooks framework to my registry resources project:


 "Could not locate library smooks-libs/antlr-2.7.7.jar in bundle
 org.wso2.developerstudio.eclipse.esb.libraries."


 I checked each runtime library individually, but each of them resulted
 in the same error.

 It is also strange, that the entry "WSO2 Classpath Libraries" is twice
 in the list of the "Add Library" dialogue.


 Any information on how to proceed is appreciated .


 Regards,

 Thomas



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


>>>
>>
>>
>> --
>> Regards
>>
>>
>> *Nipuni Chandrasoma*
>>
>> *Software Engineer | Support Team*
>> *WSO2*
>>
>> *Email : nipu...@wso2.com *
>> *Mobile : +94 777133895 <+94%2077%20778%208129>*
>>
>>
>>
>> ___
>> Dev mailing list
>> Dev@wso2.org
>> http://wso2.org/cgi-bin/mailman/listinfo/dev
>>
>>
>
>
> --
> Heshitha Hettihewa
> *Software Engineer*
> Mobile : +94716866386
> <%2B94%20%280%29%20773%20451194>
> heshit...@wso2.com
>



-- 
Regards


*Nipuni Chandrasoma*

*Software Engineer | Support Team*
*WSO2*

*Email : nipu...@wso2.com *
*Mobile : +94 777133895 <+94%2077%20778%208129>*
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


[Dev] Select Error Codes section does not work properly when configuring an EndPoint

2018-01-16 Thread Malaka Gangananda
Select Error Codes section does not work properly when configuring advance
properties of end points.
When Select Error Codes section is selected while trying to configure
suspend or timeout error codes in Address Endpoints it just pop up a html
code rather than showing the actual error codes as shown in below.


​





Reason behind this is in endpoint-utils.js code it uses
the CARBON.showPopupDialog method, and it passes the html code which needs
to create the pop up menu into this method.
But in showPopupDialog method it uses the htmlEncode method and convert the
html content into text and put within a newly created html section.
So the popup menu shown as text as mentioned above.
CARBON.showPopupDialog  method has been used to edit inline throttle policy
as well and that section also shows this error.
So how to proceed with this ?

Thanks,
-- 
Malaka.
-- 
Malaka Gangananda - Software Engineer | WSO2
Email : mala...@wso2.com
Mobile : +94713564340
Web : http://wso2.com
  
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


Re: [Dev] WSO2 Oxygen Tank > Manage endpoint text responses from proxy (Unexpected character 'some_character' code 45 in prolog expected '<')

2018-01-16 Thread Nadeeshaan Gunasinghe
Hi Marcos,

This is what I see, you get the content type as text/xml and when you try
to build this particular payload it is invalid xml content. If you take a
look at the wirelogs, you will be able to find that the content type is set
to text/xml before the below payload.

--urn:uuid:ax7xx36-98xx9-4ex1-bxxc-ax1x8bxc
Content-Type: text/xml; charset=utf-8
Content-Transfer-Encoding: 8bit
Content-ID: 


http://schemas.xmlsoap.org/soap/
envelope/" xmlns:ns1="https://.es//ws/ws_v2/1.0/infoEnvioV2;>

...
...

As I think, if you are trying to extract the soap envelope specifically
from this payload, you will need to write a custom message
formatter/builder.

Thanks,
*Nadeeshaan Gunasinghe*
Senior Software Engineer, WSO2 Inc. http://wso2.com
+94770596754 | nadeesh...@wso2.com | Skype: nadeeshaan.gunasinghe <#>

 

Get your own email signature


On Tue, Jan 16, 2018 at 3:18 PM, Marcos Tarín Esteve <
mta...@alfatecsistemas.es> wrote:

> Hi Nadeeshaan
>
>
>
> Very grateful for your help
>
>
>
> The error I reported was obtained from the log file. It is the only one
> found.
>
>
>
> TID: [-1234] [] [2017-12-21 17:15:38,305] ERROR
> {org.apache.synapse.transport.passthru.util.RelayUtils} -  Error while
> building Passthrough stream {org.apache.synapse.transport.
> passthru.util.RelayUtils}
> org.apache.axiom.om.OMException: com.ctc.wstx.exc.WstxUnexpectedCharException:
> Unexpected character '-' (code 45) in prolog; expected '<'
>
>
> I only show a single line belonging to the log for privacy issues.
>
> It is clear that the problem is that WSO-ESB receives a response from the
> endpoint in which its first character is a symbol symbol '-' and that is
> why ESB gives error.
>
>
> --urn:uuid:ax7xx36-98xx9-4ex1-bxxc-ax1x8bxc
> Content-Type: text/xml; charset=utf-8
> Content-Transfer-Encoding: 8bit
> Content-ID: 
>
> 
> http://schemas.xmlsoap.org/soap/
> envelope/" xmlns:ns1="https://.es//ws/ws_v2/1.0/infoEnvioV2;>
> 
> 
> xa3x2x8xx7
> 
> 
> 
>
> --urn:uuid:a07xxx6-9xxx9-4xxa1-xx9c-a91dxxbcc
> Content-Type: application/octet-stream; charset=utf-8
> Content-Transfer-Encoding: binary
> Content-ID: 
> http://xx.x.x.xxx/Texto_de_prueba.txt
> --urn:uuid:a07xxx6-9xxx9-4ea1-bxxc-a9xxx0c8bcc-
>
>
> I also tried configurations with "BinaryRelayBuilder and the
> ExpandingMessageFormatter" included within the proxy. But they had no
> effect.
>
> "the provided response is a single response, then it is a multipart
> response as I understood correctly." ==> Sorry I did not understand your
> sentence. I try to explain better. The answer coming from the endpoint is
> simple, with the particularity that besides SOAP labels, it adds extra
> information related a file. It seems is the file, or access information to
> it, which seems to be encoded in octet format within the response.
>
>
>
> if I could erase all the information in the answer except the SOAP
> information:
>
>
>
> 
> http://schemas.xmlsoap.org/soap/
> envelope/" xmlns:ns1="https://.es//ws/ws_v2/1.0/infoEnvioV2;>
> 
> 
> xa3x2x8xx7
> 
> 
> 
>
>
>
> I am sure that I found that WSO2-ESB would work.
>
>
>
> We’ll be in contact … Thanks
>
>
>
> Marcos
>
>
>
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


Re: [Dev] Image persisting and retrieval mechanism for WSO2 IoT Server

2018-01-16 Thread Anusha Jayasundara
Hi Nuwan.

Even though I did video processing, In the end, the processing was done by
per image. In my case, I resized the images into a 480p or 720p(most of the
time videos was 1080p) and after the processing was done, saved them into
the main storage in binary format. So you also can check the possibility of
pre-processing the image before saving, since it can reduce the image size.

Thank You,
Anusha,

On Tue, Jan 16, 2018 at 7:19 PM, Ramindu De Silva  wrote:

> Hi all,
>
> [+]Anusha
> Anusha has implemented a video processing solution. But it is not
> integrated to the SP. Anusha, can you please explain how you stored and
> processed the data in your solution? Maybe IoT team can get an idea.
>
> Best Regards,
> Ramindu.
>
>
> On Tue, Jan 16, 2018 at 4:03 AM, Nuwan Jayawardene 
> wrote:
>
>> Hi All,
>>
>> Thanks for the feedback.
>> Based on what everyone has said, I thought it was best to go ahead with
>> using the *BinaryStream*.
>>
>> Will update this thread further along the way! :)
>>
>>
>> On Tue, Jan 16, 2018 at 2:07 PM, Madawa Soysa  wrote:
>>
>>>
>>>
>>> On Tue, Jan 16, 2018 at 1:10 PM, Ruwan Yatawara  wrote:
>>>
 As to my knowledge, image analysis is not supported, and won't be
 supported in the near future.

 @Mohan, @Ramindu, please correct me if I am wrong.

>>>
>>> In that case, it is better to go with the BinaryStream approach.
>>>
>>> +1 for retrieving as a BinaryStream.
>>>
>>>
 Thanks and Regards,

 Ruwan Yatawara

 Technical Lead,
 WSO2 Inc.

 email : ruw...@wso2.com
 mobile : +94 77 9110413
 http://ruwansrants.blogspot.com/
 https://500px.com/ruwan_ace
 https://medium.com/@ruwanyatawara


 On Tue, Jan 16, 2018 at 1:01 PM, Nuwan Jayawardene 
 wrote:

> Hi Madawa,
>
> Have you evaluated this approach? What are the advantages and
>> drawbacks in terms of storage and retrieval of images by following this
>> approach?
>
>
> I've yet to look more into this option. I was actually hoping for some
> feedback on whether or not I should pursue this or stick with the RDBMS
> approach since I'm not experienced enough with Siddhi to do a 
> knowledgeable
> assessment.
> At the moment, for the use case at hand, a simple storage and
> retrieval would suffice. But if we consider the long run IMO it would be
> smarter to go with a Siddhi based approach.
> Then again comes the issue of whether Siddhi streams support image
> analytics.
>
> On Tue, Jan 16, 2018 at 12:50 PM, Madawa Soysa 
> wrote:
>
>> Hi Nuwan,
>>
>> One other approach suggested to me was to use a *Siddhi Stream for
>>> both storage and retrieval* purposes. This would further allow for
>>> analytics to be performed on the data which not be very much possible 
>>> with
>>> the earlier mentioned approaches.
>>
>>
>> Have you evaluated this approach? What are the advantages and
>> drawbacks in terms of storage and retrieval of images by following this
>> approach?
>>
>> On Tue, Jan 16, 2018 at 12:36 PM, Geeth Munasinghe 
>> wrote:
>>
>>>
>>>
>>> On Tue, Jan 16, 2018 at 10:52 AM, Nuwan Jayawardene >> > wrote:
>>>
 Hi all,

 I'm currently working on a project to add image storing
 and retrieval capabilities to the WSO2 IoT Server.

 To achieve this I have implemented the following;
 1) Added a separate DAO Table with a field with LONGBLOB data type
 for storing.
 2) Added storage capabilities in the database for an image sent as
 a *File *in the form of a *BinaryStream*.

 As of now, I've written unit tests and the test images are getting
 stored successfully in the database.

 The problem lies in how to successfully retrieve the stored data.
 For this, I have come across 2 possible approaches.
 1) *Retrieve as a File - *The notable downside I realized with
 this solution is that each time a new Image is retrieved, a new file 
 will
 be created. Therefore measures would have to be taken to persist new 
 files
 while purging older obsolete ones.
 2) *Retrieve as BinaryStream - *Although this requires no
 persistent memory usage and the data will only be retrieved on call and
 issues may come up when representing that data from a UI end. Further
 analysis is required for this approach.

>>>
>>> +1 for retrieving as a BinaryStream. This will make it easy to
>>> handle in the java level unlike handling as a file. This has to work in 
>>> the
>>> cluster of servers, hence retrieving as a file will cause other syncing
>>> 

Re: [Dev] Commenting out addressing module of axis2.xml for email OTP

2018-01-16 Thread Shavindri Dissanayake
Hi Team,

Verifying details: Do we need to change the explanation given in docs?If
yes, what should the messaging be?

Thanks & Regards
Shavindri Dissanayake
Senior Technical Writer

WSO2 Inc.
lean.enterprise.middleware

On Mon, Jan 15, 2018 at 11:00 AM, Shakila Sasikaran 
wrote:

> Hi,
>
> As I remember when we create the axis configuration from the given
> axis2.xml, we get an error. Because of the emptiness of this module. Please
> note that this module is not defined in the axis2_default.xml.
>
> Thanks
>
> On Mon, Jan 15, 2018 at 10:43 AM, Omindu Rathnaweera 
> wrote:
>
>> Hi Team,
>>
>> Is anyone aware of the reason why we have to do the following
>> configuration for Email OTP [1] in axis2.xml (See instruction No.3 in
>> 'Enabling email configuration on WSO2 IS' section) ?
>>
>> '*Comment out the  property to avoid syntax
>> errors*.'
>>
>> IMO saying '*to avoid syntax errors*' doesn't make much sense.
>>
>> [1] - https://docs.wso2.com/display/IS540/Configuring+Email+OTP
>>
>> Thanks,
>> Omindu.
>>
>> --
>> Omindu Rathnaweera
>> Senior Software Engineer, WSO2 Inc.
>> Mobile: +94 771 197 211 <+94%2077%20119%207211>
>>
>
>
>
> --
> Shakila Sasikaran
> Software Engineer
> Mobile :+94 (0) 77 526 6848 <+94%2077%20526%206848>
> shak...@wso2.com
> WSO2, Inc.
> lean . enterprise . middleware
> http://www.wso2.com/
>
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


Re: [Dev] [EI-Enalytics] Search messages by status

2018-01-16 Thread Godwin Shrimal
Thanks for the response Vijitha.



Thanks
Godwin

On Wed, Jan 10, 2018 at 5:44 PM, Vijitha Ekanayake 
wrote:

> Hi Godwin,
>
> I could get the failed message list by providing Lucene query[1] in the
> search box. It seems we need to search for the fault count internally to
> get the failed list of messages when the user is searching the messages
> with the status. I've created a git issue to track the progress and We'll
> address this issue in an upcoming release.
>
> Could you try with query [1] to get the list of failure messages?
>
> [1].  *faultCount:1*
> [2]. https://github.com/wso2/product-ei/issues/1695
>
> Thanks.
>
> On Wed, Jan 10, 2018 at 3:02 PM, Godwin Shrimal  wrote:
>
>> Hi Gihan,
>>
>> Yes. I think we can use that approach, I was looking for the searching
>> option by status. But we can achieve the same thing with what you mentioned.
>>
>> Thanks
>> Godwin
>>
>> On Wed, Jan 10, 2018 at 4:26 PM, Gihan Anuruddha  wrote:
>>
>>> ​Hi Godwin,
>>>
>>> We display the fail message count in the summary page as overall one and
>>> the proxy, API specific. Once you select that, it will redirect to ​fail
>>> message list. Is that you looking?
>>>
>>> Regards,
>>> Gihan
>>>
>>> On Wed, Jan 10, 2018 at 2:50 PM, Godwin Shrimal  wrote:
>>>
 Hi Gihan,

 I sent my previous email without seeing your mail. IMO this will be a
 very useful feature. Let me explain using an example. Think we have a lot
 of messages in the message flow and few messages have failed. So we need to
 find what are the failed message and trace them. Without having this
 feature it'll be so hard to find them.

 Shall we add this to EI-analytics future roadmap? WDYT?

 Thanks
 Godwin

 On Wed, Jan 10, 2018 at 4:14 PM, Gihan Anuruddha 
 wrote:

> Hi Godwin,
>
> Are you looking search based on status code? That's not available.
>
> Regards,
> Gihan
>
> On Wed, Jan 10, 2018 at 2:42 PM, Godwin Shrimal 
> wrote:
>
>> If it's not available I think that will be a useful feature to add.
>>
>> Thanks
>> Godwin
>>
>> On Tue, Jan 9, 2018 at 11:12 AM, Pubudu Gunatilaka 
>> wrote:
>>
>>> Hi Godwin,
>>>
>>> Based on [1], looks like there is no way to give the status when
>>> searching.
>>>
>>> [1] - https://docs.wso2.com/display/EI610/Searching+for+Messages
>>>
>>> Thank you!
>>>
>>> On Tue, Jan 9, 2018 at 7:49 AM, Godwin Shrimal 
>>> wrote:
>>>
 Reminder on this.


 Thanks
 Godwin

 On Mon, Jan 8, 2018 at 4:57 PM, Godwin Shrimal 
 wrote:

> Hi Devs,
>
> How can we search messages in the EI Analytics dashboard with
> Status?
>
> Thanks
> Godwin
>
> --
> *Godwin Amila Shrimal*
> Associate Technical Lead
> WSO2 Inc.; http://wso2.com
> lean.enterprise.middleware
>
> mobile: *+94772264165*
> linkedin: *https://www.linkedin.com/in/godwin-amila-2ba26844/
> *
> twitter: https://twitter.com/godwinamila
> 
>



 --
 *Godwin Amila Shrimal*
 Associate Technical Lead
 WSO2 Inc.; http://wso2.com
 lean.enterprise.middleware

 mobile: *+94772264165*
 linkedin: *https://www.linkedin.com/in/godwin-amila-2ba26844/
 *
 twitter: https://twitter.com/godwinamila
 

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


>>>
>>>
>>> --
>>> *Pubudu Gunatilaka*
>>> Committer and PMC Member - Apache Stratos
>>> Senior Software Engineer
>>> WSO2, Inc.: http://wso2.com
>>> mobile : +94774078049 <%2B94772207163>
>>>
>>>
>>
>>
>> --
>> *Godwin Amila Shrimal*
>> Associate Technical Lead
>> WSO2 Inc.; http://wso2.com
>> lean.enterprise.middleware
>>
>> mobile: *+94772264165*
>> linkedin: *https://www.linkedin.com/in/godwin-amila-2ba26844/
>> *
>> twitter: https://twitter.com/godwinamila
>> 
>>
>
>
>
> --
> W.G. Gihan Anuruddha
> Associate Technical Lead | WSO2, Inc.
> M: +94772272595
>



 --
 *Godwin Amila Shrimal*
 Associate Technical Lead
 WSO2 Inc.; http://wso2.com
 lean.enterprise.middleware

Re: [Dev] Server Don't startup (with the sec.policy) after configuring java security

2018-01-16 Thread Sanjeewa Malalgoda
[1]https://docs.wso2.com/display/ADMIN44x/Enabling+Java+Security+Manager

On Tue, Jan 16, 2018 at 2:53 PM, Sanjeewa Malalgoda 
wrote:

> I haven't checked these steps recently with latest API Manager packs. I
> think we will need to do some changes to policy and see the impact of that.
> If this[1] doc do not work lets create document improvement request and
> see do we have any gap in official document. The blog post was bit old but
> document should work.
>
>
> Thanks,
> sanjeewa.
>
> On Mon, Jan 15, 2018 at 10:37 AM, Prakhash Sivakumar 
> wrote:
>
>> Hi Sanjeewa,
>>
>> Yes, I did that, but I'm getting the same error.
>>
>> Thanks.
>>
>>
>> On Mon, Jan 15, 2018 at 10:02 AM, Sanjeewa Malalgoda 
>> wrote:
>>
>>> Hi Prakash,
>>> Did we checked sign by entry proposed here in this JIRA?
>>>
>>> [1]https://wso2.org/jira/browse/WSAS-2067
>>>
>>> Thanks,
>>> sanjeewa.
>>>
>>> On Sun, Jan 14, 2018 at 12:15 PM, Prakhash Sivakumar 
>>> wrote:
>>>
 Hi Devs,

 I have followed the blog in [1] to enable the Java Security Manager in
 AM 2.1.0 WUM updated pack. But the server doesn't startup after doing this.
 I even tried using default wso2carbon.jks, still no luck.

 I have properly added the grant signedBy "alias" too as below.
 * grant signedBy "wso2carbon" {*
 *  permission java.security.AllPermission;*
 * };*

 Any idea why this is happening?

 JAVA_HOME environment variable is set to /usr/lib/jvm/jdk1.8.0_77
 CARBON_HOME environment variable is set to
 /home/prakhash/.wum-wso2/products/wso2am/2.1.0/wso2am-2.1.0
 Using Java memory options: -Xms256m -Xmx1024m
 Property pattern javax.net.ssl.trustStore is restricted for tenant code.
 Property pattern javax.net.ssl.trustStorePassword is restricted for
 tenant code.
 Property pattern denied.system.properties is restricted for tenant code.
 java.security.AccessControlException
  - klass: 'java/security/AccessControlException'
 #
 # A fatal error has been detected by the Java Runtime Environment:
 #
 #  Internal Error (exceptions.cpp:427), pid=29654, tid=140171148142336
 #  fatal error: ExceptionMark destructor expects no pending exceptions
 #
 # JRE version: Java(TM) SE Runtime Environment (8.0_77-b03) (build
 1.8.0_77-b03)
 # Java VM: Java HotSpot(TM) 64-Bit Server VM (25.77-b03 mixed mode
 linux-amd64 compressed oops)
 # Failed to write core dump. Core dumps have been disabled. To enable
 core dumping, try "ulimit -c unlimited" before starting Java again
 #
 # An error report file with more information is saved as:
 # /home/prakhash/.wum-wso2/products/wso2am/2.1.0/wso2am-2.1.0/
 hs_err_pid29654.log
 #
 # If you would like to submit a bug report, please visit:
 #   http://bugreport.java.com/bugreport/crash.jsp
 #
 Aborted (core dumped)

 [1] http://sanjeewamalalgoda.blogspot.com/2014/12/how-to-run-wso
 2-api-manager-180-with.html

 Thanks,
 Prakhash

 --
 Prakhash Sivakumar
 Software Engineer | WSO2 Inc
 Platform Security Team
 Mobile : +94771510080 <077%20151%200080>
 Blog : https://medium.com/@PrakhashS

>>>
>>>
>>>
>>> --
>>>
>>> *Sanjeewa Malalgoda*
>>> WSO2 Inc.
>>> Mobile : +94713068779 <+94%2071%20306%208779>
>>>
>>> blog
>>> :http://sanjeewamalalgoda.blogspot.com/
>>> 
>>>
>>>
>>>
>>
>>
>> --
>> Prakhash Sivakumar
>> Software Engineer | WSO2 Inc
>> Platform Security Team
>> Mobile : +94771510080 <077%20151%200080>
>> Blog : https://medium.com/@PrakhashS
>>
>
>
>
> --
>
> *Sanjeewa Malalgoda*
> WSO2 Inc.
> Mobile : +94713068779 <071%20306%208779>
>
> blog :http://sanjeewamalalgoda.
> blogspot.com/ 
>
>
>


-- 

*Sanjeewa Malalgoda*
WSO2 Inc.
Mobile : +94713068779

blog
:http://sanjeewamalalgoda.blogspot.com/

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


[Dev] Purpose of BOSH package 'common'

2018-01-16 Thread Chiranga Alwis
Hi all,

when analyzing the existing PCF BOSH implementations [1] [2], I encountered
a package defined named 'common'. The rationale behind the existence of
this package is not clear to me.


​

As you may know, BOSH packages provide the required information to prepare
the binaries and dependencies for the jobs we define [3].

Your help, ideas and suggestions are highly appreciated.

[1]: https://github.com/wso2/pivotal-cf-is
[2]: https://github.com/wso2/pivotal-cf-apim
[3]: https://bosh.io/docs/create-release.html#pkg-skeletons

-- 
Yours sincerely,

*Chiranga Alwis*
Software Engineer | WSO2

*Mobile : *+94775930497
*Email: *chirangaal...@gmail.com
*LinkedIn: *https://lk.linkedin.com/in/chiranga-alwis-391342a9
*Medium:* https://medium.com/@chirangaalwis


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


Re: [Dev] Could not locate library smooks-libs/antlr-2.7.7.jar in bundle org.wso2.developerstudio.eclipse.esb.libraries, when adding library

2018-01-16 Thread Heshitha Hettihewa
Hi Thomas/Nipuni,

Thanks for pointing out. It seems Smooks libraries are not correctly packed
with the developer studio distribution. I've added smooks libs to the
org.wso2.developerstudio.eclipse.esb.libraries project build path with
this[1] PR. This change will be released with the next Developer Studio
release. Or else you can build from source[1] and install the built p2 to
eclipse. As another workaround you can add these libraries manually to
eclipse build path (As external jars pointing the file system location).
You can find the list of jars here[3].

[1]. https://github.com/wso2/devstudio-tooling-esb/pull/302
[2]. https://github.com/wso2/devstudio-tooling-esb/
[3].
https://github.com/Drifftr/devstudio-tooling-esb/tree/master/plugins/org.wso2.developerstudio.eclipse.esb.libraries/smooks-libs

Thanks,
Heshitha.

On Tue, Jan 16, 2018 at 1:40 PM, Nipuni Chandrasoma 
wrote:

>
> Hi all,
>
> I have tried the same scenario which is "Creating a Smooks configuration
> artifact" by referring the documentation [1] and I get exactly the same
> error [2] as mentioned.
>
> Any input on this is highly appreciated.
>
> [1]. https://docs.wso2.com/display/DVS380/Creating+ESB+Artifacts#
> CreatingESBArtifacts-CreatingaSmooksconfigurationartifact
> [2]. "Could not locate library smooks-libs/antlr-2.7.7.jar in bundle
> org.wso2.developerstudio.eclipse.esb.libraries." and this is valid for
> each runtime library file in the list.
>
>
> Thanks
> Nipuni
>
>
> On Tue, Jan 16, 2018 at 1:28 PM, Sewmini Jayaweera 
> wrote:
>
>> [Adding NipuniC]
>>
>> Sewmini Jayaweera
>> *Software Engineer - Support Team*
>> Mobile: +94 (0) 773 381 250 <+94%2077%20338%201250>
>> sewm...@wso2.com
>>
>> On Wed, Dec 14, 2016 at 6:56 PM, Schürpf, Thomas <
>> thomas.schue...@koch-it.ch> wrote:
>>
>>> We are using the WSO2 ESB Tooling 5.0 and installed it as described at
>>> https://docs.wso2.com/display/ESB500/Installing+WSO2+ESB+Tooling .
>>>
>>>
>>>
>>> I am using the description from this link:
>>> https://docs.wso2.com/display/ESB500/Working+with+ESB+Artifacts .
>>>
>>>
>>> Following the instructions in section "Creating a Smooks configuration
>>> artifact" I get the following error when trying to add the libraries from
>>> the Smooks framework to my registry resources project:
>>>
>>>
>>> "Could not locate library smooks-libs/antlr-2.7.7.jar in bundle
>>> org.wso2.developerstudio.eclipse.esb.libraries."
>>>
>>>
>>> I checked each runtime library individually, but each of them resulted
>>> in the same error.
>>>
>>> It is also strange, that the entry "WSO2 Classpath Libraries" is twice
>>> in the list of the "Add Library" dialogue.
>>>
>>>
>>> Any information on how to proceed is appreciated .
>>>
>>>
>>> Regards,
>>>
>>> Thomas
>>>
>>>
>>>
>>> ___
>>> Dev mailing list
>>> Dev@wso2.org
>>> http://wso2.org/cgi-bin/mailman/listinfo/dev
>>>
>>>
>>
>
>
> --
> Regards
>
>
> *Nipuni Chandrasoma*
>
> *Software Engineer | Support Team*
> *WSO2*
>
> *Email : nipu...@wso2.com *
> *Mobile : +94 777133895 <+94%2077%20778%208129>*
>
>
>
> ___
> Dev mailing list
> Dev@wso2.org
> http://wso2.org/cgi-bin/mailman/listinfo/dev
>
>


-- 
Heshitha Hettihewa
*Software Engineer*
Mobile : +94716866386
<%2B94%20%280%29%20773%20451194>
heshit...@wso2.com
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


Re: [Dev] Adding values to a field in request using enrich mediator

2018-01-16 Thread vikram nayak
Hi, Enrich mediator inside for-each not working properly :

Please consider what I have tried so far and Please Guide.

I have to add(suffix) a random number, to the values present in below tags in 
input request xml. 1) _JsonReader_PS_id2) _JsonReader_PS_ref
Input xml, Current Output xml,  Expected Output xml are attached.
After executing the sequences  attached in mail (UpdatingIds.xml, 
Sequence.xml), I expected that the value at line 63 in 
foreach_currentOutput.xml would be modified .
 <_JsonReader_PS_ref>1
It should have got modified to 
 <_JsonReader_PS_ref>16869
Similarly the value at line 27 , should not have been modified.
I also tried modifying other ids, by calling Sequence.xml from inside "For-each 
in Sequence.xml" if xpath=//Children/Children exists . But that also lead to 
many other wrong updations
Thanks 

On Tuesday, 16 January 2018 1:59 PM, vikram nayak  
wrote:
 

 Hi,
Tried to explain little more.I have to append a random number to "too many ids" 
present in my request.
Actual request consists of thousands of lines and there are many ids in it.
some ids are within array , some are direct elements.sample input : {  "id" : 
"1",   {    "id":"2"      }}
I think this could be achieved by doing following for each id present in 
request.
1.  by first acessing the id in a property say property1.2. Then generating the 
random Number in property2.3. Then creating third property, to where i assign 
value of "property1 + property2" to  property3.5. Then assign property 3 to 
first id in request using enrich mediator.
But I think this is not ideal way to do it. Since I have to do it for many id's 
in request.There should be some way to enrich request directly using one enrich 
mediator somewhat  like below
$body.Lookups.$id = $body.Lookups.$id +  get-property('randomNumber');
For below sample input 

Suppose in this loop the randomNumber generated is 100 and kept in property1.
{  "id" : "1",   {    "id":"2"      }   .   .   .   .   "id"="100"}
sample output should be like below :
{  "id" : "1100",   {    "id":"2100"      }   .   .   .   .   "id": "100100"}
i.e. original value + "100"
i.e. I need to add suffix at the end of each id in request.
Please guide.
Thanks,


 

On Tuesday, 16 January 2018 12:17 PM, vikram nayak  
wrote:
 

 Hi,
I have to add a random number to too many ids present in my request.
Actual request consists of thousands of lines and there are many ids in it.
some ids are within array , some are direct elements.
{  "id" : "1",   {    "id":"2"   }}
1. I can do this by first aceessing the id in a property say property1.2. Then 
generating the random Number in property2.3. Then creating third property, to 
where i assign value of property1 + property2 to  property3.5. Then assign 
property 3 to first id in request using enrich mediator.
But I think this is not ideal way to do it. Since I have to do it for many id's 
in request.There should be some way to enrich request directly using one enrich 
mediator
$body.Lookups.$id = $body.Lookups.$id +  get-property('randomNumber');
Thanks

   

   
http://schemas.xmlsoap.org/soap/envelope/;>
	
		
			<_JsonReader_PS_id>16869
			

	<_JsonReader_PS_ref>16869

			
			
<_JsonReader_PS_id>46869



	<_JsonReader_PS_id>5	
	
		<_JsonReader_PS_id>6		
		
		
			<_JsonReader_PS_id>7			
			
			
<_JsonReader_PS_id>8


	<_JsonReader_PS_ref>76869

			
			
<_JsonReader_PS_id>10


	<_JsonReader_PS_ref>7

			
			
<_JsonReader_PS_id>12


	<_JsonReader_PS_ref>7


			
<_JsonReader_PS_id>14


	<_JsonReader_PS_ref>7

			
			
<_JsonReader_PS_id>16


	<_JsonReader_PS_ref>7

			
			
<_JsonReader_PS_ref>6
			
		
		
			<_JsonReader_PS_ref>5
		
		
	b5c75f37-6381-45f8-806b-c22a49ab6962
	
	
		<_JsonReader_PS_ref>4
	
	

	<_JsonReader_PS_ref>1

			
			
<_JsonReader_PS_id>196869


	<_JsonReader_PS_ref>16869

			
<_JsonReader_PS_id>216869


	<_JsonReader_PS_ref>16869


			
<_JsonReader_PS_id>236869


	<_JsonReader_PS_ref>16869

		
		
	

http://schemas.xmlsoap.org/soap/envelope/;>
	
		
			<_JsonReader_PS_id>16869
			

	<_JsonReader_PS_ref>16869

			
			
<_JsonReader_PS_id>46869



	<_JsonReader_PS_id>56869	
	
		<_JsonReader_PS_id>66869		
		
		
			<_JsonReader_PS_id>76869			
			
			
<_JsonReader_PS_id>86869


	<_JsonReader_PS_ref>76869

			
			
<_JsonReader_PS_id>106869

Re: [Dev] Image persisting and retrieval mechanism for WSO2 IoT Server

2018-01-16 Thread Nuwan Jayawardene
Hi All,

Thanks for the feedback.
Based on what everyone has said, I thought it was best to go ahead with
using the *BinaryStream*.

Will update this thread further along the way! :)


On Tue, Jan 16, 2018 at 2:07 PM, Madawa Soysa  wrote:

>
>
> On Tue, Jan 16, 2018 at 1:10 PM, Ruwan Yatawara  wrote:
>
>> As to my knowledge, image analysis is not supported, and won't be
>> supported in the near future.
>>
>> @Mohan, @Ramindu, please correct me if I am wrong.
>>
>
> In that case, it is better to go with the BinaryStream approach.
>
> +1 for retrieving as a BinaryStream.
>
>
>> Thanks and Regards,
>>
>> Ruwan Yatawara
>>
>> Technical Lead,
>> WSO2 Inc.
>>
>> email : ruw...@wso2.com
>> mobile : +94 77 9110413
>> http://ruwansrants.blogspot.com/
>> https://500px.com/ruwan_ace
>> https://medium.com/@ruwanyatawara
>>
>>
>> On Tue, Jan 16, 2018 at 1:01 PM, Nuwan Jayawardene 
>> wrote:
>>
>>> Hi Madawa,
>>>
>>> Have you evaluated this approach? What are the advantages and drawbacks
 in terms of storage and retrieval of images by following this approach?
>>>
>>>
>>> I've yet to look more into this option. I was actually hoping for some
>>> feedback on whether or not I should pursue this or stick with the RDBMS
>>> approach since I'm not experienced enough with Siddhi to do a knowledgeable
>>> assessment.
>>> At the moment, for the use case at hand, a simple storage and retrieval
>>> would suffice. But if we consider the long run IMO it would be smarter to
>>> go with a Siddhi based approach.
>>> Then again comes the issue of whether Siddhi streams support image
>>> analytics.
>>>
>>> On Tue, Jan 16, 2018 at 12:50 PM, Madawa Soysa  wrote:
>>>
 Hi Nuwan,

 One other approach suggested to me was to use a *Siddhi Stream for
> both storage and retrieval* purposes. This would further allow for
> analytics to be performed on the data which not be very much possible with
> the earlier mentioned approaches.


 Have you evaluated this approach? What are the advantages and drawbacks
 in terms of storage and retrieval of images by following this approach?

 On Tue, Jan 16, 2018 at 12:36 PM, Geeth Munasinghe 
 wrote:

>
>
> On Tue, Jan 16, 2018 at 10:52 AM, Nuwan Jayawardene 
> wrote:
>
>> Hi all,
>>
>> I'm currently working on a project to add image storing and retrieval
>> capabilities to the WSO2 IoT Server.
>>
>> To achieve this I have implemented the following;
>> 1) Added a separate DAO Table with a field with LONGBLOB data type
>> for storing.
>> 2) Added storage capabilities in the database for an image sent as a 
>> *File
>> *in the form of a *BinaryStream*.
>>
>> As of now, I've written unit tests and the test images are getting
>> stored successfully in the database.
>>
>> The problem lies in how to successfully retrieve the stored data. For
>> this, I have come across 2 possible approaches.
>> 1) *Retrieve as a File - *The notable downside I realized with this
>> solution is that each time a new Image is retrieved, a new file will be
>> created. Therefore measures would have to be taken to persist new files
>> while purging older obsolete ones.
>> 2) *Retrieve as BinaryStream - *Although this requires no persistent
>> memory usage and the data will only be retrieved on call and issues may
>> come up when representing that data from a UI end. Further analysis is
>> required for this approach.
>>
>
> +1 for retrieving as a BinaryStream. This will make it easy to handle
> in the java level unlike handling as a file. This has to work in the
> cluster of servers, hence retrieving as a file will cause other syncing
> issues.
>
>
>> 3) *Retrieve as FileOutputStream - *This is my preferred method and
>> the one recommended mostly in forums and tutorials.
>>
>> One other approach suggested to me was to use a *Siddhi Stream for
>> both storage and retrieval* purposes. This would further allow for
>> analytics to be performed on the data which not be very much possible 
>> with
>> the earlier mentioned approaches.
>>
>> Suggestions and Feedback are appreciated.
>> Thanks and regards!
>>
>> --
>> *Nuwan Jayawardene*
>> *Software Engineering Intern*
>> *WSO2, Inc.:http://wso2.com *
>> *lean.enterprise.middleware*
>> *Mobile  :- +94 71 1813299 <+94%2071%20181%203299>*
>>
>>
>>- *Linkedin* *:- **https://www.linkedin.com/in/nuwa
>>**njaya/
>>*
>>- * *
>>
>>
>
>
> --
> *Geeth Munasinghe*
> *WSO2, Inc. http://wso2.com  *
> 

Re: [Dev] Image persisting and retrieval mechanism for WSO2 IoT Server

2018-01-16 Thread Ramindu De Silva
Hi all,

[+]Anusha
Anusha has implemented a video processing solution. But it is not
integrated to the SP. Anusha, can you please explain how you stored and
processed the data in your solution? Maybe IoT team can get an idea.

Best Regards,
Ramindu.


On Tue, Jan 16, 2018 at 4:03 AM, Nuwan Jayawardene  wrote:

> Hi All,
>
> Thanks for the feedback.
> Based on what everyone has said, I thought it was best to go ahead with
> using the *BinaryStream*.
>
> Will update this thread further along the way! :)
>
>
> On Tue, Jan 16, 2018 at 2:07 PM, Madawa Soysa  wrote:
>
>>
>>
>> On Tue, Jan 16, 2018 at 1:10 PM, Ruwan Yatawara  wrote:
>>
>>> As to my knowledge, image analysis is not supported, and won't be
>>> supported in the near future.
>>>
>>> @Mohan, @Ramindu, please correct me if I am wrong.
>>>
>>
>> In that case, it is better to go with the BinaryStream approach.
>>
>> +1 for retrieving as a BinaryStream.
>>
>>
>>> Thanks and Regards,
>>>
>>> Ruwan Yatawara
>>>
>>> Technical Lead,
>>> WSO2 Inc.
>>>
>>> email : ruw...@wso2.com
>>> mobile : +94 77 9110413
>>> http://ruwansrants.blogspot.com/
>>> https://500px.com/ruwan_ace
>>> https://medium.com/@ruwanyatawara
>>>
>>>
>>> On Tue, Jan 16, 2018 at 1:01 PM, Nuwan Jayawardene 
>>> wrote:
>>>
 Hi Madawa,

 Have you evaluated this approach? What are the advantages and drawbacks
> in terms of storage and retrieval of images by following this approach?


 I've yet to look more into this option. I was actually hoping for some
 feedback on whether or not I should pursue this or stick with the RDBMS
 approach since I'm not experienced enough with Siddhi to do a knowledgeable
 assessment.
 At the moment, for the use case at hand, a simple storage and retrieval
 would suffice. But if we consider the long run IMO it would be smarter to
 go with a Siddhi based approach.
 Then again comes the issue of whether Siddhi streams support image
 analytics.

 On Tue, Jan 16, 2018 at 12:50 PM, Madawa Soysa 
 wrote:

> Hi Nuwan,
>
> One other approach suggested to me was to use a *Siddhi Stream for
>> both storage and retrieval* purposes. This would further allow for
>> analytics to be performed on the data which not be very much possible 
>> with
>> the earlier mentioned approaches.
>
>
> Have you evaluated this approach? What are the advantages and
> drawbacks in terms of storage and retrieval of images by following this
> approach?
>
> On Tue, Jan 16, 2018 at 12:36 PM, Geeth Munasinghe 
> wrote:
>
>>
>>
>> On Tue, Jan 16, 2018 at 10:52 AM, Nuwan Jayawardene 
>> wrote:
>>
>>> Hi all,
>>>
>>> I'm currently working on a project to add image storing
>>> and retrieval capabilities to the WSO2 IoT Server.
>>>
>>> To achieve this I have implemented the following;
>>> 1) Added a separate DAO Table with a field with LONGBLOB data type
>>> for storing.
>>> 2) Added storage capabilities in the database for an image sent as a 
>>> *File
>>> *in the form of a *BinaryStream*.
>>>
>>> As of now, I've written unit tests and the test images are getting
>>> stored successfully in the database.
>>>
>>> The problem lies in how to successfully retrieve the stored data.
>>> For this, I have come across 2 possible approaches.
>>> 1) *Retrieve as a File - *The notable downside I realized with this
>>> solution is that each time a new Image is retrieved, a new file will be
>>> created. Therefore measures would have to be taken to persist new files
>>> while purging older obsolete ones.
>>> 2) *Retrieve as BinaryStream - *Although this requires no
>>> persistent memory usage and the data will only be retrieved on call and
>>> issues may come up when representing that data from a UI end. Further
>>> analysis is required for this approach.
>>>
>>
>> +1 for retrieving as a BinaryStream. This will make it easy to handle
>> in the java level unlike handling as a file. This has to work in the
>> cluster of servers, hence retrieving as a file will cause other syncing
>> issues.
>>
>>
>>> 3) *Retrieve as FileOutputStream - *This is my preferred method and
>>> the one recommended mostly in forums and tutorials.
>>>
>>> One other approach suggested to me was to use a *Siddhi Stream for
>>> both storage and retrieval* purposes. This would further allow for
>>> analytics to be performed on the data which not be very much possible 
>>> with
>>> the earlier mentioned approaches.
>>>
>>> Suggestions and Feedback are appreciated.
>>> Thanks and regards!
>>>
>>> --
>>> *Nuwan Jayawardene*
>>> *Software Engineering Intern*
>>> *WSO2, Inc.:http://wso2.com 

Re: [Dev] Server Don't startup (with the sec.policy) after configuring java security

2018-01-16 Thread Sanjeewa Malalgoda
I haven't checked these steps recently with latest API Manager packs. I
think we will need to do some changes to policy and see the impact of that.
If this[1] doc do not work lets create document improvement request and see
do we have any gap in official document. The blog post was bit old but
document should work.


Thanks,
sanjeewa.

On Mon, Jan 15, 2018 at 10:37 AM, Prakhash Sivakumar 
wrote:

> Hi Sanjeewa,
>
> Yes, I did that, but I'm getting the same error.
>
> Thanks.
>
>
> On Mon, Jan 15, 2018 at 10:02 AM, Sanjeewa Malalgoda 
> wrote:
>
>> Hi Prakash,
>> Did we checked sign by entry proposed here in this JIRA?
>>
>> [1]https://wso2.org/jira/browse/WSAS-2067
>>
>> Thanks,
>> sanjeewa.
>>
>> On Sun, Jan 14, 2018 at 12:15 PM, Prakhash Sivakumar 
>> wrote:
>>
>>> Hi Devs,
>>>
>>> I have followed the blog in [1] to enable the Java Security Manager in
>>> AM 2.1.0 WUM updated pack. But the server doesn't startup after doing this.
>>> I even tried using default wso2carbon.jks, still no luck.
>>>
>>> I have properly added the grant signedBy "alias" too as below.
>>> * grant signedBy "wso2carbon" {*
>>> *  permission java.security.AllPermission;*
>>> * };*
>>>
>>> Any idea why this is happening?
>>>
>>> JAVA_HOME environment variable is set to /usr/lib/jvm/jdk1.8.0_77
>>> CARBON_HOME environment variable is set to /home/prakhash/.wum-wso2/produ
>>> cts/wso2am/2.1.0/wso2am-2.1.0
>>> Using Java memory options: -Xms256m -Xmx1024m
>>> Property pattern javax.net.ssl.trustStore is restricted for tenant code.
>>> Property pattern javax.net.ssl.trustStorePassword is restricted for
>>> tenant code.
>>> Property pattern denied.system.properties is restricted for tenant code.
>>> java.security.AccessControlException
>>>  - klass: 'java/security/AccessControlException'
>>> #
>>> # A fatal error has been detected by the Java Runtime Environment:
>>> #
>>> #  Internal Error (exceptions.cpp:427), pid=29654, tid=140171148142336
>>> #  fatal error: ExceptionMark destructor expects no pending exceptions
>>> #
>>> # JRE version: Java(TM) SE Runtime Environment (8.0_77-b03) (build
>>> 1.8.0_77-b03)
>>> # Java VM: Java HotSpot(TM) 64-Bit Server VM (25.77-b03 mixed mode
>>> linux-amd64 compressed oops)
>>> # Failed to write core dump. Core dumps have been disabled. To enable
>>> core dumping, try "ulimit -c unlimited" before starting Java again
>>> #
>>> # An error report file with more information is saved as:
>>> # /home/prakhash/.wum-wso2/products/wso2am/2.1.0/wso2am-2.1.0/
>>> hs_err_pid29654.log
>>> #
>>> # If you would like to submit a bug report, please visit:
>>> #   http://bugreport.java.com/bugreport/crash.jsp
>>> #
>>> Aborted (core dumped)
>>>
>>> [1] http://sanjeewamalalgoda.blogspot.com/2014/12/how-to-run-wso
>>> 2-api-manager-180-with.html
>>>
>>> Thanks,
>>> Prakhash
>>>
>>> --
>>> Prakhash Sivakumar
>>> Software Engineer | WSO2 Inc
>>> Platform Security Team
>>> Mobile : +94771510080 <077%20151%200080>
>>> Blog : https://medium.com/@PrakhashS
>>>
>>
>>
>>
>> --
>>
>> *Sanjeewa Malalgoda*
>> WSO2 Inc.
>> Mobile : +94713068779 <+94%2071%20306%208779>
>>
>> blog
>> :http://sanjeewamalalgoda.blogspot.com/
>> 
>>
>>
>>
>
>
> --
> Prakhash Sivakumar
> Software Engineer | WSO2 Inc
> Platform Security Team
> Mobile : +94771510080 <077%20151%200080>
> Blog : https://medium.com/@PrakhashS
>



-- 

*Sanjeewa Malalgoda*
WSO2 Inc.
Mobile : +94713068779

blog
:http://sanjeewamalalgoda.blogspot.com/

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


Re: [Dev] [APIM-220][Rest API] Creating an API with Access Control restricted to roles

2018-01-16 Thread Sanjeewa Malalgoda
In this document[1] we have added sample request to create API. There we
have visibility and visible roles attributes.

"visibility": "PUBLIC", "visibleRoles": [], "visibleTenants": [],

[1]
https://docs.wso2.com/display/AM210/apidocs/publisher/#!/operations#APICollection#apisPost

Thanks,
sanjeewa.

On Tue, Jan 16, 2018 at 2:55 PM, Chathurika De Silva 
wrote:

> Hi
>
> I am trying to creating an api using the rest interfaces to have access
> control for selected roles. In Publisher UI i can set "Restricted to Roles"
> as Access Control mechanism. Referred [1] to find the relevant parameter to
> set the above through the REST APIs but couldn't find the reference. Any
> help regarding this is much appreciated.
>
> [1] https://docs.wso2.com/display/AM210/apidocs/publisher/#!/models#API
>
>
> Thanks
> Erandi
>
> *Chathurika Erandi*
> Senior Software Engineer,
> WSO2 Inc.
>
> *E-mail:* chathuri...@wso2.com
> *Mobile: *+94714 328 612
> *Blog*: chathurikaerandi.blogspot.com
>



-- 

*Sanjeewa Malalgoda*
WSO2 Inc.
Mobile : +94713068779

blog
:http://sanjeewamalalgoda.blogspot.com/

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


Re: [Dev] JSON payload being null inside script message context

2018-01-16 Thread Isuru Haththotuwa
Previously there were a few issues with using JsonStreamBuilder and
JsonStreamFormatter
in APIM, hence by default APIM used JsonBuilder and JsonFormatter (up to
the release 2.1.0). I think we can move to JsonStreamBuilder and
JsonStreamFormatter
in the 2.2.0 release.

On Tue, Jan 9, 2018 at 8:59 PM, Sameera Gunarathne 
wrote:

> Hi Milinda,
>
> I have tried the suggestion and that way I can access the message payload.
> I can see in the axis2.xml in apim 2.2.0 this configuration is commented
> and uses JsonBuilder instead.
>
> 
>  class="org.apache.synapse.
> commons.json.JsonBuilder"/>
> 
>
> Is there any specific reason to use JsonBuilder and what would be the
> impact of using JsonStreamBuilder?
>
> Thanks and Regards,
>
> On Tue, Jan 9, 2018 at 8:49 PM, Milinda Perera  wrote:
>
>> Hi Sameera,
>>
>> Please add JsonStreamBuilder instead of JsonBuilder and try
>>
>> > class="org.wso2.carbon.integra
>> tor.core.json.JsonStreamBuilder"/>
>>
>> Thanks,
>> Milinda
>>
>> On Tue, Jan 9, 2018 at 8:44 PM, Sameera Gunarathne 
>> wrote:
>>
>>> Hi,
>>>
>>> I'm using a script mediator to get JSON payload inside an API sequence.
>>> I'm using a payload as follows.
>>>
>>> curl -X POST --header 'Content-Type: application/json' --header 'Accept: 
>>> application/xml' --header 'Authorization: Bearer 
>>> c4f97c6e-60fc-3c26-97ad-48b9c9fa4566' -d '{ \
>>>"PhoneNumbers": ["123456789"] \
>>>  }' 'https://10.100.7.133:8243/phoneVerify/1.0.0/checkPhoneNumbers
>>>
>>> I'm accessing the payload inside the script mediator as follows.
>>>
>>>  
>>>  var payload = mc.getPayloadJSON();
>>>  
>>>
>>> There I get following exception at the script mediator on the
>>> json payload being null.
>>>
>>> [2018-01-09 20:37:55,454] ERROR - ScriptMessageContext JSON object is
>>> null.
>>> [2018-01-09 20:37:55,458] ERROR - ScriptMediator The script engine
>>> returned an error executing the inlined js script function mediate
>>>
>>> but I have looked into the wirelogs and the json message comes to the
>>> sequence.
>>>
>>> [2018-01-09 20:37:55,445] DEBUG - wire HTTPS-Listener I/O dispatcher-6
>>> >> "Accept-Language: en-US,en;q=0.9,nl;q=0.8[\r][\n]"
>>> [2018-01-09 20:37:55,445] DEBUG - wire HTTPS-Listener I/O dispatcher-6
>>> >> "[\r][\n]"
>>> [2018-01-09 20:37:55,445] DEBUG - wire HTTPS-Listener I/O dispatcher-6
>>> >> "{[\n]"
>>> [2018-01-09 20:37:55,445] DEBUG - wire HTTPS-Listener I/O dispatcher-6
>>> >> "  *"PhoneNumbers": ["123456789"][\n]"*
>>> [2018-01-09 20:37:55,445] DEBUG - wire HTTPS-Listener I/O dispatcher-6
>>> >> "}"
>>>
>>> What could be the reason for this? Any other suggestions to access
>>> message context inside a script mediator.
>>>
>>> Thanks and Regards,
>>> Sameera.
>>> --
>>> Sameera Gunarathne
>>> Software Engineer, WSO2 Inc. http://wso2.com
>>> 
>>> Email: samee...@wso2.com
>>> Mobile: +94714155561
>>>
>>
>>
>>
>> --
>> Milinda Perera
>> Senior Software Engineer;
>> WSO2 Inc. http://wso2.com ,
>> Mobile: (+94) 714 115 032 <+94%2071%20411%205032>
>>
>>
>
>
> --
> Sameera Gunarathne
> Software Engineer, WSO2 Inc. http://wso2.com
> 
> Email: samee...@wso2.com
> Mobile: +94714155561
>
> ___
> Dev mailing list
> Dev@wso2.org
> http://wso2.org/cgi-bin/mailman/listinfo/dev
>
>


-- 
Thanks and Regards,

Isuru H.
+94 716 358 048* *
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


Re: [Dev] [APIM-220][Rest API] Creating an API with Access Control restricted to roles

2018-01-16 Thread Chathurika De Silva
Hi Kavitha

Thank you. It worked. I have reported a doc issue as this information
should be included to documentation

[1] https://github.com/wso2/product-apim/issues/2431

Best Regards
Erandi

On Tue, Jan 16, 2018 at 3:05 PM, Kavitha Subramaniyam 
wrote:

> Hi Chathurika,
>
> I hope you were trying to add access control with restricted by roles and
> not the visibility. Can you please try the below parameters and see?
>
> "accessControl": "RESTRICTED",
> "accessControlRoles": [
> "rolename"
> ],
>
> Thanks,
> Kavitha
>
> On Tue, Jan 16, 2018 at 2:59 PM, Sanjeewa Malalgoda 
> wrote:
>
>> In this document[1] we have added sample request to create API. There we
>> have visibility and visible roles attributes.
>>
>> "visibility": "PUBLIC", "visibleRoles": [], "visibleTenants": [],
>>
>> [1]https://docs.wso2.com/display/AM210/apidocs/publisher/#!/
>> operations#APICollection#apisPost
>>
>> Thanks,
>> sanjeewa.
>>
>> On Tue, Jan 16, 2018 at 2:55 PM, Chathurika De Silva <
>> chathuri...@wso2.com> wrote:
>>
>>> Hi
>>>
>>> I am trying to creating an api using the rest interfaces to have access
>>> control for selected roles. In Publisher UI i can set "Restricted to Roles"
>>> as Access Control mechanism. Referred [1] to find the relevant parameter to
>>> set the above through the REST APIs but couldn't find the reference. Any
>>> help regarding this is much appreciated.
>>>
>>> [1] https://docs.wso2.com/display/AM210/apidocs/publisher/#!/models#API
>>>
>>>
>>> Thanks
>>> Erandi
>>>
>>> *Chathurika Erandi*
>>> Senior Software Engineer,
>>> WSO2 Inc.
>>>
>>> *E-mail:* chathuri...@wso2.com
>>> *Mobile: *+94714 328 612
>>> *Blog*: chathurikaerandi.blogspot.com
>>>
>>
>>
>>
>> --
>>
>> *Sanjeewa Malalgoda*
>> WSO2 Inc.
>> Mobile : +94713068779 <+94%2071%20306%208779>
>>
>> blog
>> :http://sanjeewamalalgoda.blogspot.com/
>> 
>>
>>
>>
>
>
> --
> Kavitha.S
> *Software Engineer -QA*
> email : kavi...@wso2.com
> Mobile : +94 (0) 771538811 <%2B94%20%280%29%20773%20451194>
>
>


-- 
*Chathurika Erandi*
Senior Software Engineer,
WSO2 Inc.

*E-mail:* chathuri...@wso2.com
*Mobile: *+94714 328 612
*Blog*: chathurikaerandi.blogspot.com
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


Re: [Dev] WSO2 Oxygen Tank > Manage endpoint text responses from proxy (Unexpected character 'some_character' code 45 in prolog expected '<')

2018-01-16 Thread Marcos Tarín Esteve
Hi Nadeeshaan

Very grateful for your help

The error I reported was obtained from the log file. It is the only one found.

TID: [-1234] [] [2017-12-21 17:15:38,305] ERROR 
{org.apache.synapse.transport.passthru.util.RelayUtils} -  Error while building 
Passthrough stream {org.apache.synapse.transport.passthru.util.RelayUtils}
org.apache.axiom.om.OMException: 
com.ctc.wstx.exc.WstxUnexpectedCharException: Unexpected character '-' (code 
45) in prolog; expected '<'

I only show a single line belonging to the log for privacy issues.

It is clear that the problem is that WSO-ESB receives a response from the 
endpoint in which its first character is a symbol symbol '-' and that is why 
ESB gives error.


--urn:uuid:ax7xx36-98xx9-4ex1-bxxc-ax1x8bxc
Content-Type: text/xml; charset=utf-8
Content-Transfer-Encoding: 8bit
Content-ID: 


http://schemas.xmlsoap.org/soap/envelope/;
 
xmlns:ns1="https://.es//ws/ws_v2/1.0/infoEnvioV2;>


xa3x2x8xx7




--urn:uuid:a07xxx6-9xxx9-4xxa1-xx9c-a91dxxbcc
Content-Type: application/octet-stream; charset=utf-8
Content-Transfer-Encoding: binary
Content-ID: 
http://xx.x.x.xxx/Texto_de_prueba.txt
--urn:uuid:a07xxx6-9xxx9-4ea1-bxxc-a9xxx0c8bcc-

I also tried configurations with "BinaryRelayBuilder and the 
ExpandingMessageFormatter" included within the proxy. But they had no effect.

"the provided response is a single response, then it is a multipart response as 
I understood correctly." ==> Sorry I did not understand your sentence. I try to 
explain better. The answer coming from the endpoint is simple, with the 
particularity that besides SOAP labels, it adds extra information related a 
file. It seems is the file, or access information to it, which seems to be 
encoded in octet format within the response.

if I could erase all the information in the answer except the SOAP information:


http://schemas.xmlsoap.org/soap/envelope/;
 
xmlns:ns1="https://.es//ws/ws_v2/1.0/infoEnvioV2;>


xa3x2x8xx7




I am sure that I found that WSO2-ESB would work.

We’ll be in contact … Thanks

Marcos

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


Re: [Dev] [APIM2xx] how to add an api level throttling policy for "Apply to API" using updateAPI from publisher rest api?

2018-01-16 Thread Sanjeewa Malalgoda
Can we address this and fix it for 2.2.0?

Thanks,
sanjeewa.

On Fri, Jan 12, 2018 at 4:23 PM, Kavitha Subramaniyam 
wrote:

> Thanks Rajith to pointing out!
>
> @Harsha, please find the github issue created on [1]
> [1] https://github.com/wso2/product-apim/issues/2388
>
> Thanks,
>
> On Fri, Jan 12, 2018 at 3:59 PM, Harsha Kumara  wrote:
>
>> Yes, it seems like we have missed it. Please create a github issue.
>>
>> On Fri, Jan 12, 2018 at 3:44 PM, Rajith Roshan  wrote:
>>
>>> Hi,
>>>
>>> It seems like API level policy is not included in the APIDTO object[1].
>>> Hence this is not supported with rest api
>>>
>>> [1] - https://github.com/wso2/carbon-apimgt/blob/6.x/components/
>>> apimgt/org.wso2.carbon.apimgt.rest.api.store/src/gen/java/or
>>> g/wso2/carbon/apimgt/rest/api/store/dto/APIDTO.java
>>>
>>> Thanks!
>>> Rajith
>>>
>>> On Fri, Jan 12, 2018 at 12:13 PM, Kavitha Subramaniyam >> > wrote:
>>>
 Hi all,

 While am trying to update API for my scenario using publisher rest api,
 I need to add a throttling policy (advance policy created from admin
 dashboard) specifically for API (Apply to API). By following this doc[1], I
 couldn't find a specific parameter to do this.

 Observation:
 I have modified API from UI and added api level throttling policy
 (change2.jpeg) and retrieved api details, but the response doesn't return a
 value for relevant field in api object[2]. Same way when I change API to
 add resource level policy (change1.jpeg) response values are returned in
 API definition.

 Appreciate your insight on this please.

 [1] https://docs.wso2.com/display/AM210/apidocs/publisher/#!
 /operations#APIIndividual#apisApiIdPut
 [2]
 {
 "id": "47027dad-12ff-4e31-84ce-4d574a8caa1b",
 "name": "Mobile_stock_API",
 "description": "This is the api description",
 "context": "/stocks",
 "version": "1.0.0",
 "provider": "admin",
 "apiDefinition": "{\"swagger\":\"2.0\",\"paths\
 ":{\"/stock/{id}\":{\"get\":{\"responses\":{\"200\":{\"descr
 iption\":\"\"}},\"parameters\":[{\"name\":\"id\",\"in\":\"pa
 th\",\"allowMultiple\":false,\"required\":true,\"type\":\"st
 ring\"}],\"x-auth-type\":\"Application & Application
 User\",\"x-throttling-tier\":\"headerPolicy\"}},\"/stocks\":
 {\"get\":{\"responses\":{\"200\":{\"description\":\"\"}},\"x-auth-type\":\"Application
 & Application User\",\"x-throttling-tier\":\
 "ipPolicy\"}}},\"info\":{\"title\":\"Mobile_stock_API\",\"ve
 rsion\":\"1.0.0\"}}",
 "wsdlUri": null,
 "status": "PUBLISHED",
 "responseCaching": "Disabled",
 "cacheTimeout": 300,
 "destinationStatsEnabled": null,
 "isDefaultVersion": false,
 "type": "HTTP",
 "transport": [
 "https"
 ],
 "tags": [],
 "tiers": [
 "Gold",
 "Unlimited"
 ],
 "maxTps": {
 "production": 500,
 "sandbox": null
 },
 "thumbnailUri": null,
 "visibility": "PUBLIC",
 "visibleRoles": [],
 "accessControl": "NONE",
 "accessControlRoles": [],
 "visibleTenants": [],
 "endpointConfig": "{\n  \"production_endpoints\": {\n\"url\": \"
 http://localhost:9763/sample-data-backend/rservice/stockservice/\",\n
\"config\": null,\n\"template_not_supported\": false\n  },\n
  \"endpoint_type\": \"http\"\n}",
 "endpointSecurity": null,
 "gatewayEnvironments": "Production and Sandbox",
 "sequences": [],
 "subscriptionAvailability": "current_tenant",
 "subscriptionAvailableTenants": [],
 "businessInformation": {
 "technicalOwnerEmail": null,
 "businessOwnerEmail": null,
 "businessOwner": null,
 "technicalOwner": null
 },
 "corsConfiguration": {
 "accessControlAllowOrigins": [],
 "accessControlAllowCredentials": false,
 "corsConfigurationEnabled": false,
 "accessControlAllowHeaders": [],
 "accessControlAllowMethods": []
 },
 "additionalProperties": {}
 }


 Thanks,
 Kavitha

 --
 Kavitha.S
 *Software Engineer -QA*
 email : kavi...@wso2.com
 Mobile : +94 (0) 771538811 <%2B94%20%280%29%20773%20451194>


>>>
>>>
>>> --
>>> Rajith Roshan
>>> Senior Software Engineer, WSO2 Inc.
>>> Mobile: +94-7 <%2B94-71-554-8430>17-064-214
>>>
>>
>>
>>
>> --
>> Harsha Kumara
>> Software Engineer, WSO2 Inc.
>> Mobile: +94775505618 <+94%2077%20550%205618>
>> Blog:harshcreationz.blogspot.com
>>
>
>
>
> --
> Kavitha.S
> *Software Engineer -QA*
> email : kavi...@wso2.com
> Mobile : +94 (0) 771538811 <%2B94%20%280%29%20773%20451194>
>
>


-- 

*Sanjeewa Malalgoda*
WSO2 Inc.
Mobile : +94713068779

blog
:http://sanjeewamalalgoda.blogspot.com/

___
Dev mailing list
Dev@wso2.org

Re: [Dev] [APIM-220][Rest API] Creating an API with Access Control restricted to roles

2018-01-16 Thread Kavitha Subramaniyam
Hi Chathurika,

I hope you were trying to add access control with restricted by roles and
not the visibility. Can you please try the below parameters and see?

"accessControl": "RESTRICTED",
"accessControlRoles": [
"rolename"
],

Thanks,
Kavitha

On Tue, Jan 16, 2018 at 2:59 PM, Sanjeewa Malalgoda 
wrote:

> In this document[1] we have added sample request to create API. There we
> have visibility and visible roles attributes.
>
> "visibility": "PUBLIC", "visibleRoles": [], "visibleTenants": [],
>
> [1]https://docs.wso2.com/display/AM210/apidocs/publisher/#!/operations#
> APICollection#apisPost
>
> Thanks,
> sanjeewa.
>
> On Tue, Jan 16, 2018 at 2:55 PM, Chathurika De Silva  > wrote:
>
>> Hi
>>
>> I am trying to creating an api using the rest interfaces to have access
>> control for selected roles. In Publisher UI i can set "Restricted to Roles"
>> as Access Control mechanism. Referred [1] to find the relevant parameter to
>> set the above through the REST APIs but couldn't find the reference. Any
>> help regarding this is much appreciated.
>>
>> [1] https://docs.wso2.com/display/AM210/apidocs/publisher/#!/models#API
>>
>>
>> Thanks
>> Erandi
>>
>> *Chathurika Erandi*
>> Senior Software Engineer,
>> WSO2 Inc.
>>
>> *E-mail:* chathuri...@wso2.com
>> *Mobile: *+94714 328 612
>> *Blog*: chathurikaerandi.blogspot.com
>>
>
>
>
> --
>
> *Sanjeewa Malalgoda*
> WSO2 Inc.
> Mobile : +94713068779 <+94%2071%20306%208779>
>
> blog :http://sanjeewamalalgoda.
> blogspot.com/ 
>
>
>


-- 
Kavitha.S
*Software Engineer -QA*
email : kavi...@wso2.com
Mobile : +94 (0) 771538811 <%2B94%20%280%29%20773%20451194>
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


[Dev] [APIM-220][Rest API] Creating an API with Access Control restricted to roles

2018-01-16 Thread Chathurika De Silva
Hi

I am trying to creating an api using the rest interfaces to have access
control for selected roles. In Publisher UI i can set "Restricted to Roles"
as Access Control mechanism. Referred [1] to find the relevant parameter to
set the above through the REST APIs but couldn't find the reference. Any
help regarding this is much appreciated.

[1] https://docs.wso2.com/display/AM210/apidocs/publisher/#!/models#API


Thanks
Erandi

*Chathurika Erandi*
Senior Software Engineer,
WSO2 Inc.

*E-mail:* chathuri...@wso2.com
*Mobile: *+94714 328 612
*Blog*: chathurikaerandi.blogspot.com
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


Re: [Dev] Adding values to a field in request using enrich mediator

2018-01-16 Thread vikram nayak
Hi,
Tried to explain little more.I have to append a random number to "too many ids" 
present in my request.
Actual request consists of thousands of lines and there are many ids in it.
some ids are within array , some are direct elements.sample input : {  "id" : 
"1",   {    "id":"2"      }}
I think this could be achieved by doing following for each id present in 
request.
1.  by first acessing the id in a property say property1.2. Then generating the 
random Number in property2.3. Then creating third property, to where i assign 
value of "property1 + property2" to  property3.5. Then assign property 3 to 
first id in request using enrich mediator.
But I think this is not ideal way to do it. Since I have to do it for many id's 
in request.There should be some way to enrich request directly using one enrich 
mediator somewhat  like below
$body.Lookups.$id = $body.Lookups.$id +  get-property('randomNumber');
For below sample input 

Suppose in this loop the randomNumber generated is 100 and kept in property1.
{  "id" : "1",   {    "id":"2"      }   .   .   .   .   "id"="100"}
sample output should be like below :
{  "id" : "1100",   {    "id":"2100"      }   .   .   .   .   "id": "100100"}
i.e. original value + "100"
i.e. I need to add suffix at the end of each id in request.
Please guide.
Thanks,


 

On Tuesday, 16 January 2018 12:17 PM, vikram nayak  
wrote:
 

 Hi,
I have to add a random number to too many ids present in my request.
Actual request consists of thousands of lines and there are many ids in it.
some ids are within array , some are direct elements.
{  "id" : "1",   {    "id":"2"   }}
1. I can do this by first aceessing the id in a property say property1.2. Then 
generating the random Number in property2.3. Then creating third property, to 
where i assign value of property1 + property2 to  property3.5. Then assign 
property 3 to first id in request using enrich mediator.
But I think this is not ideal way to do it. Since I have to do it for many id's 
in request.There should be some way to enrich request directly using one enrich 
mediator
$body.Lookups.$id = $body.Lookups.$id +  get-property('randomNumber');
Thanks

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


Re: [Dev] Image persisting and retrieval mechanism for WSO2 IoT Server

2018-01-16 Thread Waruna Jayaweera
Hi Nuwan,

AFAIU if the requirement is to store the images, another approach would be
to store them directly in file system something similar we did for file
transfer feature. You can have some file sync mechanism or FTP server to
support clustering.

Thanks,
Waruna

On Tue, Jan 16, 2018 at 1:10 PM, Ruwan Yatawara  wrote:

> As to my knowledge, image analysis is not supported, and won't be
> supported in the near future.
>
> @Mohan, @Ramindu, please correct me if I am wrong.
>
> Thanks and Regards,
>
> Ruwan Yatawara
>
> Technical Lead,
> WSO2 Inc.
>
> email : ruw...@wso2.com
> mobile : +94 77 9110413
> http://ruwansrants.blogspot.com/
> https://500px.com/ruwan_ace
> https://medium.com/@ruwanyatawara
>
>
> On Tue, Jan 16, 2018 at 1:01 PM, Nuwan Jayawardene 
> wrote:
>
>> Hi Madawa,
>>
>> Have you evaluated this approach? What are the advantages and drawbacks
>>> in terms of storage and retrieval of images by following this approach?
>>
>>
>> I've yet to look more into this option. I was actually hoping for some
>> feedback on whether or not I should pursue this or stick with the RDBMS
>> approach since I'm not experienced enough with Siddhi to do a knowledgeable
>> assessment.
>> At the moment, for the use case at hand, a simple storage and retrieval
>> would suffice. But if we consider the long run IMO it would be smarter to
>> go with a Siddhi based approach.
>> Then again comes the issue of whether Siddhi streams support image
>> analytics.
>>
>> On Tue, Jan 16, 2018 at 12:50 PM, Madawa Soysa  wrote:
>>
>>> Hi Nuwan,
>>>
>>> One other approach suggested to me was to use a *Siddhi Stream for both
 storage and retrieval* purposes. This would further allow for
 analytics to be performed on the data which not be very much possible with
 the earlier mentioned approaches.
>>>
>>>
>>> Have you evaluated this approach? What are the advantages and drawbacks
>>> in terms of storage and retrieval of images by following this approach?
>>>
>>> On Tue, Jan 16, 2018 at 12:36 PM, Geeth Munasinghe 
>>> wrote:
>>>


 On Tue, Jan 16, 2018 at 10:52 AM, Nuwan Jayawardene 
 wrote:

> Hi all,
>
> I'm currently working on a project to add image storing and retrieval
> capabilities to the WSO2 IoT Server.
>
> To achieve this I have implemented the following;
> 1) Added a separate DAO Table with a field with LONGBLOB data type for
> storing.
> 2) Added storage capabilities in the database for an image sent as a *File
> *in the form of a *BinaryStream*.
>
> As of now, I've written unit tests and the test images are getting
> stored successfully in the database.
>
> The problem lies in how to successfully retrieve the stored data. For
> this, I have come across 2 possible approaches.
> 1) *Retrieve as a File - *The notable downside I realized with this
> solution is that each time a new Image is retrieved, a new file will be
> created. Therefore measures would have to be taken to persist new files
> while purging older obsolete ones.
> 2) *Retrieve as BinaryStream - *Although this requires no persistent
> memory usage and the data will only be retrieved on call and issues may
> come up when representing that data from a UI end. Further analysis is
> required for this approach.
>

 +1 for retrieving as a BinaryStream. This will make it easy to handle
 in the java level unlike handling as a file. This has to work in the
 cluster of servers, hence retrieving as a file will cause other syncing
 issues.


> 3) *Retrieve as FileOutputStream - *This is my preferred method and
> the one recommended mostly in forums and tutorials.
>
> One other approach suggested to me was to use a *Siddhi Stream for
> both storage and retrieval* purposes. This would further allow for
> analytics to be performed on the data which not be very much possible with
> the earlier mentioned approaches.
>
> Suggestions and Feedback are appreciated.
> Thanks and regards!
>
> --
> *Nuwan Jayawardene*
> *Software Engineering Intern*
> *WSO2, Inc.:http://wso2.com *
> *lean.enterprise.middleware*
> *Mobile  :- +94 71 1813299 <+94%2071%20181%203299>*
>
>
>- *Linkedin* *:- **https://www.linkedin.com/in/nuwa
>**njaya/
>*
>- * *
>
>


 --
 *Geeth Munasinghe*
 *WSO2, Inc. http://wso2.com  *
 *lean.enterprise.middleware.*

 email: ge...@wso2.com
 phone:(+94) 777911226 <+94%2077%20791%201226>

 

 --
 You received this message because you are subscribed to the Google
 Groups "WSO2 IoT Team 

Re: [Dev] Image persisting and retrieval mechanism for WSO2 IoT Server

2018-01-16 Thread Madawa Soysa
On Tue, Jan 16, 2018 at 1:10 PM, Ruwan Yatawara  wrote:

> As to my knowledge, image analysis is not supported, and won't be
> supported in the near future.
>
> @Mohan, @Ramindu, please correct me if I am wrong.
>

In that case, it is better to go with the BinaryStream approach.

+1 for retrieving as a BinaryStream.


> Thanks and Regards,
>
> Ruwan Yatawara
>
> Technical Lead,
> WSO2 Inc.
>
> email : ruw...@wso2.com
> mobile : +94 77 9110413
> http://ruwansrants.blogspot.com/
> https://500px.com/ruwan_ace
> https://medium.com/@ruwanyatawara
>
>
> On Tue, Jan 16, 2018 at 1:01 PM, Nuwan Jayawardene 
> wrote:
>
>> Hi Madawa,
>>
>> Have you evaluated this approach? What are the advantages and drawbacks
>>> in terms of storage and retrieval of images by following this approach?
>>
>>
>> I've yet to look more into this option. I was actually hoping for some
>> feedback on whether or not I should pursue this or stick with the RDBMS
>> approach since I'm not experienced enough with Siddhi to do a knowledgeable
>> assessment.
>> At the moment, for the use case at hand, a simple storage and retrieval
>> would suffice. But if we consider the long run IMO it would be smarter to
>> go with a Siddhi based approach.
>> Then again comes the issue of whether Siddhi streams support image
>> analytics.
>>
>> On Tue, Jan 16, 2018 at 12:50 PM, Madawa Soysa  wrote:
>>
>>> Hi Nuwan,
>>>
>>> One other approach suggested to me was to use a *Siddhi Stream for both
 storage and retrieval* purposes. This would further allow for
 analytics to be performed on the data which not be very much possible with
 the earlier mentioned approaches.
>>>
>>>
>>> Have you evaluated this approach? What are the advantages and drawbacks
>>> in terms of storage and retrieval of images by following this approach?
>>>
>>> On Tue, Jan 16, 2018 at 12:36 PM, Geeth Munasinghe 
>>> wrote:
>>>


 On Tue, Jan 16, 2018 at 10:52 AM, Nuwan Jayawardene 
 wrote:

> Hi all,
>
> I'm currently working on a project to add image storing and retrieval
> capabilities to the WSO2 IoT Server.
>
> To achieve this I have implemented the following;
> 1) Added a separate DAO Table with a field with LONGBLOB data type for
> storing.
> 2) Added storage capabilities in the database for an image sent as a *File
> *in the form of a *BinaryStream*.
>
> As of now, I've written unit tests and the test images are getting
> stored successfully in the database.
>
> The problem lies in how to successfully retrieve the stored data. For
> this, I have come across 2 possible approaches.
> 1) *Retrieve as a File - *The notable downside I realized with this
> solution is that each time a new Image is retrieved, a new file will be
> created. Therefore measures would have to be taken to persist new files
> while purging older obsolete ones.
> 2) *Retrieve as BinaryStream - *Although this requires no persistent
> memory usage and the data will only be retrieved on call and issues may
> come up when representing that data from a UI end. Further analysis is
> required for this approach.
>

 +1 for retrieving as a BinaryStream. This will make it easy to handle
 in the java level unlike handling as a file. This has to work in the
 cluster of servers, hence retrieving as a file will cause other syncing
 issues.


> 3) *Retrieve as FileOutputStream - *This is my preferred method and
> the one recommended mostly in forums and tutorials.
>
> One other approach suggested to me was to use a *Siddhi Stream for
> both storage and retrieval* purposes. This would further allow for
> analytics to be performed on the data which not be very much possible with
> the earlier mentioned approaches.
>
> Suggestions and Feedback are appreciated.
> Thanks and regards!
>
> --
> *Nuwan Jayawardene*
> *Software Engineering Intern*
> *WSO2, Inc.:http://wso2.com *
> *lean.enterprise.middleware*
> *Mobile  :- +94 71 1813299 <+94%2071%20181%203299>*
>
>
>- *Linkedin* *:- **https://www.linkedin.com/in/nuwa
>**njaya/
>*
>- * *
>
>


 --
 *Geeth Munasinghe*
 *WSO2, Inc. http://wso2.com  *
 *lean.enterprise.middleware.*

 email: ge...@wso2.com
 phone:(+94) 777911226 <+94%2077%20791%201226>

 

 --
 You received this message because you are subscribed to the Google
 Groups "WSO2 IoT Team Group" group.
 To unsubscribe from this group and stop receiving emails from it, send
 an email to iot-group+unsubscr...@wso2.com.
 For more options, 

Re: [Dev] Could not locate library smooks-libs/antlr-2.7.7.jar in bundle org.wso2.developerstudio.eclipse.esb.libraries, when adding library

2018-01-16 Thread Nipuni Chandrasoma
Hi all,

I have tried the same scenario which is "Creating a Smooks configuration
artifact" by referring the documentation [1] and I get exactly the same
error [2] as mentioned.

Any input on this is highly appreciated.

[1].
https://docs.wso2.com/display/DVS380/Creating+ESB+Artifacts#CreatingESBArtifacts-CreatingaSmooksconfigurationartifact
[2]. "Could not locate library smooks-libs/antlr-2.7.7.jar in bundle
org.wso2.developerstudio.eclipse.esb.libraries."
and this is valid for each runtime library file in the list.


Thanks
Nipuni


On Tue, Jan 16, 2018 at 1:28 PM, Sewmini Jayaweera  wrote:

> [Adding NipuniC]
>
> Sewmini Jayaweera
> *Software Engineer - Support Team*
> Mobile: +94 (0) 773 381 250 <+94%2077%20338%201250>
> sewm...@wso2.com
>
> On Wed, Dec 14, 2016 at 6:56 PM, Schürpf, Thomas <
> thomas.schue...@koch-it.ch> wrote:
>
>> We are using the WSO2 ESB Tooling 5.0 and installed it as described at
>> https://docs.wso2.com/display/ESB500/Installing+WSO2+ESB+Tooling .
>>
>>
>>
>> I am using the description from this link: https://docs.wso2.com/display/
>> ESB500/Working+with+ESB+Artifacts .
>>
>>
>> Following the instructions in section "Creating a Smooks configuration
>> artifact" I get the following error when trying to add the libraries from
>> the Smooks framework to my registry resources project:
>>
>>
>> "Could not locate library smooks-libs/antlr-2.7.7.jar in bundle
>> org.wso2.developerstudio.eclipse.esb.libraries."
>>
>>
>> I checked each runtime library individually, but each of them resulted in
>> the same error.
>>
>> It is also strange, that the entry "WSO2 Classpath Libraries" is twice in
>> the list of the "Add Library" dialogue.
>>
>>
>> Any information on how to proceed is appreciated .
>>
>>
>> Regards,
>>
>> Thomas
>>
>>
>>
>> ___
>> Dev mailing list
>> Dev@wso2.org
>> http://wso2.org/cgi-bin/mailman/listinfo/dev
>>
>>
>


-- 
Regards


*Nipuni Chandrasoma*

*Software Engineer | Support Team*
*WSO2*

*Email : nipu...@wso2.com *
*Mobile : +94 777133895 <+94%2077%20778%208129>*
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


Re: [Dev] [IAM] User store does not behave as expected when it is created through admin services with only mandatory parameters

2018-01-16 Thread Sherene Mahanama
Hi IAM Team,

The UserStoreConfigAdminService has been documented in [1]. I have also
added a tip under the addUserStore operation that links off to the relevant
docs for a full list of properties including optional properties for each
user store type.

However, the sample request given under the addUserStore() operation [2]
only includes mandatory parameters which will not work as mentioned by
Dilini and Godwin. Can we please have a working sample request that we can
add to the doc? Which optional parameters need to be included in the
request for it to work as expected? Please advise.

[1] https://docs.wso2.com/display/IS5xx/Managing+User+Stores+with+APIs
[2]
https://docs.wso2.com/display/IS5xx/Managing+User+Stores+with+APIs#ManagingUserStoreswithAPIs-addUserStore()

Thanks,
Sherene

On Thu, Dec 21, 2017 at 9:18 AM, Dilini Gunatilake  wrote:

> Hi Tharindu/Godwin,
>
> I already checked the config file. The default regex were not added.
> Following are the only configs available in the file (which are the ones I
> configured).
>
>  class="org.wso2.carbon.user.core.jdbc.JDBCUserStoreManager">
>   jdbc:mysql://localhost:3306/is520user Property>
>   wso2carbon
>   A1yNIeGmb1QZHDIk09yOyx/+
> PWDPNRfOk6tCiCnQWzhFiXFaVu5dSWfqah7AElOdKqjgl0BOFdk4sXRGtjdP
> M3t8bODe9KzKrA3EJJ2mP16zbOah8JhFMJJDWOw0wkBy4TSnl7GBrGJMzQTazzYaxN/+
> nVpF25nbq1p7TzNytOJxagNMRjwnhgl08lFPNKs1VCJ1D4spQ4zjLp5oJBft
> dzMdi5wPo8tdNWu/oRRPZjz4Y/mWy4cE7hHZlPul3kYzm1BP2kWX/
> rsUgRdaKeSKaQwqNVOOsZxCgWTCanUMmZKvHOxehVe3BypebciR58RQH5Vyk
> 6l+JCrXNvBN1OBOoA==
>   com.mysql.jdbc.Driver
>   org.wso2.carbon.identity.user.
> store.count.jdbc.JDBCUserStoreCountRetriever
>   PRIMARY-JDBC780-ATTRIBUTE-STORE Property>
>   created with admin services
> 
>
>
> @Godwin -  +1 for the approach.
>
> Thanks,
> Dilini
>
>
> On Wed, Dec 20, 2017 at 11:25 PM, Tharindu Edirisinghe  > wrote:
>
>> Hi Dilini,
>>
>> After adding the secondary userstore, you can find the config file
>> related to that in *repository/deployment/server/userstores/* location.
>> Although you have not added the regex parameters when you created the
>> userstore from the admin service, I believe it should have added some
>> default regex there. You need to check the following two properties in the
>> file.
>>
>>
>>
>> *PasswordJavaRegExPasswordJavaScriptRegEx*
>>
>> You can find more information on the password pattern validation from [1].
>>
>> [1] http://tharindue.blogspot.com/2016/08/user-password-pattern-
>> regex-front-end.html
>>
>> Thanks,
>> TharinduE
>>
>> On Wed, Dec 20, 2017 at 11:46 AM, Godwin Shrimal  wrote:
>>
>>> Hi Dilini,
>>>
>>> Please see my comments.
>>>
>>>
>>> I think it makes sense to populate additional parameters in UI when
>> adding user store from the management console.
>>
> Yes, this is handled correctly from the management console side as
>> expected.
>>
>>
>>> Yeah, when adding user store via admin services its bit hard to add
>>> those number of optional parameters. So I propose following solutions.
>>>
>>> 1. Improve our documentation and describe required optional
>>> parameters and add a sample request with optional parameters
>>>
>> In this case, every time the optional properties are changed the doc
>> needs to be updated and the developer needs to update the request too.
>>
> I don't think optional parameters are changing frequently, it is
> something changing rearely when we need to introudce some feature to
> perticluar user store. And if optional parameters added newly, existing
> request should work as expected without breaking and not MUST to add that
> parameters to request.
>
 But, in this case it is a must to add the optional parameters in the
 request which is wrong. This hinders the usability aspect from the user
 perspective. So, IMO we should document the full request as well as handle
 it as per solution 2.

>>>
>>> As an API its not wrong not to send optional parameters, But yes. Its
>>> not working as expected if we not send them. Yes, we need to fully document
>>> the request with optional parameters as suggested in solution1 as an
>>> imidiate step. We may need implement the solution 2 in future. Lets wait
>>> and see the feedback from IAM team.
>>>
>>>
>>> Thanks
>>> Godwin
>>>
>>>
>>>

>
>>> 2. Change backend to add default parameters (same as what we do in
>>> UI) if user is not sending additional parameters in request
>>>
>> +1 for this solution. Here, the developer does not need to worry
>> about the 100 odd optional parameters at all. If he needs to change few
>> parameters, he can change only the required ones.
>>
>>>
>>>
>>> Thanks
>>> Godwin
>>>
>>> On Wed, Dec 20, 2017 at 5:00 PM, Dilini Gunatilake >> > wrote:
>>>
 Hi IAM Team,

 I 

Re: [Dev] Could not locate library smooks-libs/antlr-2.7.7.jar in bundle org.wso2.developerstudio.eclipse.esb.libraries, when adding library

2018-01-16 Thread Sewmini Jayaweera
[Adding NipuniC]

Sewmini Jayaweera
*Software Engineer - Support Team*
Mobile: +94 (0) 773 381 250
sewm...@wso2.com

On Wed, Dec 14, 2016 at 6:56 PM, Schürpf, Thomas  wrote:

> We are using the WSO2 ESB Tooling 5.0 and installed it as described at
> https://docs.wso2.com/display/ESB500/Installing+WSO2+ESB+Tooling .
>
>
>
> I am using the description from this link: https://docs.wso2.com/display/
> ESB500/Working+with+ESB+Artifacts .
>
>
> Following the instructions in section "Creating a Smooks configuration
> artifact" I get the following error when trying to add the libraries from
> the Smooks framework to my registry resources project:
>
>
> "Could not locate library smooks-libs/antlr-2.7.7.jar in bundle
> org.wso2.developerstudio.eclipse.esb.libraries."
>
>
> I checked each runtime library individually, but each of them resulted in
> the same error.
>
> It is also strange, that the entry "WSO2 Classpath Libraries" is twice in
> the list of the "Add Library" dialogue.
>
>
> Any information on how to proceed is appreciated .
>
>
> Regards,
>
> Thomas
>
>
>
> ___
> 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