Re: [Dev] Issue with ESB 4.8 and SoupUI

2014-01-01 Thread Ravi Undupitiya
This is a bug. For the time being a work around is to wrap the separate
elements inside a root element like:

root
  a1aaa/a1
  b1bbb/b1
/root




On Sat, Dec 28, 2013 at 3:17 PM, indika prasad indika@gmail.com wrote:

 Hi,

 I have a issue with below proxy and SoupUI.

 Proxy
 
 ?xml version=1.0 encoding=UTF-8?
 proxy xmlns=http://ws.apache.org/ns/synapse;
name=souptest
transports=https,http
statistics=disable
trace=disable
startOnLoad=true
target
   inSequence
  payloadFactory media-type=json
 format{
   contentType:linkedin-html,
   body:update body
 }/format
 args/
  /payloadFactory
  property name=messageType value=application/json
 scope=axis2/
  send
 endpoint
address uri=http://localhost:8281/services/jsonService;
 format=rest/
 /endpoint
  /send
   /inSequence
/target
description/
 /proxy

 

 01. Using SoupUI with following request send the expected massage to the
 given endpoint.
 soapenv:Envelope xmlns:soapenv=http://schemas.xmlsoap.org/soap/envelope/
 
 
 soap request-
 soapenv:Header/
soapenv:Body
   a1aaa/a1
   /soapenv:Body
 /soapenv:Envelope
  
 TCPMon out put-
 POST /services/jsonService HTTP/1.1
 Accept-Encoding: gzip,deflate
 Content-Type: application/json
 SOAPAction:
 Transfer-Encoding: chunked
 Host: 127.0.0.1:8281
 Connection: Keep-Alive
 User-Agent: Synapse-PT-HttpComponents-NIO

 47
 {
 contentType:linkedin-html,
 body:update body
 }
 0

 

 02. Using SoapUI with following request send the strange massage to the
 endpoint. Where the payload has replaced by the second element of the soup
 request!
 --soup request
 soapenv:Envelope xmlns:soapenv=http://schemas.xmlsoap.org/soap/envelope/
 
 
soapenv:Header/
soapenv:Body
   a1aaa/a1
   b1bbb/b1
   /soapenv:Body
 /soapenv:Envelope
 ---
 TCPMon out put-
 POST /services/jsonService HTTP/1.1
 Accept-Encoding: gzip,deflate
 Content-Type: application/json
 SOAPAction:
 Transfer-Encoding: chunked
 Host: 127.0.0.1:8281
 Connection: Keep-Alive
 User-Agent: Synapse-PT-HttpComponents-NIO

 c
 {b1:bbb}
 0

 

 Thanks
 Indika



 --
 View this message in context:
 http://wso2-oxygen-tank.10903.n7.nabble.com/Issue-with-ESB-4-8-and-SoupUI-tp90206.html
 Sent from the WSO2 Development mailing list archive at Nabble.com.
 ___
 Dev mailing list
 Dev@wso2.org
 http://wso2.org/cgi-bin/mailman/listinfo/dev




-- 
*Ravi Undupitiya*
Software Engineer; WSO2 Inc.; http://wso2.com


*E-mail: r...@wso2.com http://wso2.com**M: **+94 772 930 712*

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


Re: [Dev] Issue with ESB 4.8 and SoupUI

2014-01-01 Thread Ravi Undupitiya
Please see https://wso2.org/jira/browse/ESBJAVA-2815 for details on this
issue.


On Sat, Dec 28, 2013 at 3:17 PM, indika prasad indika@gmail.com wrote:

 Hi,

 I have a issue with below proxy and SoupUI.

 Proxy
 
 ?xml version=1.0 encoding=UTF-8?
 proxy xmlns=http://ws.apache.org/ns/synapse;
name=souptest
transports=https,http
statistics=disable
trace=disable
startOnLoad=true
target
   inSequence
  payloadFactory media-type=json
 format{
   contentType:linkedin-html,
   body:update body
 }/format
 args/
  /payloadFactory
  property name=messageType value=application/json
 scope=axis2/
  send
 endpoint
address uri=http://localhost:8281/services/jsonService;
 format=rest/
 /endpoint
  /send
   /inSequence
