Hi, Sorry, I missed a clarification earlier. I had mistaken the epr as well as setting the options of the client, therefore the corrected code segment is as follows. Since the data service is not secure there is no need to include the commented line, where POLICY_FILE_PATH includes the policy extracted from the wsdl of the secured data service.
String epr = " https://appserver.dev.cloud.wso2.com/services/t/sabra8339/dataservice1-default-SNAPSHOT <https://appserver.dev.cloud.wso2.com/services/t/sabra8339/Dataservice1DefaultSNAPSHOT> "; System.setProperty("javax.net.ssl.trustStore", (new File(TRUST_STORE_PATH)).getAbsolutePath()); System.setProperty("javax.net.ssl.trustStorePassword", TRUST_STORE_PASSWORD); ConfigurationContext ctx = ConfigurationContextFactory.createConfigurationContextFromFileSystem("/home/sabra/repository", null); Dataservice1DefaultSNAPSHOTStub stub = new Dataservice1DefaultSNAPSHOTStub(ctx,epr); ServiceClient client = stub._getServiceClient(); Options options = client.getOptions(); client.engageModule("rampart"); options.setUserName("admin"); options.setPassword("admin"); *//options.setProperty(**RampartMessageData.KEY_**RAMPART_POLICY, loadPolicy(POLICY_FILE_PATH));remove this line* Dataservice1DefaultSNAPSHOTStub.InsertRawLeadsPerWeek request = new Dataservice1DefaultSNAPSHOTStub.InsertRawLeadsPerWeek(); request.setStart_date("2092-04-09"); request.setEnd_date("2092-04-8"); request.setTotal_users(6666); request.setEu_users(6666); request.setNa_users(6666); request.setRow_users(6666); request.setUnclassified_users(6666); stub.insertRawLeadsPerWeek(request); Thanks. On Tue, May 19, 2015 at 12:53 PM, Sabra Ossen <[email protected]> wrote: > Hi Dimuthu, > > How can I secure the data service when it is deployed using AF.? The > interfaces are different in the DSS and AF, could you point out some > resources that shows how to secure a data service deployed in cloud. Thanks > in advance. > > Regards. > > On Tue, May 19, 2015 at 12:49 PM, Dimuthu Leelarathne <[email protected]> > wrote: > >> hi Sabra, >> >> You need to secure it :) >> >> Just call me for the meeting I will also come. >> >> thanks, >> dimuthu >> >> >> On Tue, May 19, 2015 at 12:27 PM, Sabra Ossen <[email protected]> wrote: >> >>> Hi Pirinthapan, >>> >>> The issue is now resolved. Thank you very much. >>> >>> Regards. >>> >>> On Tue, May 19, 2015 at 11:53 AM, Pirinthapan Mahendran < >>> [email protected]> wrote: >>> >>>> Hi Sabra, >>>> >>>> The endpoints are listed in the wsdl under the element "wsdl:service". >>>> You can use one one of these endpoints. >>>> i.e: >>>> https://appserver.dev.cloud.wso2.com/services/t/sabra8339/dataservice1-default-SNAPSHOT.SecureHTTPEndpoint >>>> . >>>> >>>> or You can just remove the "?wsdl" part from your wsdl url and use it >>>> as endpoint. >>>> i.e: >>>> https://appserver.dev.cloud.wso2.com/services/t/sabra8339/dataservice1-default-SNAPSHOT >>>> >>>> Thanks. >>>> >>>> >>>> >>>> Mahendran Pirinthapan >>>> Software Engineer | WSO2 Inc. >>>> Mobile +94772378732. >>>> >>>> On Tue, May 19, 2015 at 10:50 AM, Dimuthu Leelarathne < >>>> [email protected]> wrote: >>>> >>>>> Hi Sabra, >>>>> >>>>> Is this secured? >>>>> >>>>> thanks, >>>>> dimuthu >>>>> >>>>> >>>>> On Mon, May 18, 2015 at 5:26 PM, Sabra Ossen <[email protected]> >>>>> wrote: >>>>> >>>>>> Hi All, >>>>>> >>>>>> I have deployed a data service in cloud and I am trying to push data >>>>>> to a database in cloud through the data service. I am having a hard time >>>>>> figuring out the end point where I have to push data to. I tested the >>>>>> data >>>>>> service using soap ui and it successfully pushes data. >>>>>> >>>>>> The wsdl for the data service can be seen in [1]. >>>>>> >>>>>> The code to push data is as follows(I have created the client stub >>>>>> using the wsdl mentioned above). >>>>>> >>>>>> *String epr = >>>>>> "https://appserver.dev.cloud.wso2.com/services/t/sabra8339/Dataservice1DefaultSNAPSHOT >>>>>> <https://appserver.dev.cloud.wso2.com/services/t/sabra8339/Dataservice1DefaultSNAPSHOT>";* >>>>>> >>>>>> System.setProperty("javax.net.ssl.trustStore", (new >>>>>> File(TRUST_STORE_PATH)).getAbsolutePath()); >>>>>> System.setProperty("javax.net.ssl.trustStorePassword", >>>>>> TRUST_STORE_PASSWORD); >>>>>> >>>>>> ConfigurationContext ctx = >>>>>> ConfigurationContextFactory.createConfigurationContextFromFileSystem("/home/sabra/repository", >>>>>> null); >>>>>> >>>>>> Dataservice1DefaultSNAPSHOTStub stub = new >>>>>> Dataservice1DefaultSNAPSHOTStub(ctx,epr); >>>>>> ServiceClient client = stub._getServiceClient(); >>>>>> Options options = client.getOptions(); >>>>>> client.engageModule("rampart"); >>>>>> options.setUserName("admin"); >>>>>> options.setPassword("admin"); >>>>>> >>>>>> options.setProperty(RampartMessageData.KEY_RAMPART_POLICY, >>>>>> loadPolicy(POLICY_FILE_PATH)); >>>>>> >>>>>> Dataservice1DefaultSNAPSHOTStub.InsertRawLeadsPerWeek request = new >>>>>> Dataservice1DefaultSNAPSHOTStub.InsertRawLeadsPerWeek(); >>>>>> >>>>>> request.setStart_date("2092-04-09"); >>>>>> request.setEnd_date("2092-04-8"); >>>>>> request.setTotal_users(6666); >>>>>> request.setEu_users(6666); >>>>>> request.setNa_users(6666); >>>>>> request.setRow_users(6666); >>>>>> request.setUnclassified_users(6666); >>>>>> >>>>>> stub.insertRawLeadsPerWeek(request); >>>>>> >>>>>> I have no clue as to what is missing. Any help on this issue is >>>>>> highly appreciated. If any further clarification is needed please let me >>>>>> know. >>>>>> >>>>>> [1] >>>>>> https://appserver.dev.cloud.wso2.com/services/t/sabra8339/dataservice1-default-SNAPSHOT?wsdl >>>>>> >>>>>> Regards. >>>>>> -- >>>>>> Sabra Ossen <http://lk.linkedin.com/in/sabraossen> >>>>>> Undergraduate | Department of Computer Science and Engineering >>>>>> University of Moratuwa >>>>>> Sri Lanka >>>>>> >>>>>> _______________________________________________ >>>>>> Dev mailing list >>>>>> [email protected] >>>>>> http://wso2.org/cgi-bin/mailman/listinfo/dev >>>>>> >>>>>> >>>>> >>>>> >>>>> -- >>>>> Dimuthu Leelarathne >>>>> Architect & Product Lead of App Factory >>>>> >>>>> WSO2, Inc. (http://wso2.com) >>>>> email: [email protected] >>>>> Mobile : 0773661935 >>>>> >>>>> Lean . Enterprise . Middleware >>>>> >>>>> _______________________________________________ >>>>> Dev mailing list >>>>> [email protected] >>>>> http://wso2.org/cgi-bin/mailman/listinfo/dev >>>>> >>>>> >>>> >>> >>> >>> -- >>> Sabra Ossen <http://lk.linkedin.com/in/sabraossen> >>> Undergraduate | Department of Computer Science and Engineering >>> University of Moratuwa >>> Sri Lanka >>> >> >> >> >> -- >> Dimuthu Leelarathne >> Architect & Product Lead of App Factory >> >> WSO2, Inc. (http://wso2.com) >> email: [email protected] >> Mobile : 0773661935 >> >> Lean . Enterprise . Middleware >> > > > > -- > Sabra Ossen <http://lk.linkedin.com/in/sabraossen> > Undergraduate | Department of Computer Science and Engineering > University of Moratuwa > Sri Lanka > -- Sabra Ossen <http://lk.linkedin.com/in/sabraossen> Undergraduate | Department of Computer Science and Engineering University of Moratuwa Sri Lanka
_______________________________________________ Dev mailing list [email protected] http://wso2.org/cgi-bin/mailman/listinfo/dev