/target
description/
 /proxy

 

 01. Using SoupUI with following request send the expected massage to the
 given endpoint.
 soapenv:Envelope xmlns:soapenv=http://schemas.xmlsoap.org/soap/envelope/
 
 
 soap request-
 soapenv:Header/
soapenv:Body
   a1aaa/a1
   /soapenv:Body
 /soapenv:Envelope
  
 TCPMon out put-
 POST /services/jsonService HTTP/1.1
 Accept-Encoding: gzip,deflate
 Content-Type: application/json
 SOAPAction:
 Transfer-Encoding: chunked
 Host: 127.0.0.1:8281
 Connection: Keep-Alive
 User-Agent: Synapse-PT-HttpComponents-NIO

 47
 {
 contentType:linkedin-html,
 body:update body
 }
 0

 

 02. Using SoapUI with following request send the strange massage to the
 endpoint. Where the payload has replaced by the second element of the soup
 request!
 --soup request
 soapenv:Envelope xmlns:soapenv=http://schemas.xmlsoap.org/soap/envelope/
 
 
soapenv:Header/
soapenv:Body
   a1aaa/a1
   b1bbb/b1
   /soapenv:Body
 /soapenv:Envelope
 ---
 TCPMon out put-
 POST /services/jsonService HTTP/1.1
 Accept-Encoding: gzip,deflate
 Content-Type: application/json
 SOAPAction:
 Transfer-Encoding: chunked
 Host: 127.0.0.1:8281
 Connection: Keep-Alive
 User-Agent: Synapse-PT-HttpComponents-NIO

 c
 {b1:bbb}
 0

 

 Thanks
 Indika



 --
 View this message in context:
 http://wso2-oxygen-tank.10903.n7.nabble.com/Issue-with-ESB-4-8-and-SoupUI-tp90206.html
 Sent from the WSO2 Development mailing list archive at Nabble.com.
 ___
 Dev mailing list
 Dev@wso2.org
 http://wso2.org/cgi-bin/mailman/listinfo/dev




-- 
*Ravi Undupitiya*
Software Engineer; WSO2 Inc.; http://wso2.com


*E-mail: r...@wso2.com http://wso2.com**M: **+94 772 930 712*

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


Re: [Dev] Property mediator being URL - encoded on ESB

2014-01-01 Thread Ravi Undupitiya
The encoding is done by the URI Template library. There was a similar issue
fixed to decode ':' and '/' in HTTP Endpoint. I think the correct fix is to
use a decoding library that will handle all cases.

Some thing like:
URL url = new URL(URLDecoder.decode(template.expand(),
UTF-8));
evaluatedUri = url.toURI().toString();

I've added JIRA at [1] to track this issue.

[1] - https://wso2.org/jira/browse/ESBJAVA-2860

On Tue, Dec 31, 2013 at 9:01 AM, indika prasad indika@gmail.com wrote:

 (Reposting)
 Hi,

 I am using the following Synapse template to query the LinkedIn APIs
 connections endpoint:

 template name=getConnections xmlns=http://ws.apache.org/ns/synapse;
 parameter name=accessToken
 description=contains the security information for a login
 session and identifies the user, the users groups, and the users
 privileges
 /
 parameter name=fields
 description=fields of the connections that are required to
 be returned /


 sequence
 property name=uri.var.fields expression=$func:fields
 /
property name=uri.var.accessToken
 expression=$func:accessToken /
call
 endpoint

  http method=get
 uri-template=
 https://api.linkedin.com/v1/people/~/connections:({uri.var.fields})?oauth2_access_token={uri.var.accessToken}amp;format=json
 
 /
 /endpoint
 /call

 /sequence
 /template

 Here, the uri.var.fields parameter is supposed to be sent as a comma
 separated list such as first-name,last-name,header.

 However, when it is sent as a comma-separated list, the comma seems to get
 URL-encoded, causing the service call to fail.

 Wire output when sending the fields first-name,last-name:

  DEBUG - wire  GET

 /v1/people/~/connections:(first-name%2Clast-name)?oauth2_access_token=AQWE6N2hAjyHx9LIS6UU_0AktUN9aNN0ZFyIkUNYpSe10Vj559ppL4wur2QBOdCSOLBI3P2MEjHjV-Pz93xrZte3e2XfgrzkB30N5-twK9exifpuucMA5ZgvL7n2bpOx7dFxHfGM2eRfaoao0hKdSW1hnjL7i3GbrCeyrKhUZGECbv7agC4format=json
 HTTP/1.1[\r][\n]


 Is there any way to prevent the comma from getting URL encoded?

 Thanks.



 --
 View this message in context:
 http://wso2-oxygen-tank.10903.n7.nabble.com/Property-mediator-being-URL-encoded-on-ESB-tp90214.html
 Sent from the WSO2 Development mailing list archive at Nabble.com.
 ___
 Dev mailing list
 Dev@wso2.org
 http://wso2.org/cgi-bin/mailman/listinfo/dev




-- 
*Ravi Undupitiya*
Software Engineer; WSO2 Inc.; http://wso2.com


*E-mail: r...@wso2.com http://wso2.com**M: **+94 772 930 712*

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


Re: [Dev] WSO2 MB Subscriber Client with Spring configuration

2014-01-01 Thread Ishara Premadasa
Hi Aliosha,

I tried the same example with above spring-config.xml and was able to run
the JMS Subscriber without issue.

However according to the error log it seems your spring configuration is
unable to find the InitialContextFactory of the JNDI Provider. Therefore
first make sure you have correctly added 'andes-client-0.13.wso2v8.jar'
file as a dependency into the project classpath.
If it is already there in the external libraries, please define
InitialContextFactory as jee:environment element in configuration as
below and see with running subscriber client back.

jee:jndi-lookup id=connectionFactory jndi-name=TopicConnectionFactory
jee:environment

java.naming.factory.initial=org.wso2.andes.jndi.PropertiesFileInitialContextFactory
/jee:environment
/jee:jndi-lookup

Thanks,
Ishara


On Wed, Jan 1, 2014 at 4:22 PM, Aliosha aliosh...@gmail.com wrote:

 I m facing up with the subscriber client configuration using spring-jms. I
 m following this example:

 http://docs.wso2.org/display/MB210/Topic+subscriber+and+topic+publisher

 in which the client is coded like this:

 import javax.jms.JMSException;
 import javax.jms.Message;
 import javax.jms.QueueSession;
 import javax.jms.TextMessage;
 import javax.jms.Topic;
 import javax.jms.TopicConnection;
 import javax.jms.TopicConnectionFactory;
 import javax.jms.TopicSession;
 import javax.naming.Context;
 import javax.naming.InitialContext;
 import javax.naming.NamingException;
 import java.util.Properties;

 public class TopicSubscriber {
 public static final String QPID_ICF = 
 org.wso2.andes.jndi.PropertiesFileInitialContextFactory;
 private static final String CF_NAME_PREFIX = connectionfactory.;
 private static final String CF_NAME = qpidConnectionfactory;
 String userName = admin;
 String password = admin;
 private static String CARBON_CLIENT_ID = carbon;
 private static String CARBON_VIRTUAL_HOST_NAME = carbon;
 private static String CARBON_DEFAULT_HOSTNAME = localhost;
 private static String CARBON_DEFAULT_PORT = 5672;
 String topicName = MYTopic;

 public static void main(String[] args) throws NamingException, 
 JMSException {
 TopicSubscriber topicSubscriber = new TopicSubscriber();
 topicSubscriber.subscribe();
 }
 public void subscribe() throws NamingException, JMSException {
 Properties properties = new Properties();
 properties.put(Context.INITIAL_CONTEXT_FACTORY, QPID_ICF);
 properties.put(CF_NAME_PREFIX + CF_NAME, 
 getTCPConnectionURL(userName, password));
 System.out.println(getTCPConnectionURL(userName,password) =  +
 getTCPConnectionURL(userName, password));
 InitialContext ctx = new InitialContext(properties);
 // Lookup connection factory
 TopicConnectionFactory connFactory = (TopicConnectionFactory) 
 ctx.lookup(CF_NAME);
 TopicConnection topicConnection = connFactory.createTopicConnection();
 topicConnection.start();
 TopicSession topicSession =
 topicConnection.createTopicSession(false, 
 QueueSession.AUTO_ACKNOWLEDGE);
 // Send message
 Topic topic = topicSession.createTopic(topicName);
 javax.jms.TopicSubscriber topicSubscriber = 
 topicSession.createSubscriber(topic);
 Message message = topicSubscriber.receive();
 if (message instanceof TextMessage) {
 TextMessage textMessage = (TextMessage) message;
 System.out.println(textMessage.getText() =  + 
 textMessage.getText());
 }
 topicSubscriber.close();
 topicSession.close();
 topicConnection.stop();
 topicConnection.close();
 }
 public String getTCPConnectionURL(String username, String password) {
 // 
 amqp://{username}:{password}@carbon/carbon?brokerlist='tcp://{hostname}:{port}'
 return new StringBuffer()
 .append(amqp://).append(username).append(:).append(password)
 .append(@).append(CARBON_CLIENT_ID)
 .append(/).append(CARBON_VIRTUAL_HOST_NAME)
 
 .append(?brokerlist='tcp://).append(CARBON_DEFAULT_HOSTNAME).append(:).append(CARBON_DEFAULT_PORT).append(')
 .toString();
 }
 }


 By Spring i'm trying to set up the connection factory by this code:

 ?xml version=1.0 encoding=UTF-8?
 beans xmlns=http://www.springframework.org/schema/beans;
xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance;
   xmlns:jms=http://www.springframework.org/schema/jms;
   xmlns:jee=http://www.springframework.org/schema/jee;
xsi:schemaLocation=http://www.springframework.org/schema/beans 
 http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
http://www.springframework.org/schema/jms 
 http://www.springframework.org/schema/jms/spring-jms-3.0.xsd
http://www.springframework.org/schema/jee 
 http://www.springframework.org/schema/jee/spring-jee.xsd;

 jee:jndi-lookup id=connectionFactory jndi-name=TopicConnectionFactory/


 But in this 

[Dev] Writing a custom Authenticator Handler for WSO2 API Manager to validate a OAuth token with Identity Server

2014-01-01 Thread Sumedha Kodithuwakku
Hi all,

Is there a way to use a OAuth token generated by IS in the APIMs API
calls.? Basically what should happen is when making Api calls with the
OAuth token generated by IS, APIM should validate the token with Identity
Server and if it validates let the call go through.

As I understood we have to write a  custom Authentication handler as in [1]
to achieve that kind of a requirement. Or is there any other way to achieve
the above.?

I wrote a custom handler which calls IS and validates the token, however it
only route API calls to SandBox only (If I have only enabled Production
endpoint API call does not go through, and gives a error saying No Sandbox
found, if Sand box endpoint is there the call goes through to it).

As I understood when using the default Authentication Handler in APIM, it
will call a back end service and get API info and set it to the message
context. But this is not possible with a external OAuth token(from IS)
since the backend service in APIM cannot recognize the token. This might be
the reason for the above issue.

Any Idea on achieving the above requirement.?

[1]
http://docs.wso2.org/display/AM160/Writing+a+Custom+Authentication+Handler

Thanks
SumedhaS
-- 
*Sumedha Kodithuwakku*
Software Engineer
WSO2 Inc. : wso2.com
lean . enterprise . middleware

Email: sumed...@wso2.com;  Mobile: +94 71 808 1124 | +1 602 388 0160
Blog: http://sumedhask.blogspot.com/
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


Re: [Dev] Writing a custom Authenticator Handler for WSO2 API Manager to validate a OAuth token with Identity Server

2014-01-01 Thread Sumedha Kodithuwakku
Hi Vijayaratha,

You mean, Installing KeyManager features right..?

Thanks
SumedhaS


On Wed, Jan 1, 2014 at 11:13 PM, Vijayaratha Vijayasingam
rat...@wso2.comwrote:

 Why don't you try to configure IS as keymanager?


 On 2 January 2014 11:36, Sumedha Kodithuwakku sumed...@wso2.com wrote:

 Hi all,

 Is there a way to use a OAuth token generated by IS in the APIMs API
 calls.? Basically what should happen is when making Api calls with the
 OAuth token generated by IS, APIM should validate the token with Identity
 Server and if it validates let the call go through.

 As I understood we have to write a  custom Authentication handler as in
 [1] to achieve that kind of a requirement. Or is there any other way to
 achieve the above.?

 I wrote a custom handler which calls IS and validates the token, however
 it only route API calls to SandBox only (If I have only enabled Production
 endpoint API call does not go through, and gives a error saying No Sandbox
 found, if Sand box endpoint is there the call goes through to it).

 As I understood when using the default Authentication Handler in APIM, it
 will call a back end service and get API info and set it to the message
 context. But this is not possible with a external OAuth token(from IS)
 since the backend service in APIM cannot recognize the token. This might be
 the reason for the above issue.

 Any Idea on achieving the above requirement.?

 [1]
 http://docs.wso2.org/display/AM160/Writing+a+Custom+Authentication+Handler

 Thanks
 SumedhaS
 --
 *Sumedha Kodithuwakku*
 Software Engineer
 WSO2 Inc. : wso2.com
 lean . enterprise . middleware

 Email: sumed...@wso2.com;  Mobile: +94 71 808 1124 | +1 602 388 0160
 Blog: http://sumedhask.blogspot.com/


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




 --
 -Ratha
 mobile: (+94)755906608




-- 
*Sumedha Kodithuwakku*
Software Engineer
WSO2 Inc. : wso2.com
lean . enterprise . middleware

Email: sumed...@wso2.com;  Mobile: +94 71 808 1124 | +1 602 388 0160
Blog: http://sumedhask.blogspot.com/
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


Re: [Dev] Writing a custom Authenticator Handler for WSO2 API Manager to validate a OAuth token with Identity Server

2014-01-01 Thread Vijayaratha Vijayasingam
Yes..


On 2 January 2014 11:52, Sumedha Kodithuwakku sumed...@wso2.com wrote:

 Hi Vijayaratha,

 You mean, Installing KeyManager features right..?

 Thanks
 SumedhaS


 On Wed, Jan 1, 2014 at 11:13 PM, Vijayaratha Vijayasingam rat...@wso2.com
  wrote:

 Why don't you try to configure IS as keymanager?


 On 2 January 2014 11:36, Sumedha Kodithuwakku sumed...@wso2.com wrote:

 Hi all,

 Is there a way to use a OAuth token generated by IS in the APIMs API
 calls.? Basically what should happen is when making Api calls with the
 OAuth token generated by IS, APIM should validate the token with Identity
 Server and if it validates let the call go through.

 As I understood we have to write a  custom Authentication handler as in
 [1] to achieve that kind of a requirement. Or is there any other way to
 achieve the above.?

 I wrote a custom handler which calls IS and validates the token, however
 it only route API calls to SandBox only (If I have only enabled Production
 endpoint API call does not go through, and gives a error saying No Sandbox
 found, if Sand box endpoint is there the call goes through to it).

 As I understood when using the default Authentication Handler in APIM,
 it will call a back end service and get API info and set it to the message
 context. But this is not possible with a external OAuth token(from IS)
 since the backend service in APIM cannot recognize the token. This might be
 the reason for the above issue.

 Any Idea on achieving the above requirement.?

 [1]
 http://docs.wso2.org/display/AM160/Writing+a+Custom+Authentication+Handler

 Thanks
 SumedhaS
 --
 *Sumedha Kodithuwakku*
 Software Engineer
 WSO2 Inc. : wso2.com
 lean . enterprise . middleware

 Email: sumed...@wso2.com;  Mobile: +94 71 808 1124 | +1 602 388 0160
 Blog: http://sumedhask.blogspot.com/


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




 --
 -Ratha
 mobile: (+94)755906608




 --
 *Sumedha Kodithuwakku*
 Software Engineer
 WSO2 Inc. : wso2.com
 lean . enterprise . middleware

 Email: sumed...@wso2.com;  Mobile: +94 71 808 1124 | +1 602 388 0160
 Blog: http://sumedhask.blogspot.com/




-- 
-Ratha
mobile: (+94)755906608
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


Re: [Dev] Writing a custom Authenticator Handler for WSO2 API Manager to validate a OAuth token with Identity Server

2014-01-01 Thread Sumedha Rubasinghe
When validating a token, API Manager validates for whole new set of
conditions like API Name, version, subscription availability, status, etc.
This is why a direct token from IS (unless generate through API Manager
with IS as the Key Manager) won't go pass through Authentication Handler of
API G/W.



On Thu, Jan 2, 2014 at 11:43 AM, Vijayaratha Vijayasingam
rat...@wso2.comwrote:

 Why don't you try to configure IS as keymanager?


 On 2 January 2014 11:36, Sumedha Kodithuwakku sumed...@wso2.com wrote:

 Hi all,

 Is there a way to use a OAuth token generated by IS in the APIMs API
 calls.? Basically what should happen is when making Api calls with the
 OAuth token generated by IS, APIM should validate the token with Identity
 Server and if it validates let the call go through.

 As I understood we have to write a  custom Authentication handler as in
 [1] to achieve that kind of a requirement. Or is there any other way to
 achieve the above.?

 I wrote a custom handler which calls IS and validates the token, however
 it only route API calls to SandBox only (If I have only enabled Production
 endpoint API call does not go through, and gives a error saying No Sandbox
 found, if Sand box endpoint is there the call goes through to it).

 As I understood when using the default Authentication Handler in APIM, it
 will call a back end service and get API info and set it to the message
 context. But this is not possible with a external OAuth token(from IS)
 since the backend service in APIM cannot recognize the token. This might be
 the reason for the above issue.

 Any Idea on achieving the above requirement.?

 [1]
 http://docs.wso2.org/display/AM160/Writing+a+Custom+Authentication+Handler

 Thanks
 SumedhaS
 --
 *Sumedha Kodithuwakku*
 Software Engineer
 WSO2 Inc. : wso2.com
 lean . enterprise . middleware

 Email: sumed...@wso2.com;  Mobile: +94 71 808 1124 | +1 602 388 0160
 Blog: http://sumedhask.blogspot.com/


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




 --
 -Ratha
 mobile: (+94)755906608

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




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


Re: [Dev] Writing a custom Authenticator Handler for WSO2 API Manager to validate a OAuth token with Identity Server

2014-01-01 Thread Sumedha Kodithuwakku
Hi Sumedha,

Thanks for the explanation. I will use the approach of using IS as the Key
Manager.

Thanks
SumedhaS


On Wed, Jan 1, 2014 at 11:24 PM, Sumedha Rubasinghe sume...@wso2.comwrote:


 When validating a token, API Manager validates for whole new set of
 conditions like API Name, version, subscription availability, status, etc.
 This is why a direct token from IS (unless generate through API Manager
 with IS as the Key Manager) won't go pass through Authentication Handler of
 API G/W.



 On Thu, Jan 2, 2014 at 11:43 AM, Vijayaratha Vijayasingam rat...@wso2.com
  wrote:

 Why don't you try to configure IS as keymanager?


 On 2 January 2014 11:36, Sumedha Kodithuwakku sumed...@wso2.com wrote:

 Hi all,

 Is there a way to use a OAuth token generated by IS in the APIMs API
 calls.? Basically what should happen is when making Api calls with the
 OAuth token generated by IS, APIM should validate the token with Identity
 Server and if it validates let the call go through.

 As I understood we have to write a  custom Authentication handler as in
 [1] to achieve that kind of a requirement. Or is there any other way to
 achieve the above.?

 I wrote a custom handler which calls IS and validates the token, however
 it only route API calls to SandBox only (If I have only enabled Production
 endpoint API call does not go through, and gives a error saying No Sandbox
 found, if Sand box endpoint is there the call goes through to it).

 As I understood when using the default Authentication Handler in APIM,
 it will call a back end service and get API info and set it to the message
 context. But this is not possible with a external OAuth token(from IS)
 since the backend service in APIM cannot recognize the token. This might be
 the reason for the above issue.

 Any Idea on achieving the above requirement.?

 [1]
 http://docs.wso2.org/display/AM160/Writing+a+Custom+Authentication+Handler

 Thanks
 SumedhaS
 --
 *Sumedha Kodithuwakku*
 Software Engineer
 WSO2 Inc. : wso2.com
 lean . enterprise . middleware

 Email: sumed...@wso2.com;  Mobile: +94 71 808 1124 | +1 602 388 0160
 Blog: http://sumedhask.blogspot.com/


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




 --
 -Ratha
 mobile: (+94)755906608

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




 --
 /sumedha
 b :  bit.ly/sumedha




-- 
*Sumedha Kodithuwakku*
Software Engineer
WSO2 Inc. : wso2.com
lean . enterprise . middleware

Email: sumed...@wso2.com;  Mobile: +94 71 808 1124 | +1 602 388 0160
Blog: http://sumedhask.blogspot.com/
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


Re: [Dev] Do we have a JSON sample that ships with DSS?

2014-01-01 Thread Samisa Abeysinghe
I have blogged about getting REST with JSON to work at:
http://blog.samisa.org/2014/01/rest-in-json-with-wso2-data-services.html

This is part of a series of blogs that I am writing on data services.


Thanks,
Samisa...


Samisa Abeysinghe

Vice President Developer Evangelism

WSO2 Inc.
http://wso2.com



On Wed, Dec 4, 2013 at 2:22 PM, Anjana Fernando anj...@wso2.com wrote:

 Hi Samisa,

 I forgot one part, you need to add the following to the axis2.xml.

 parameter name=httpContentNegotiationtrue/parameter

 Cheers,
 Anjana.


 On Wed, Dec 4, 2013 at 2:14 PM, Samisa Abeysinghe sam...@wso2.com wrote:

 That seems a bug that accept does not work, but content-type does?

 Thanks,
 Samisa...


 Samisa Abeysinghe

 Vice President Training

 WSO2 Inc.
 http://wso2.com



 On Wed, Dec 4, 2013 at 2:13 PM, Samisa Abeysinghe sam...@wso2.comwrote:

 However, I figured that
 curl  -H Content-Type: application/json -X GET
 http://localhost:9763/services/samples/ResourcesSample.HTTPEndpoint/products
 works!


 Thanks,
 Samisa...


 Samisa Abeysinghe

 Vice President Training

 WSO2 Inc.
 http://wso2.com



 On Wed, Dec 4, 2013 at 2:11 PM, Samisa Abeysinghe sam...@wso2.comwrote:

 With the REST sample, I tried
 curl -H Accept: application/json -X GET
 http://localhost:9763/services/samples/ResourcesSample.HTTPEndpoint/products

 but it still returns XML.

 Thanks,
 Samisa...


 Samisa Abeysinghe

 Vice President Training

 WSO2 Inc.
 http://wso2.com



 On Wed, Dec 4, 2013 at 2:04 PM, Anjana Fernando anj...@wso2.comwrote:

 Hi Samisa,

 We don't actually have a specific sample for JSON as I know, Chanika
 was writing an article for this, with some scenarios, but didn't publish
 yet as I know. Chanika, do put a section to the docs to mention how to do
 JSON with DSS.

 The content negotiation in data service simply works by setting the
 HTTP header Accept, with the content type as the value. For example, to
 get a JSON response, you would have a HTTP header like the following:

 Accept: application/json.

 Cheers,
 Anjana.


 On Wed, Dec 4, 2013 at 12:52 PM, Samisa Abeysinghe sam...@wso2.comwrote:

 To ask a related question, how do I do content negotiation with DSS
 REST?

 Thanks,
 Samisa...


 Samisa Abeysinghe

 Vice President Training

 WSO2 Inc.
 http://wso2.com



 On Wed, Dec 4, 2013 at 12:32 PM, Samisa Abeysinghe 
 sam...@wso2.comwrote:

 I am looking to do REST with JSON as content type with DSS.

 Do we have a sample that I can use to get started with?

 Thanks,
 Samisa...


 Samisa Abeysinghe

 Vice President Training

 WSO2 Inc.
 http://wso2.com





 --
 *Anjana Fernando*
 Technical Lead
 WSO2 Inc. | http://wso2.com
 lean . enterprise . middleware







 --
 *Anjana Fernando*
 Technical Lead
 WSO2 Inc. | http://wso2.com
 lean . enterprise . middleware

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


Re: [Dev] How about an ACL module for Jaggery

2014-01-01 Thread Dilshan Edirisuriya
+1.


On Sun, Dec 29, 2013 at 11:07 AM, Pradeep Fernando prad...@wso2.com wrote:

 Hi,

 This requirement comes up far too often. Do we have the $subject... :)

 eg: http://dingoframework.com/docs/acl-library

 Thanks,
 --Pradeep

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




-- 
Dilshan Edirisuriya
Senior Software Engineer - WSO2Mobile
Mob: + 94 772245502
http://wso2mobile.com/
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev