This document discusses setting up an intermediate WCF service to connect an Android application to Dynamics AX. It describes creating a WCF service that enables REST and outputs data as JSON for consumption by the Android application. The WCF service is configured to use authentication via headers and return AX data like item lists. The document also provides code samples for the WCF service interface and implementation, as well as the Android application code to call the service, parse the JSON response, and display it in a list view.
Microservice Protection With WSO2 Identity ServerAnupam Gogoi
Â
- The document describes how to secure a Spring Boot microservice with OAuth 2.0 using WSO2 Identity Server as the authorization server.
- It involves creating a simple microservice with a protected resource, then configuring WSO2 IS as an OAuth server to issue access tokens. This allows the microservice to validate tokens to secure the resource.
- It also covers configuring WSO2 IS to issue JWTs instead of normal tokens, and how to obtain and use a JWT to access the protected microservice resource.
Use Windows Azure Service Bus, BizTalk Services, Mobile Services, and BizTalk...BizTalk360
Â
The Service Bus is part of Windows Azure and is designed to provide connectivity, queuing, and routing capabilities not only for the cloud applications but also for on-premises applications. Microsoft BizTalk Server enables organizations to connect and extend heterogeneous systems across the enterprise and with trading partners. Using both together enables a significant number of scenarios in which you can build secure, reliable and scalable hybrid solutions that span the cloud and on premises environments.
Windows Azure BizTalk Services is a simple, powerful, and extensible cloud-based integration service that provides Business-to-Business (B2B) and Enterprise Application Integration (EAI) capabilities for delivering cloud and hybrid integration solutions. Windows Azure Mobile Services accelerates connected client application development by streamlining common backend tasks like structuring storage, authenticating users, and sending push notifications. In this session you will see how to integrate these technologies to build secure, reliable and scalable hybrid solutions that span the cloud and on premises environments.
OpenWebBeans is an implementation of the JSR-299 specification for managing Java EE components called WebBeans. It provides features like dependency injection, lifecycle management, interceptors, decorators, events and contexts. It is hosted by the Apache Software Foundation and aims to be extensible and configurable through annotations and XML.
This document provides an overview and demonstration of REST security with JAX-RS. It discusses authentication using Java EE and the JAX-RS SecurityContext, as well as encryption and validation. The document demonstrates OAuth authentication for accessing APIs from third party applications using a photo sharing site example. It summarizes when to use OAuth for consuming APIs from web, mobile, and native apps when passwords should not be shared, and the benefits of OAuth which include not needing to share passwords.
The document discusses migrating an existing authentication system at Columbia University to the Central Authentication Service (CAS). Specifically, it addresses:
1) Integrating the legacy service registry and custom attributes into CAS.
2) Adding support for the legacy "WIND" authentication protocol to CAS to allow existing clients to continue using either the legacy or CAS protocols during migration.
3) Customizing CAS login behavior and UI to match the existing system.
Java EE 8 security and JSON binding APIAlex Theedom
Â
Java EE Security and JSON Binding are two new APIs in the Java EE 8 release. The security API provides consistencies between containers with a simple annotation-driven model while JSON Binding completes Java EEs JSON APIs and is a real alternative to Jackson and Gson. In this presentation, I will walk through coding examples from both APIs and by the end of the presentation, you will understand how these two new APIs add to the advancement of the Java EE platform.
Kamil Raczyński: Interesuje Cię technologia Node? Chcesz sprawdzić jej możliwości, mając pewność, że dobrałeś odpowiedni zbiór bibliotek? A może chcesz postawić projekt na sprawdzonej architekturze? W takiej sytuacji mam przyjemność przedstawić Ci framework Nest. Rozwiązanie, które może sprostać Twoim wymaganiom, a przy okazji oszczędzi Ci dużo czasu.
Servlets are Java programs that run on a web server and generate dynamic web page content. Servlets receive HTTP requests and return HTTP responses. They provide an interface between web clients and web servers. Key points:
- Servlets run on web servers like Tomcat and handle HTTP requests/responses dynamically.
- They extend the HttpServlet class and implement doGet() and/or doPost() methods to process requests.
- Servlets can access request parameters, headers, cookies and generate HTML responses by setting headers and writing to the response.
- Servlets are configured in the web server and mapped to URLs to handle requests for those URLs dynamically.
Microservice Protection With WSO2 Identity ServerAnupam Gogoi
Â
- The document describes how to secure a Spring Boot microservice with OAuth 2.0 using WSO2 Identity Server as the authorization server.
- It involves creating a simple microservice with a protected resource, then configuring WSO2 IS as an OAuth server to issue access tokens. This allows the microservice to validate tokens to secure the resource.
- It also covers configuring WSO2 IS to issue JWTs instead of normal tokens, and how to obtain and use a JWT to access the protected microservice resource.
Use Windows Azure Service Bus, BizTalk Services, Mobile Services, and BizTalk...BizTalk360
Â
The Service Bus is part of Windows Azure and is designed to provide connectivity, queuing, and routing capabilities not only for the cloud applications but also for on-premises applications. Microsoft BizTalk Server enables organizations to connect and extend heterogeneous systems across the enterprise and with trading partners. Using both together enables a significant number of scenarios in which you can build secure, reliable and scalable hybrid solutions that span the cloud and on premises environments.
Windows Azure BizTalk Services is a simple, powerful, and extensible cloud-based integration service that provides Business-to-Business (B2B) and Enterprise Application Integration (EAI) capabilities for delivering cloud and hybrid integration solutions. Windows Azure Mobile Services accelerates connected client application development by streamlining common backend tasks like structuring storage, authenticating users, and sending push notifications. In this session you will see how to integrate these technologies to build secure, reliable and scalable hybrid solutions that span the cloud and on premises environments.
OpenWebBeans is an implementation of the JSR-299 specification for managing Java EE components called WebBeans. It provides features like dependency injection, lifecycle management, interceptors, decorators, events and contexts. It is hosted by the Apache Software Foundation and aims to be extensible and configurable through annotations and XML.
This document provides an overview and demonstration of REST security with JAX-RS. It discusses authentication using Java EE and the JAX-RS SecurityContext, as well as encryption and validation. The document demonstrates OAuth authentication for accessing APIs from third party applications using a photo sharing site example. It summarizes when to use OAuth for consuming APIs from web, mobile, and native apps when passwords should not be shared, and the benefits of OAuth which include not needing to share passwords.
The document discusses migrating an existing authentication system at Columbia University to the Central Authentication Service (CAS). Specifically, it addresses:
1) Integrating the legacy service registry and custom attributes into CAS.
2) Adding support for the legacy "WIND" authentication protocol to CAS to allow existing clients to continue using either the legacy or CAS protocols during migration.
3) Customizing CAS login behavior and UI to match the existing system.
Java EE 8 security and JSON binding APIAlex Theedom
Â
Java EE Security and JSON Binding are two new APIs in the Java EE 8 release. The security API provides consistencies between containers with a simple annotation-driven model while JSON Binding completes Java EEs JSON APIs and is a real alternative to Jackson and Gson. In this presentation, I will walk through coding examples from both APIs and by the end of the presentation, you will understand how these two new APIs add to the advancement of the Java EE platform.
Kamil Raczyński: Interesuje Cię technologia Node? Chcesz sprawdzić jej możliwości, mając pewność, że dobrałeś odpowiedni zbiór bibliotek? A może chcesz postawić projekt na sprawdzonej architekturze? W takiej sytuacji mam przyjemność przedstawić Ci framework Nest. Rozwiązanie, które może sprostać Twoim wymaganiom, a przy okazji oszczędzi Ci dużo czasu.
Servlets are Java programs that run on a web server and generate dynamic web page content. Servlets receive HTTP requests and return HTTP responses. They provide an interface between web clients and web servers. Key points:
- Servlets run on web servers like Tomcat and handle HTTP requests/responses dynamically.
- They extend the HttpServlet class and implement doGet() and/or doPost() methods to process requests.
- Servlets can access request parameters, headers, cookies and generate HTML responses by setting headers and writing to the response.
- Servlets are configured in the web server and mapped to URLs to handle requests for those URLs dynamically.
Spring Security is a framework that focuses on providing both authentication and authorization to Java applications. Like all Spring projects, the real power of Spring Security is found in how easily it can be extended to meet custom requirements. In this presentation Rob will start with an insecure application and incrementally Spring Security 4 to demonstrate how easily you can secure your application. Throughout the presentation, new features found in Spring Security 4 will be highlighted. Whether you are new to Spring Security or are wanting to learn what is new in Spring Security 4, this presentation is a must!
Integrating Security Roles into Microsoft Silverlight ApplicationsDan Wahlin
Â
This document discusses options for integrating security roles into Microsoft Silverlight applications. It begins by outlining Silverlight authentication and authorization options like Windows authentication and forms roles. It then discusses techniques for accessing user identity information and roles in Silverlight, such as passing data via initParams, using a security service, or the WebContext class in WCF RIA Services. The document recommends creating a SecurityManager class to simplify working with user credentials by handling asynchronous calls to retrieve data and integrating with MVVM patterns.
The document discusses validation in the Spring Framework. It describes how Spring supports the JSR-303 validation specification through its Validator interface and auxiliary classes like Errors and ValidationUtils. It also covers validation annotations, constraint violation handling, custom constraints, grouping and composition. Spring provides the LocalValidatorFactoryBean to integrate JSR-303 validation into Spring applications.
The document discusses Spring Framework's data access features. It covers DAO support, transaction management using JDBC, and exceptions. It also discusses embedded databases, initializing other data sources, and the Spring DataAccessException hierarchy. Additionally, it talks about using JdbcTemplate for data access and provides examples of querying for simple types, generic maps, and domain objects.
Mixing OAuth 2.0, Jersey and Guice to Build an Ecosystem of Apps - JavaOne...Hermann Burgmeier
Â
The document discusses building an ecosystem of applications using OAuth 2.0, Jersey, and Guice. It describes how to implement OAuth 2.0 authentication and authorization in a REST API built with JAX-RS and Jersey. Specifically, it shows how to enable the Implicit Grant flow to allow access from JavaScript clients, and integrates an external identity provider. The presentation includes a demonstration of these techniques using a coffee price service.
This document provides an overview of MongoDB Stitch, which is a serverless platform for building and hosting web and mobile backends. It discusses how Stitch can be used to handle user authentication and authorization, implement server-side rules, manage data access and synchronization, and define functions and triggers that run in response to events. Stitch aims to reduce the need for complex backend infrastructure by providing an integrated set of services for user management, data storage and syncing, and serverless logic.
Remote code-with-expression-language-injectionMickey Jack
Â
The document discusses a vulnerability in older versions of the Spring Framework called Expression Language (EL) Injection that allows remote code execution. It was discovered that certain Spring tags double interpret EL, exposing sensitive server data. More than 22,000 organizations have downloaded over 1.3 million vulnerable versions of Spring. The document then demonstrates how an attacker could bypass input filtering and use Java reflection through EL to execute code remotely by loading a malicious class file from a remote URL. Updating Spring Framework versions and disabling the double EL resolution in web.xml can help prevent exploitation of this issue.
DEF CON 27 - ALVARO MUNOZ / OLEKSANDR MIROSH - sso wars the token menaceFelipe Prado
Â
The document discusses various ways that authentication tokens can be abused to bypass security protections. It describes how some implementations of token parsing and signature verification are vulnerable to arbitrary code execution or information disclosure attacks due to inconsistencies in how signing keys and security tokens are resolved from token metadata. Specific attacks are demonstrated against Windows Communication Foundation, Windows Identity Foundation, and SharePoint Server due to differences in how key and token resolution are handled for signature verification versus token authentication.
This document describes building a single page application for authentication against multiple third party services like Facebook and Windows Live using OAuth2 and without page reloads. It discusses using an OAuth adapter and service-specific adapters to handle the different OAuth grant types and flows. Key parts of the implementation include injecting a session service, opening authentication as a promise, handling the redirect flow with a popup window, and reading the access token from the hash fragment or popup message.
The document discusses servlet session management. It covers servlet filters which can intercept and modify requests and responses. It also discusses the servlet context and configuration parameters, as well as the session object and APIs. Session attributes allow data to be stored and shared across requests from the same client, while context attributes are shared across the entire application. Session tracking allows associating requests from the same client, typically using cookies or URL rewriting to pass the session identifier.
Presented at EmberConf 2015 by @sugarpirate_
In the dark ages of web development, designing a beautiful user experience meant having to constantly fight with the DOM to get it to do what you want, when you want. With Ember, we no longer have to struggle with managing DOM state, and we are free to put the user experience first with reactive UI.
In this talk, we'll discuss the ways in which Ember makes it easy to build delightful and reactive user experiences, and how you can build reusable components that even non-technical designers can learn to use. Learn about the thoughtful touches and interactions you can add to an Ember app.
Links:
1. Computed property macro demo – http://emberjs.jsbin.com/vubaga/11/edit?js,output
2. Showerthoughts loading messages demo – http://emberjs.jsbin.com/lulaki/35/edit?js,output
3. Flash messages demo – http://emberjs.jsbin.com/ranewo/45/edit?js,output
4. Drag and drop demo – http://emberjs.jsbin.com/denep/18/edit?js,output
OAuth 2.0 is an open authentication and authorization protocol which enables applications to access each others data. This talk will presents how to implement the OAuth2 definitions to secure RESTful resources developed using JAX-RS in the Java EE platform.
Java Svet - Communication Between Android App ComponentsAleksandar Ilić
Â
Presentation about how to build flexible (using fragments), smooth (using async tasks and intent services) and "data up to date" (using loaders) Android applications.
Ajax allows for asynchronous retrieval of data from a server in the background without reloading the page. It uses a combination of technologies like XMLHttpRequest, JavaScript, and DOM to make asynchronous calls to a server and update portions of a page without reloading. The document then provides an example of how an Ajax interaction works, from making an asynchronous request to a server to processing the response and updating the HTML DOM.
The document discusses how to programmatically make URL requests in Java. It covers using the URL and URLConnection classes to (1) parse URLs, (2) retrieve URL contents by opening connections or streams, and (3) get header information. It also provides examples of how to fake GET and POST form submissions by encoding parameters and sending requests via URLConnection.
Android Cloud to Device Messaging Framework at GTUG StockholmJohan Nilsson
Â
The document discusses the Android Cloud to Device Messaging (C2DM) framework. It allows application servers to send lightweight messages to Android apps. Key points:
- C2DM notifies apps of new data to fetch rather than sending large amounts of content. It makes no guarantees about message delivery or order.
- Apps can receive messages even when not running by using intent broadcasts. C2DM only passes raw message data.
- Apps must register with C2DM to receive messages and can unregister. Registration requires Android 2.2+ with the Market app installed.
- The app server sends messages via HTTP using a registration ID and authorization token. C2DM handles storing and delivering messages when
This document provides an example of how to create a splash screen in Android that is displayed for a set period of time before redirecting to the main application screen. It describes two methods for implementing a splash screen: 1) Using a thread to sleep for the set time before redirecting, and 2) Using a Handler and postDelayed to call a Runnable after the set time to redirect. The example project structure is also outlined.
1) The document discusses IBM's Big Data platform which provides solutions for analyzing massive amounts of structured and unstructured data.
2) It includes offerings for Hadoop, streaming analytics, data warehousing, in-memory databases, and tools for information integration and governance.
3) The platform aims to help customers accelerate insights from their data, simplify big data adoption, and implement enterprise-grade big data systems.
This chapter describes how to construct SOAP messages to process transactions with CyberSource using PHP 5.2.1. It provides instructions for downloading required third-party software, extending the SoapClient class to add WS-Security headers, and testing transactions using sample code provided. Developers can then modify the script and client code to integrate it with their application.
The .NET Framework is a software framework developed by Microsoft that runs primarily on Windows. It includes a large class library and provides language interoperability across programming languages. Programs written for .NET execute in the Common Language Runtime (CLR), which provides services like security and memory management. The .NET Framework includes versions for mobile devices and supports multiple programming languages that compile to an intermediate language and are then compiled to native code when executing.
Spring Security is a framework that focuses on providing both authentication and authorization to Java applications. Like all Spring projects, the real power of Spring Security is found in how easily it can be extended to meet custom requirements. In this presentation Rob will start with an insecure application and incrementally Spring Security 4 to demonstrate how easily you can secure your application. Throughout the presentation, new features found in Spring Security 4 will be highlighted. Whether you are new to Spring Security or are wanting to learn what is new in Spring Security 4, this presentation is a must!
Integrating Security Roles into Microsoft Silverlight ApplicationsDan Wahlin
Â
This document discusses options for integrating security roles into Microsoft Silverlight applications. It begins by outlining Silverlight authentication and authorization options like Windows authentication and forms roles. It then discusses techniques for accessing user identity information and roles in Silverlight, such as passing data via initParams, using a security service, or the WebContext class in WCF RIA Services. The document recommends creating a SecurityManager class to simplify working with user credentials by handling asynchronous calls to retrieve data and integrating with MVVM patterns.
The document discusses validation in the Spring Framework. It describes how Spring supports the JSR-303 validation specification through its Validator interface and auxiliary classes like Errors and ValidationUtils. It also covers validation annotations, constraint violation handling, custom constraints, grouping and composition. Spring provides the LocalValidatorFactoryBean to integrate JSR-303 validation into Spring applications.
The document discusses Spring Framework's data access features. It covers DAO support, transaction management using JDBC, and exceptions. It also discusses embedded databases, initializing other data sources, and the Spring DataAccessException hierarchy. Additionally, it talks about using JdbcTemplate for data access and provides examples of querying for simple types, generic maps, and domain objects.
Mixing OAuth 2.0, Jersey and Guice to Build an Ecosystem of Apps - JavaOne...Hermann Burgmeier
Â
The document discusses building an ecosystem of applications using OAuth 2.0, Jersey, and Guice. It describes how to implement OAuth 2.0 authentication and authorization in a REST API built with JAX-RS and Jersey. Specifically, it shows how to enable the Implicit Grant flow to allow access from JavaScript clients, and integrates an external identity provider. The presentation includes a demonstration of these techniques using a coffee price service.
This document provides an overview of MongoDB Stitch, which is a serverless platform for building and hosting web and mobile backends. It discusses how Stitch can be used to handle user authentication and authorization, implement server-side rules, manage data access and synchronization, and define functions and triggers that run in response to events. Stitch aims to reduce the need for complex backend infrastructure by providing an integrated set of services for user management, data storage and syncing, and serverless logic.
Remote code-with-expression-language-injectionMickey Jack
Â
The document discusses a vulnerability in older versions of the Spring Framework called Expression Language (EL) Injection that allows remote code execution. It was discovered that certain Spring tags double interpret EL, exposing sensitive server data. More than 22,000 organizations have downloaded over 1.3 million vulnerable versions of Spring. The document then demonstrates how an attacker could bypass input filtering and use Java reflection through EL to execute code remotely by loading a malicious class file from a remote URL. Updating Spring Framework versions and disabling the double EL resolution in web.xml can help prevent exploitation of this issue.
DEF CON 27 - ALVARO MUNOZ / OLEKSANDR MIROSH - sso wars the token menaceFelipe Prado
Â
The document discusses various ways that authentication tokens can be abused to bypass security protections. It describes how some implementations of token parsing and signature verification are vulnerable to arbitrary code execution or information disclosure attacks due to inconsistencies in how signing keys and security tokens are resolved from token metadata. Specific attacks are demonstrated against Windows Communication Foundation, Windows Identity Foundation, and SharePoint Server due to differences in how key and token resolution are handled for signature verification versus token authentication.
This document describes building a single page application for authentication against multiple third party services like Facebook and Windows Live using OAuth2 and without page reloads. It discusses using an OAuth adapter and service-specific adapters to handle the different OAuth grant types and flows. Key parts of the implementation include injecting a session service, opening authentication as a promise, handling the redirect flow with a popup window, and reading the access token from the hash fragment or popup message.
The document discusses servlet session management. It covers servlet filters which can intercept and modify requests and responses. It also discusses the servlet context and configuration parameters, as well as the session object and APIs. Session attributes allow data to be stored and shared across requests from the same client, while context attributes are shared across the entire application. Session tracking allows associating requests from the same client, typically using cookies or URL rewriting to pass the session identifier.
Presented at EmberConf 2015 by @sugarpirate_
In the dark ages of web development, designing a beautiful user experience meant having to constantly fight with the DOM to get it to do what you want, when you want. With Ember, we no longer have to struggle with managing DOM state, and we are free to put the user experience first with reactive UI.
In this talk, we'll discuss the ways in which Ember makes it easy to build delightful and reactive user experiences, and how you can build reusable components that even non-technical designers can learn to use. Learn about the thoughtful touches and interactions you can add to an Ember app.
Links:
1. Computed property macro demo – http://emberjs.jsbin.com/vubaga/11/edit?js,output
2. Showerthoughts loading messages demo – http://emberjs.jsbin.com/lulaki/35/edit?js,output
3. Flash messages demo – http://emberjs.jsbin.com/ranewo/45/edit?js,output
4. Drag and drop demo – http://emberjs.jsbin.com/denep/18/edit?js,output
OAuth 2.0 is an open authentication and authorization protocol which enables applications to access each others data. This talk will presents how to implement the OAuth2 definitions to secure RESTful resources developed using JAX-RS in the Java EE platform.
Java Svet - Communication Between Android App ComponentsAleksandar Ilić
Â
Presentation about how to build flexible (using fragments), smooth (using async tasks and intent services) and "data up to date" (using loaders) Android applications.
Ajax allows for asynchronous retrieval of data from a server in the background without reloading the page. It uses a combination of technologies like XMLHttpRequest, JavaScript, and DOM to make asynchronous calls to a server and update portions of a page without reloading. The document then provides an example of how an Ajax interaction works, from making an asynchronous request to a server to processing the response and updating the HTML DOM.
The document discusses how to programmatically make URL requests in Java. It covers using the URL and URLConnection classes to (1) parse URLs, (2) retrieve URL contents by opening connections or streams, and (3) get header information. It also provides examples of how to fake GET and POST form submissions by encoding parameters and sending requests via URLConnection.
Android Cloud to Device Messaging Framework at GTUG StockholmJohan Nilsson
Â
The document discusses the Android Cloud to Device Messaging (C2DM) framework. It allows application servers to send lightweight messages to Android apps. Key points:
- C2DM notifies apps of new data to fetch rather than sending large amounts of content. It makes no guarantees about message delivery or order.
- Apps can receive messages even when not running by using intent broadcasts. C2DM only passes raw message data.
- Apps must register with C2DM to receive messages and can unregister. Registration requires Android 2.2+ with the Market app installed.
- The app server sends messages via HTTP using a registration ID and authorization token. C2DM handles storing and delivering messages when
This document provides an example of how to create a splash screen in Android that is displayed for a set period of time before redirecting to the main application screen. It describes two methods for implementing a splash screen: 1) Using a thread to sleep for the set time before redirecting, and 2) Using a Handler and postDelayed to call a Runnable after the set time to redirect. The example project structure is also outlined.
1) The document discusses IBM's Big Data platform which provides solutions for analyzing massive amounts of structured and unstructured data.
2) It includes offerings for Hadoop, streaming analytics, data warehousing, in-memory databases, and tools for information integration and governance.
3) The platform aims to help customers accelerate insights from their data, simplify big data adoption, and implement enterprise-grade big data systems.
This chapter describes how to construct SOAP messages to process transactions with CyberSource using PHP 5.2.1. It provides instructions for downloading required third-party software, extending the SoapClient class to add WS-Security headers, and testing transactions using sample code provided. Developers can then modify the script and client code to integrate it with their application.
The .NET Framework is a software framework developed by Microsoft that runs primarily on Windows. It includes a large class library and provides language interoperability across programming languages. Programs written for .NET execute in the Common Language Runtime (CLR), which provides services like security and memory management. The .NET Framework includes versions for mobile devices and supports multiple programming languages that compile to an intermediate language and are then compiled to native code when executing.
1. Determine if a Big Data approach is suitable based on factors like volume, variety and velocity of data as well as the need for iterative, exploratory analysis.
2. Use techniques like Hadoop, MapReduce and NoSQL databases that can analyze large, diverse, unstructured datasets in a distributed, parallel manner.
3. Follow data management best practices like data governance, quality checks, and master data management to ensure clean, well-organized data.
Agent technology for e commerce-recommendation systemsAravindharamanan S
Â
This document discusses recommender systems which provide recommendations to users based on their preferences and the preferences of similar users. It describes two main techniques for recommender systems: content-based filtering which provides recommendations based on a user's profile of interests, and collaborative filtering which identifies other users with similar tastes and provides recommendations based on their preferences. The document also discusses issues with recommender systems like data sparsity, cold start problems, and privacy concerns when user profiles are collected.
Recommender systems are a technological proxy for social recommendations that suggest similar items or ideas to users based on their tastes. They aim to automate word-of-mouth recommendations by analyzing user preferences and behavior patterns to suggest new content. Recommender systems are commonly used on e-commerce sites to improve sales by suggesting additional items customers may like. They can use collaborative filtering by comparing users, content-based filtering by analyzing item content, or knowledge-based approaches. Maintaining accurate recommender systems over time with large amounts of user data presents challenges.
This document provides an overview and summary of the Oracle Database SQL Reference manual. It includes information about the primary author and contributors, copyright details, and instructions that the document and programs are proprietary and protected. It also contains a table of contents listing the chapters and main topics covered in the manual such as datatypes, literals, format models, nulls, comments and hints.
The document discusses best practices for designing REST APIs using the JAX-RS implementation CXF. It covers REST architectural principles, designing resources and URIs, representations with JSON and XML, errors, asynchronous processing, and transactions. The goal is to provide practical lessons learned from building the Syncope REST API to help others design RESTful services with CXF.
The document discusses big data, including what it is, key factors enabling its growth, and examples of tools and techniques used for big data. It also provides examples of big data applications in areas like recommendations, network monitoring, social media analysis, and discusses challenges like dealing with data volume, velocity, and complexity.
- User-based collaborative filtering uses the ratings of similar users to predict ratings for a target user. Similarity is commonly measured using Pearson correlation. Predictions are generated by taking a weighted average of similar users' ratings.
- Item-based collaborative filtering finds similar items to those a user has rated and uses the user's ratings of similar items to predict new ratings. Cosine similarity is commonly used to find similar items.
- Collaborative filtering approaches struggle with data sparsity as they require overlapping ratings between users or items to find similarities. Techniques like singular value decomposition aim to address this by reducing the user-item rating matrix to fewer factors to better capture similarities despite sparsity.
The document discusses using Java objects to generate JSON. It provides an overview of the steps involved, including setting response headers, getting the Java object result, converting it to a JSONObject using the org.json utilities, and outputting the JSONObject. Code samples are given for a servlet that performs these steps. Specifically, it shows calling a business logic method to get a Java result, converting it to a JSONObject, and printing the JSONObject to the response.
This document discusses the basic structure and purpose of SOAP messages. It begins by explaining that a SOAP message is an XML document that can be used to exchange data between applications. The core elements of a SOAP message are the Envelope and Body elements, which form the container for the payload data being exchanged. An example is provided of a simple SOAP message containing a purchase order payload. The document continues to describe additional details of SOAP including supported transport protocols, messaging patterns, and the role of XML namespaces in SOAP messages.
This document discusses content-based recommendation techniques. It begins by defining content-based recommendation as techniques that use properties of items themselves to make recommendations, as opposed to collaborative filtering which relies only on user ratings. It then describes how content-based profiling works by building a profile of a user's preferences based on the features of items they have rated. Finally, it provides examples of how naive Bayes classification and neural networks can be used to classify items for content-based recommendations based on feature frequencies.
This document provides a tutorial on SQLite, an open-source SQL database that does not require a separate server. It begins with an overview of SQLite and its features, then discusses how to install SQLite on different operating systems. The majority of the document describes SQLite syntax, commands, and statements for working with databases, tables, indexes, and data, including examples. It also covers data types and how to create, attach, and detach databases in SQLite.
SOAP is a protocol for exchanging XML-based messages over computer networks, normally using HTTP/HTTPS. It allows applications to communicate by exchanging SOAP messages, which consist of an envelope containing a header and body. The header contains processing instructions, while the body contains the payload data. SOAP was designed to be independent of any underlying transport or operating system, and to provide extensibility to address future needs.
This document provides an introduction to Visual Studio, C#, and object-oriented programming. It discusses Visual Studio as an integrated development environment for creating various application types. C# is introduced as an object-oriented programming language that is part of the .NET framework from Microsoft. The .NET framework includes a large class library and supports language interoperability. Object-oriented programming organizes code around objects and their properties/methods rather than standalone functions. The document outlines various topics that will be covered, including Visual Studio features, C# fundamentals, and object-oriented techniques in C#.
This document provides an overview of the HttpClient library. It discusses the fundamentals of making HTTP requests and handling responses. It also covers more advanced topics like connection management, state management, authentication, caching, and asynchronous request execution. The document is intended to teach developers how to effectively utilize the full capabilities of the HttpClient library.
How To Manage API Request with AXIOS on a React Native AppAndolasoft Inc
Â
Making an API request is as simple as passing a configuration object to Axios or invoking the appropriate method with the necessary arguments. Read More: https://www.andolasoft.com/blog/how-to-manage-api-request-with-axios-on-react-native-app.html
This document provides an overview of Java web services, including key concepts like XML-based communication, loose coupling of services, and support for synchronous and asynchronous calls. It also describes major web service technologies like SOAP, WSDL, and UDDI. Additionally, it outlines Java APIs for building, deploying, and consuming web services and provides an example of creating a simple book ordering service.
The document provides an overview of web services in Salesforce, specifically covering SOAP and REST web services. It defines SOAP and REST, compares the two approaches, and provides guidance on when to use each. It also covers how to create and consume SOAP web services in Salesforce, including exposing a SOAP web service publicly and making callouts to external web services. Security considerations for callouts like authentication and encryption are also briefly discussed.
WCF provides first-class support for building "Web" services that embrace REST design principles using standard Web protocols and data formats. This session illustrates how to build WCF services that support the HTTP uniform interface and different resource representations like XML, JSON, and Atom to enhance your Web 2.0 mash-up solutions. Throughout the session we'll specifically look at some of the new features in WCF 4.0 and WCF Data Services.
This document summarizes the experience of developing web applications using ASP.NET Core on Linux. It discusses the renaming of ASP.NET to ASP.NET Core, changes to Visual Studio integration, support for package managers like NPM, and the current status of ASP.NET Core. The document also provides details on ASP.NET Core runtime platforms, web application structure, configuration using Project.json, dependency injection, middleware, and routing.
This document discusses building RESTful services with WCF. It provides an overview of the evolution of the web from being content-driven to also including capabilities. It outlines REST principles and how WCF supports building RESTful services through features like the webHttpBinding, WebGet/WebInvoke attributes, UriTemplates, and the WCF REST Starter Kit. Examples are given of using these features to build RESTful operations.
This document summarizes a presentation about building a cross-platform chat app using Microsoft Azure Mobile Services. The presentation covers an overview of Azure Mobile Services and its capabilities for storage, authentication, push notifications, custom APIs, and more. It then discusses the design of a sample chat app that integrates these Azure Mobile Services features, including authentication with social providers, storing user and chat data in the cloud, and sending push notifications across platforms. Code examples are also provided for common client-side and backend tasks in Azure Mobile Services.
ASP.NET Core Web API documentation web applicationAMARAAHMED7
Â
This document provides an overview of building a RESTful API with ASP.NET Core Web API. It covers topics like ASP.NET Core fundamentals, creating an API controller, routing, HTTP methods, dependency injection, repositories, action methods, and status codes. The goal is to demonstrate how to structure an API project in ASP.NET Core and add functionality to controllers through techniques like routing, dependency injection, and returning appropriate status codes.
Ajax allows for asynchronous retrieval of data from a server in the background without reloading the page. It uses a combination of technologies like XMLHttpRequest, JavaScript, and DOM to make asynchronous calls to a server and update portions of a page without reloading. The document then provides an example of how an Ajax interaction works, from making an asynchronous request to a server to processing the response and updating the HTML DOM.
The document discusses Microsoft's data stack, including REST, OData, and various client and server technologies. It provides information on understanding and exploring different data formats, clients, and service options. Specific topics covered include REST vs OData, WCF Data Services, the Entity Framework object modeling layer, and examples of consuming OData services from Netflix, TechEd 2010, and Twitter.
The document discusses servlets and how they work. Servlets are server-side Java programs that generate responses, usually in the form of HTML pages, to requests from web clients. Servlets run within a servlet container, which manages loading and executing servlets in response to requests. Servlets can access request parameters and session information, generate dynamic content, connect to databases, and more. Common methods include doGet() and doPost() to handle different HTTP request types.
This document provides an overview of Java servlets, including:
- Servlets reside on the server-side and generate dynamic web pages. They handle HTTP requests and responses.
- Servlets have a lifecycle of initialization, processing requests, and destruction. The servlet receives a request from the web server, processes it, and returns a response which is sent back to the client.
- Servlets offer advantages over CGI like better performance through multithreading and portability through the Java programming language. Common servlet APIs and interfaces are described.
This talk will explain the Google Web Toolkit (GWT), GWT architecture, and why you would want to use GWT. In addition, it will include a demo of GWT and the recently released GWT Designer (a tool that makes GWT development easy and that makes it fast to generate a complicated UI).
The document provides an overview of middleware in Node.js and Express. It defines middleware as functions that have access to the request and response objects and can run code and make changes to these objects before the next middleware in the chain. It discusses common uses of middleware like logging, authentication, parsing request bodies. It also covers Connect middleware and how Express builds on Connect by adding features like routing and views. Key aspects covered include the middleware pipeline concept, error handling with middleware, and common middleware modules.
The document discusses server-side programming and Java 2 Enterprise Edition (J2EE). It explains what J2EE is, its architecture and components. It describes the lifecycle of a servlet, including initialization, request handling, and destruction. It also discusses session management techniques in servlets like using cookies, URL rewriting, and hidden form fields to track user requests across multiple pages. Exception handling using request dispatchers is also covered.
This document provides an overview of JSP/Servlet architecture. It describes how a web request is handled from the browser to the web server and JSP/Servlet container. It then discusses key components like servlets, JSPs, the request and response objects. It provides examples of basic servlet and JSP code to output text and access request parameters. It also covers servlet configuration, mappings, and the use of forwards and redirects.
This document discusses working with ASP.NET MVC and AJAX. It introduces AJAX and its benefits, describes raw AJAX implementation, and multiple AJAX options like Microsoft AJAX, jQuery AJAX, and AJAX helpers. It also covers rendering partial views with AJAX, handling errors, using JSON, and integrating WCF services.
The document discusses developing custom ASP.NET AJAX client components and server controls. It covers the key steps which are:
1) Developing the reusable client component code using the ASP.NET AJAX prototype model.
2) Creating an associated server control that emits the required JavaScript to register and initialize the client component.
3) Wiring up the server control to load and instantiate the client component code.
Building Production Ready Search Pipelines with Spark and MilvusZilliz
Â
Spark is the widely used ETL tool for processing, indexing and ingesting data to serving stack for search. Milvus is the production-ready open-source vector database. In this talk we will show how to use Spark to process unstructured data to extract vector representations, and push the vectors to Milvus vector database for search serving.
Fueling AI with Great Data with Airbyte WebinarZilliz
Â
This talk will focus on how to collect data from a variety of sources, leveraging this data for RAG and other GenAI use cases, and finally charting your course to productionalization.
Your One-Stop Shop for Python Success: Top 10 US Python Development Providersakankshawande
Â
Simplify your search for a reliable Python development partner! This list presents the top 10 trusted US providers offering comprehensive Python development services, ensuring your project's success from conception to completion.
GraphRAG for Life Science to increase LLM accuracyTomaz Bratanic
Â
GraphRAG for life science domain, where you retriever information from biomedical knowledge graphs using LLMs to increase the accuracy and performance of generated answers
Digital Marketing Trends in 2024 | Guide for Staying AheadWask
Â
https://www.wask.co/ebooks/digital-marketing-trends-in-2024
Feeling lost in the digital marketing whirlwind of 2024? Technology is changing, consumer habits are evolving, and staying ahead of the curve feels like a never-ending pursuit. This e-book is your compass. Dive into actionable insights to handle the complexities of modern marketing. From hyper-personalization to the power of user-generated content, learn how to build long-term relationships with your audience and unlock the secrets to success in the ever-shifting digital landscape.
Generating privacy-protected synthetic data using Secludy and MilvusZilliz
Â
During this demo, the founders of Secludy will demonstrate how their system utilizes Milvus to store and manipulate embeddings for generating privacy-protected synthetic data. Their approach not only maintains the confidentiality of the original data but also enhances the utility and scalability of LLMs under privacy constraints. Attendees, including machine learning engineers, data scientists, and data managers, will witness first-hand how Secludy's integration with Milvus empowers organizations to harness the power of LLMs securely and efficiently.
How to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdfChart Kalyan
Â
A Mix Chart displays historical data of numbers in a graphical or tabular form. The Kalyan Rajdhani Mix Chart specifically shows the results of a sequence of numbers over different periods.
Letter and Document Automation for Bonterra Impact Management (fka Social Sol...Jeffrey Haguewood
Â
Sidekick Solutions uses Bonterra Impact Management (fka Social Solutions Apricot) and automation solutions to integrate data for business workflows.
We believe integration and automation are essential to user experience and the promise of efficient work through technology. Automation is the critical ingredient to realizing that full vision. We develop integration products and services for Bonterra Case Management software to support the deployment of automations for a variety of use cases.
This video focuses on automated letter generation for Bonterra Impact Management using Google Workspace or Microsoft 365.
Interested in deploying letter generation automations for Bonterra Impact Management? Contact us at sales@sidekicksolutionsllc.com to discuss next steps.
Monitoring and Managing Anomaly Detection on OpenShift.pdfTosin Akinosho
Â
Monitoring and Managing Anomaly Detection on OpenShift
Overview
Dive into the world of anomaly detection on edge devices with our comprehensive hands-on tutorial. This SlideShare presentation will guide you through the entire process, from data collection and model training to edge deployment and real-time monitoring. Perfect for those looking to implement robust anomaly detection systems on resource-constrained IoT/edge devices.
Key Topics Covered
1. Introduction to Anomaly Detection
- Understand the fundamentals of anomaly detection and its importance in identifying unusual behavior or failures in systems.
2. Understanding Edge (IoT)
- Learn about edge computing and IoT, and how they enable real-time data processing and decision-making at the source.
3. What is ArgoCD?
- Discover ArgoCD, a declarative, GitOps continuous delivery tool for Kubernetes, and its role in deploying applications on edge devices.
4. Deployment Using ArgoCD for Edge Devices
- Step-by-step guide on deploying anomaly detection models on edge devices using ArgoCD.
5. Introduction to Apache Kafka and S3
- Explore Apache Kafka for real-time data streaming and Amazon S3 for scalable storage solutions.
6. Viewing Kafka Messages in the Data Lake
- Learn how to view and analyze Kafka messages stored in a data lake for better insights.
7. What is Prometheus?
- Get to know Prometheus, an open-source monitoring and alerting toolkit, and its application in monitoring edge devices.
8. Monitoring Application Metrics with Prometheus
- Detailed instructions on setting up Prometheus to monitor the performance and health of your anomaly detection system.
9. What is Camel K?
- Introduction to Camel K, a lightweight integration framework built on Apache Camel, designed for Kubernetes.
10. Configuring Camel K Integrations for Data Pipelines
- Learn how to configure Camel K for seamless data pipeline integrations in your anomaly detection workflow.
11. What is a Jupyter Notebook?
- Overview of Jupyter Notebooks, an open-source web application for creating and sharing documents with live code, equations, visualizations, and narrative text.
12. Jupyter Notebooks with Code Examples
- Hands-on examples and code snippets in Jupyter Notebooks to help you implement and test anomaly detection models.
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slackshyamraj55
Â
Discover the seamless integration of RPA (Robotic Process Automation), COMPOSER, and APM with AWS IDP enhanced with Slack notifications. Explore how these technologies converge to streamline workflows, optimize performance, and ensure secure access, all while leveraging the power of AWS IDP and real-time communication via Slack notifications.
Dive into the realm of operating systems (OS) with Pravash Chandra Das, a seasoned Digital Forensic Analyst, as your guide. 🚀 This comprehensive presentation illuminates the core concepts, types, and evolution of OS, essential for understanding modern computing landscapes.
Beginning with the foundational definition, Das clarifies the pivotal role of OS as system software orchestrating hardware resources, software applications, and user interactions. Through succinct descriptions, he delineates the diverse types of OS, from single-user, single-task environments like early MS-DOS iterations, to multi-user, multi-tasking systems exemplified by modern Linux distributions.
Crucial components like the kernel and shell are dissected, highlighting their indispensable functions in resource management and user interface interaction. Das elucidates how the kernel acts as the central nervous system, orchestrating process scheduling, memory allocation, and device management. Meanwhile, the shell serves as the gateway for user commands, bridging the gap between human input and machine execution. đź’»
The narrative then shifts to a captivating exploration of prominent desktop OSs, Windows, macOS, and Linux. Windows, with its globally ubiquitous presence and user-friendly interface, emerges as a cornerstone in personal computing history. macOS, lauded for its sleek design and seamless integration with Apple's ecosystem, stands as a beacon of stability and creativity. Linux, an open-source marvel, offers unparalleled flexibility and security, revolutionizing the computing landscape. 🖥️
Moving to the realm of mobile devices, Das unravels the dominance of Android and iOS. Android's open-source ethos fosters a vibrant ecosystem of customization and innovation, while iOS boasts a seamless user experience and robust security infrastructure. Meanwhile, discontinued platforms like Symbian and Palm OS evoke nostalgia for their pioneering roles in the smartphone revolution.
The journey concludes with a reflection on the ever-evolving landscape of OS, underscored by the emergence of real-time operating systems (RTOS) and the persistent quest for innovation and efficiency. As technology continues to shape our world, understanding the foundations and evolution of operating systems remains paramount. Join Pravash Chandra Das on this illuminating journey through the heart of computing. 🌟
System Design Case Study: Building a Scalable E-Commerce Platform - Hiike
Â
Android+ax+app+wcf
1. Android Ax App – Part 1–Set up the
intermediate WCF service
December 5, 2011.Net, Android, Ax 2012, Dynamics Ax, JSON, REST, WCFAndroid,AX2012, JSON, REST, WCF
2 Votes
I came across a blog by Joris De Gruyter http://daxmusings.blogspot.com/2011/11/10-minute-app-windows-phone-7-
app.html and decided to use that to connect to an Android device.
This is part 1 of 2 to explain the process of creating the Android application to connect to Ax via AIF services.
Unlike the blog mentioned above, I had to enable REST in the WCF service, and output it as JSON. This is because
android has a better JSON support than SOAP (ksoap can be used to consume the WCF services, but I have found
JSON to be a much easier approach)
To enable REST services, I installed the WCFRestContrib package. This is available from NuGet and can be installed
using
2. PM> Install-Package wcfrestcontrib
We can create the WCF Service using the no configuration mode. This link defines how to create a WCF service with no
configuration. Which means most of the web.config is deleted, and another identifier is attached to the SVC file. This
however relies of transport security as there is no SOAP envelope around this. WCFRESTContrib allows to create
acustom authentication system. The authentication data can be retrieved from the HTML headers and verified.
So the WCF service should look like this, it enables a GET method and has a certain URI, and outputs the data in JSON
01
02
03
04
05
06
07
08
09
10
11
12
13
namespace WcfService1
{
[ServiceContract]
[ServiceAuthentication] //WCFRESTContrib attribute - authentication per session (or at method level for per call
[WebGet(UriTemplate = "/api1/appName", ResponseFormat = WebMessageFormat.Json)]
[OperationContract]
string ApplicationName();
[WebGet(UriTemplate = "/api1/items", ResponseFormat = WebMessageFormat.Json)]
[OperationContract]
List GetAllItemIds();
}
}
The Service interface markup (this allows for a noconfiguration WCF Service)
1
2
3
4
5
6
<%@ ServiceHost
Language="C#"
Debug="true"
Service="WcfService1.Api1"
CodeBehind="Api1.svc.cs"
Factory="System.ServiceModel.Activation.WebServiceHostFactory"
%>
3. 7
The Service file itself
01
02
03
04
05
06
07
08
09
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
namespace WcfService1
{
[WebAuthenticationConfiguration(
typeof(WcfService1.ApiAuthnetication),
typeof(ApiAuthneticationValidator),
true,
"My Application")]
public class Api1 : IApi1 {
public string GetUsername()
{
object authValue;
string authStr = "", username = "", password = "";
try {
var keys = OperationContext.Current.IncomingMessageProperties.Keys;
OperationContext.Current.IncomingMessageProperties.TryGetValue("httpRequest", out authValue);
if (authValue != null)
{
System.ServiceModel.Channels.HttpRequestMessageProperty p = (System.ServiceModel.Channels.HttpRequ
authStr = p.Headers.Get("Authorization");
ApiAuthnetication.GetUsernamePwd(authStr, out username, out password);
}
}
catch (Exception e)
{
return e.Message;
}
return username;
}
public string ApplicationName()
{
string username = this.GetUsername();
return username;
}
public List GetAllItemIds()
{
4. 31
32
33
34
35
36
37
38
39
40
return Item.GetItems(this.GetUsername());
}
}
}
Notice the header attributes. This needs to be defined and is based on the WCFRESTContrib package. The
authentication classes created is. Notice that the Username and password are being sent in the header with the tag
“Authorization” this can be renamed to anything you like
01
02
03
04
05
06
07
08
09
10
11
12
13
14
15
16
17
18
namespace WcfService1
{
public class ApiAuthnetication : WcfRestContrib.ServiceModel.Dispatcher.IWebAuthenticationHandler {
public static bool GetUsernamePwd(string authenticationStr, out string username, out string password)
{
bool result = true;
username = "";
password = "";
try {
var values = authenticationStr.Split(':');
username = values[0];
password = values[1];
}
catch {
result = false;
}
return result;
}
public System.Security.Principal.IIdentity Authenticate(
System.ServiceModel.Web.IncomingWebRequestContext request,
System.ServiceModel.Web.OutgoingWebResponseContext response,
6. 52
53
54
55
The code to get the InventTable data is pretty similar to Joris’s blog. Here is mine:
01
02
03
04
05
06
07
08
09
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
namespace WcfService1
{
public class Item {
public string ItemId { get; set; }
public string Name { get; set; }
public static List GetItems(string username)
{
List items = new List();
string itemIdFrom = "1000"; //I cheated here
string itemIdTo = "1105"; //I cheated here again
//Fetch items from AX here
using (ItemService.ItemServiceClient client = newItemService.ItemServiceClient())
{
ItemService.QueryCriteria qc = new ItemService.QueryCriteria();
ItemService.CriteriaElement criteria = new ItemService.CriteriaElement();
criteria.DataSourceName = "InventTable";
criteria.FieldName = "ItemId";
criteria.Operator = ItemService.Operator.Range;
criteria.Value1 = itemIdFrom;
criteria.Value2 = itemIdTo;
qc.CriteriaElement = new ItemService.CriteriaElement[] { criteria };
ItemService.CallContext context = new ItemService.CallContext();
context.Company = "ceu";
context.MessageId = Guid.NewGuid().ToString();
context.LogonAsUser = string.Format("LoonAx{0}", username);
var axItems = client.find(context, qc);
if (axItems.InventTable != null)
{
foreach (var inventTable in axItems.InventTable)
7. 28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
{
Item item = new Item() { ItemId = inventTable.ItemId, Name = inventTable.NameAlias };
items.Add(item);
}
}
}
/* //Mocking for AIF
for (int i = 0; i < 10; i++) { Item item = new Item() { ItemId = (1000 + i + 1).ToString(), Name = (1000 +
}*/ return items;
}
}
}
To make the connection secure (since we are sending the authentications via plain text in the HTML headers, this service
should ideally be secure)
Android with WCF service using JSON
Matija Božičević - 01.03.2012.
C# Android JSON WCF
8. inShare1
In this article I will show you simple example how to:
1. Create simple .NET WCF service
2. Connect Android application with .NET WCF service, get some data in JSON format, and show data in Android's ListView
1. Create simple .NET WCF service
Service.svc
With function GetPersons() we get data from SQL 2008 database, and return them as generic list.
?
1
2
3
4
5
6
using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.ServiceModel;
using System.ServiceModel.Web;
using System.Text;
10. IService.cs
Note that the spGetPersonsResult is SQL stored procedure accessed with DLINQ.
?
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.ServiceModel;
using System.ServiceModel.Web;
using System.Text;
using MB.AndroidWCF.DataAccessLayer;
namespace MB.AndroidWCF
{
[ServiceContract]
public interface IService
{
[OperationContract]
11. 16
17
18
19
20
21
22
23
[WebInvoke(Method = "GET",
ResponseFormat = WebMessageFormat.Json,
BodyStyle = WebMessageBodyStyle.Wrapped,
UriTemplate = "GetPersonsJSON")]
List<spGetPersonsResult> GetPersons();
}
}
The WCF service returns data in JSON format like this:
?
1
2
3
4
{"GetPersonsResult":[{"ID":1,"FullName":"Matija Božičević"},
{"ID":2,"FullName":"Al Pacino"},
{"ID":3,"FullName":"Clint Eastwood"}]}
12. 2. Connect Android application with .NET WCF service, get some data inJSON format, and show data in
Android's ListView
MainActivity.java
?
1
2
3
4
5
6
7
8
9
1
0
1
1
1
2
1
3
1
4
package AndroidWCFApp.package;
import android.app.Activity;
import android.view.View;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.net.URL;
import java.net.URLConnection;
import java.util.ArrayList;
import org.json.JSONArray;
import org.json.JSONObject;
14. 33
34
35
36
37
38
41
42
43
44
45
46
47
48
49
50
listView1.setAdapter(new ArrayAdapter<String>(this, android.R.layout.simple_list_item_1, persons));
}
public ArrayList<String> FromJSONtoArrayList() {
ArrayList<String> listItems = new ArrayList<String>();
try {
39
40
// Replace it with your own WCF service path
URL json = new URL("http://192.168.1.1:9020/Service.svc/GetPersonsJSON");
URLConnection jc = json.openConnection();
BufferedReader reader = new BufferedReader(new InputStreamReader(jc.getInputStream()));
String line = reader.readLine();
JSONObject jsonResponse = new JSONObject(line);
JSONArray jsonArray = jsonResponse.getJSONArray("GetPersonsResult");
for (int i = 0; i < jsonArray.length(); i++) {
15. 5
1
5
2
5
3
5
4
5
5
5
6
5
7
5
8
5
9
6
0
6
1
6
2
6
3
6
4
JSONObject jObject = (JSONObject)jsonArray.get(i);
// "FullName" is the property of .NET object spGetPersonsResult,
// and also the name of column in SQL Server 2008
listItems.add(jObject.getString("FullName"));
}
reader.close();
} catch(Exception e){
Toast.makeText(this, e.toString(), Toast.LENGTH_LONG).show();
}
return listItems;
}
}
16. 69
70
Walkthrough - Working with WCF
PDF for offline use:
ď‚· Download PDF
SampleCode:
ď‚· HelloWorld.zip
Related Articles:
ď‚· Windows Communication Foundation on MSDN
ď‚· Using SLsvcUtil.exe to Access a Service
Related SDKs:
ď‚· Microsoft Silverlight 5 SDK
This walkthrough covers how a mobile application built with Xamarin can consume a WCF web service using the
BasicHttpBinding.
Overview
It is a common requirement for mobile applications to be able to communicate with backend systems. There are many choices and options for back
17. frameworks, one of which is Windows Communication Foundation (WCF). This walkthrough will provide an example of how a Xamarin mobile
application can consume a WCF service using the BasicHttpBinding, as outlined below:
Create a WCF Service - In this section we will create a very basic WCF service having two methods. The first method will take a string parameter, while the ot
method will take a C# object. This section will also discuss how to configure a developer's workstation to allow remote access to the WCF service.
Create a Xamarin.Android Application - Once the WCF service has been created, we will create a simple Xamarin.Android application that will use the WCF
service. This section will cover how to create a WCF service proxy class to facilitate communication with the WCF service.
Create a Xamarin.iOS Application - The final part of this tutorial involves creating a simple Xamarin.iOS application that will use the WCF service.
The following screen shots shows the two applications running:
20. In order to create the WCF service proxies, you will need the Silverlight 5 SDK installed. Download and run the installer from Microsoft before
proceeding with this walkthrough.
IIS Express will be used to host the WCF Service used in this walkthrough. This is the default web server for Visual Studio 2012. Installing IIS Exp
in older versions of Visual Studio is beyond the scope of this walkthrough.
Note:This walkthrough was created on Windows 8 using Visual Studio 2012. If you are using on an older version of Windows or Visual Studio, be
aware that some parts of this walkthrough may not be applicable to your development environment.
Creating a WCF Service
The first task before us is to create a WCF service for our mobile applications to communicate with.
Start up Visual Studio 2012, and press Alt-F-N-P to open the New Project dialog. Select the WCF Service Applicationtemplate from the new project dialog as
shown in the following screenshot:
21. Name the project HelloWorldWcfHost, and name the solution HelloWorld. Click the OK button.
Next we need to create the service contract for the web service. Add an interface named IHelloWorldService and paste in the following code:
[ServiceContract]
public interface IHelloWorldService
{
[OperationContract]
string SayHelloTo(string name);
[OperationContract]
HelloWorldData GetHelloData(HelloWorldData helloWorldData);
}
This service provides two methods - one that takes a string for a parameter and another that takes a .NET object.
22. Our WCF service requires the class HelloWorldData as a parameter, so let's create this type next. Add a new class to the project named HelloWorldDataw
the following implementation:
[DataContract]
public class HelloWorldData
{
public HelloWorldData()
{
Name = "Hello ";
SayHello = false;
}
[DataMember]
public bool SayHello { get; set; }
[DataMember]
public string Name { get; set; }
}
The final thing we need to do is to create the WCF Service class . Press Ctrl-Shift-A to bring up the Add New Itemdialog:
23. Add a new WCF Service class to the project named HelloWorldService. Edit the class so that it implementsIHelloWorldService and contains
code from the following snippet:
24. public class HelloWorldService : IHelloWorldService
{
public HelloWorldData GetHelloData(HelloWorldData helloWorldData)
{
if (helloWorldData == null)
{
throw new ArgumentNullException("helloWorldData");
}
if (helloWorldData.SayHello)
{
helloWorldData.Name = String.Format("Hello World to {0}.", helloWorldData.Name);
}
return helloWorldData;
}
public string SayHelloTo(string name)
{
return string.Format("Hello World to you, {0}", name);
}
}
This final step is optional. In it we change the default port for the WCF service to use 9607 for connections being made from localhost. Press Alt-P-P to br
up the Project Properties dialog for the HelloWorldWcfHost project. Select theWeb tab, and set the Project Url to http://localhost:9607/, as shown in th
following screenshot:
25. At this point we should have a working WCF service. If we run the project, and point our browser to http://localhost:9067/HelloWorldService.svc,
should see the following page:
26. This current setup is sufficient if we only have to connect with the WCF service from our local workstation. However, remote devices (such as an
Android device or an iPhone) do not have any access to the WCF service. The next section will cover how to configure Windows 8 and IIS Express
accept remote connections.
Note: The following section is only necessary if you need to accept remote connections on a Windows 8 workstation. If you have an alternate platf
on which to deploy this Web Service you can ignore following section.
27. Configuring Remote Access to IIS Express
By default, Windows 8 and IIS Express will not accept remote connections. Before any remote devices, such as an Android device or an iPhone can
communicate with our WCF service we must make the following changes:
Configure IIS Express to Accept Remote connections - This step involves editing the config file for IIS Express to accept remote connections on a specific po
then setting up a rule for IIS Express to accept the incoming traffic.
Add an Exception to Windows Firewall - We must open up a port through Windows Firewall that remote applications can use to communicate with the WCF
service.
You will need to know the IP address of your workstation. For the purposes of this example we'll assume that our workstation has the IP address
192.168.1.143.
Let's begin by configuring IIS Express to listen for external requests. We do this by editing the configuration file for IIS Express
at %userprofile%documentsiisexpressconfigapplicationhost.config, as shown in the following screenshot:
28. Locate the site element with the name HelloWorldWcfHost. It should look something like the following XMLsnippet:
<site name="HelloWorldWcfHost" id="2">
<application path="/" applicationPool="Clr4IntegratedAppPool">
<virtualDirectory path="/" physicalPath="vmware-hostShared Folderstomworkxamarincodeprivate-
sampleswebservicesHelloWorldHelloWorldWcfHost" />
</application>
<bindings>
<binding protocol="http" bindingInformation="*:9607:localhost" />
29. </bindings>
</site>
We will need to add another binding to open up port 9608 to outside traffic. Add the following XML to the bindingselement:
<binding protocol="http" bindingInformation="*:9608:192.168.1.143" />
This will configure IIS Express to accept HTTP traffic from any remote IP address on port 9608 on the external IP address of the computer. This ab
snippet assumes the IP address of the computer running IIS Express is 192.168.1.143. After the changes, the bindings element should look like th
following:
<site name="HelloWorldWcfHost" id="2">
<application path="/" applicationPool="Clr4IntegratedAppPool">
<virtualDirectory path="/" physicalPath="vmware-hostShared Folderstomworkxamarincodeprivate-
sampleswebservicesHelloWorldHelloWorldWcfHost" />
</application>
<bindings>
<binding protocol="http" bindingInformation="*:9607:localhost" />
<binding protocol="http" bindingInformation="*:9608:192.168.1.143" />
</bindings>
</site>
Next, we need to configure IIS Express accept incoming connections on port 9608. Startup up an administrative command prompt, and run this command:
> netsh http add urlacl url=http://192.168.1.143:9608/ user=everyone
The final step is to configure Windows Firewall to permit external traffic on port 9608. From an administrative command prompt, run the following command:
> netsh advfirewall firewall add rule name="IISExpressXamarin" dir=in protocol=tcp localport=9608 profile=private
remoteip=localsubnet action=allow
This command will allow incoming traffic on port 9608 from all devices on the same subnet as the Windows 8 workstation.
30. At this point we have created a very basic WCF service hosted in IIS Express that will accept incoming connections from other devices or compute
our subnet. You can test this out by visiting http://localhost:9607/HelloWorldService.svc on your workstation and
http://192.168.1.143:9608/HelloWorldService.svc from another computer on your subnet.
Creating a Xamarin.Android Application
Now that we have the WCF service working, let's move on to creating a Xamarin.Android application.
Add a new Android project to the solution and name it HelloWorld.Android.
Change the default namespace of the application from HelloWorld.Android to HelloWorld.Droid.
Next we need to create a proxy for the web service. To create the proxy we'll use the Silverlight Service Model Proxy Generation Tool (SLsvcUtil.exe). You
find this command line utility at the following location:
C:Program Files (x86)Microsoft SDKsSilverlightv5.0ToolsSLsvcUtil.exe
Ensure that the WCF service we created in the previous section is running, and then run SLsvcUtil.exe with the following commandline:
SLsvcUtil.exe /noConfig http://localhost:9607/HelloWorldService.svc
This will create a service proxy called HelloWorldService in the file HelloWorldService.cs. Add this file to your Xamarin.Android project a
shown in the following screenshot:
31. Before this generated proxy class will compile, we need to add to some references to our Xamarin.Android project, as shown in the follwoing screenshot:
32. With the above infrastructure in place, we can finish up the Android application. Edit the file Activity1.cs and add the following instancevariables:
[Activity(Label = "@string/app_name", MainLauncher = true, Icon = "@drawable/icon")]
public class Activity1 : Activity
{
public static readonly EndpointAddress EndPoint = new
EndpointAddress("http://192.168.1.143:9609/HelloWorldService.svc");
private HelloWorldServiceClient _client;
private Button _getHelloWorldDataButton;
35. Now with the UI and instance variables in place, modify OnCreate to contain the following code:
protected override void OnCreate(Bundle bundle)
{
base.OnCreate(bundle);
SetContentView(Resource.Layout.Main);
36. InitializeHelloWorldServiceClient();
// This button will invoke the GetHelloWorldData - the method that takes a C# object as a parameter.
_getHelloWorldDataButton = FindViewById<Button>(Resource.Id.getHelloWorldDataButton);
_getHelloWorldDataButton.Click += GetHelloWorldDataButtonOnClick;
_getHelloWorldDataTextView = FindViewById<TextView>(Resource.Id.getHelloWorldDataTextView);
// This button will invoke SayHelloWorld - this method takes a simple string as a parameter.
_sayHelloWorldButton = FindViewById<Button>(Resource.Id.sayHelloWorldButton);
_sayHelloWorldButton.Click += SayHelloWorldButtonOnClick;
_sayHelloWorldTextView = FindViewById<TextView>(Resource.Id.sayHelloWorldTextView);
}
The code above initializes the instance variables for our class and wires up some event handlers.
Next we need to instantiate the client proxy class in our Activity. Edit Activity1.cs and add the following two methods tothe class:
private void InitializeHelloWorldServiceClient()
{
BasicHttpBinding binding = CreateBasicHttp();
_client = new HelloWorldServiceClient(binding, EndPoint);
_client.SayHelloToCompleted += ClientOnSayHelloToCompleted;
_client.GetHelloDataCompleted += ClientOnGetHelloDataCompleted;
}
private static BasicHttpBinding CreateBasicHttp()
{
BasicHttpBinding binding = new BasicHttpBinding
{
Name = "basicHttpBinding",
MaxBufferSize = 2147483647,
MaxReceivedMessageSize = 2147483647
};
TimeSpan timeout = new TimeSpan(0, 0, 30);
binding.SendTimeout = timeout;
binding.OpenTimeout = timeout;
binding.ReceiveTimeout = timeout;
37. return binding;
}
The code above instantiates and initializes a HelloWorldService object. The WCF proxy class can onlycall the WCF service asynchronously.
Responses from the WCF service will handled by the xxxCompleted events that were generated bySLsvcUtil.exe.
Now we need to add the event handlers for the two buttons in our activity. Edit Activity1.cs and add the following two methods:
private void GetHelloWorldDataButtonOnClick(object sender, EventArgs eventArgs)
{
HelloWorldData data = new HelloWorldData { Name = "Mr. Chad", SayHello = true };
_getHelloWorldDataTextView.Text = "Waiting for WCF...";
_client.GetHelloDataAsync(data);
}
private void SayHelloWorldButtonOnClick(object sender, EventArgs eventArgs)
{
_sayHelloWorldTextView.Text = "Waiting for WCF...";
_client.SayHelloToAsync("Kilroy");
}
Finally, we need to add event handlers for the xxxCompleted events of the HelloWorldService proxy client. Once again edit Activity1.cs and add the
followingmethods:
private void ClientOnGetHelloDataCompleted(object sender, GetHelloDataCompletedEventArgs getHelloDataCompletedEventArg
{
string msg = null;
if (getHelloDataCompletedEventArgs.Error != null)
{
msg = getHelloDataCompletedEventArgs.Error.Message;
}
else if (getHelloDataCompletedEventArgs.Cancelled)
{
msg = "Request was cancelled.";
}
else
38. {
msg = getHelloDataCompletedEventArgs.Result.Name;
}
RunOnUiThread(() => _getHelloWorldDataTextView.Text = msg);
}
private void ClientOnSayHelloToCompleted(object sender, SayHelloToCompletedEventArgs sayHelloToCompletedEventArgs)
{
string msg = null;
if (sayHelloToCompletedEventArgs.Error != null)
{
msg = sayHelloToCompletedEventArgs.Error.Message;
}
else if (sayHelloToCompletedEventArgs.Cancelled)
{
msg = "Request was cancelled.";
}
else
{
msg = sayHelloToCompletedEventArgs.Result;
}
RunOnUiThread(() =>_sayHelloWorldTextView.Text = msg);
}
Run the application, and click on the two buttons. Our application will call the WCF asynchronously. Within 30 seconds a response should be received from eac
WCF method, and our application should look something like the following screenshot:
39. Now that we have a working Xamarin.Android application, let's create a Xamarin.iOS client.
40. Creating a Xamarin.iOS Application
The Xamarin.iOS version is very similar to the Xamarin.Android application and will use the exact same WCF proxy client code that was generated
by SLsvcUtil.exe. The following screenshot shows our application after it has successfully interacted with the WCF service that we created earli
in this walkthrough:
41. Let's get started with the Xamarin.iOS application.
Start up Xamarin Studio, and open the HelloWorld solution. Add a new iPhone Single View Application to the solution, as shown in the following screenshot:
42. To create the user interface for our application, edit the .XIB in Interface Builder and add two UIButtons and twoUITextViews. Add the outlets for eachcon
43. according to the followingtable:
Name Text
UIButton sayHelloWorldButton Say HelloWorld
UITextView sayHelloWorldText
UIButton getHelloWorldDataButton Get Hello WorldData
UITextView sayHelloWorldText
After creating the outlets, the UI should resemble the following screenshot:
44. Next, add the WCF proxy class HelloWorldService.cs to our project by pressing Option-Cmd-A. This will bring up theAdd files dialog which you can us
locate and add the file to the project. Once that is done add references toSystem.Runtime.Serialization, System.ServiceModel,
and System.ServiceModel.Web just as we did in the Android application. The following screenshot shows Solution Explorer after adding these references:
45.
46. We need to add a couple variables to our view controller that the WCF client code will use. Edit the classXamarin_iOSViewController and add two instan
variables as shown in the following code snippet:
public partial class Xamarin_iOSViewController : UIViewController
{
public static readonly EndpointAddress EndPoint = new
EndpointAddress("http://192.168.1.143:9609/HelloWorldService.svc");
private HelloWorldServiceClient _client;
You will probably have to change the IP address to that of the computer that is hosting your WCF service.
After adding the variable above, update the ViewDidLoad method to include the following code:
public override void ViewDidLoad()
{
base.ViewDidLoad();
InitializeHelloWorldServiceClient();
}
Next, add some helper methods to instantiate a HelloWorkdService client proxy instance and hook up a couple event handlers.. Add the following two meth
to Xamarin_iOSViewController:
private void InitializeHelloWorldServiceClient()
{
BasicHttpBinding binding = CreateBasicHttp();
_client = new HelloWorldServiceClient(binding, EndPoint);
_client.SayHelloToCompleted += ClientOnSayHelloToCompleted;
_client.GetHelloDataCompleted += ClientOnGetHelloDataCompleted;
getHelloWorldDataButton.TouchUpInside += GetHelloWorldDataButtonTouchUpInside;
sayHelloWorldButton.TouchUpInside += SayHelloWorldDataButtonTouchUpInside;
}
47. private static BasicHttpBinding CreateBasicHttp()
{
BasicHttpBinding binding = new BasicHttpBinding
{
Name = "basicHttpBinding",
MaxBufferSize = 2147483647,
MaxReceivedMessageSize = 2147483647
};
TimeSpan timeout = new TimeSpan(0, 0, 30);
binding.SendTimeout = timeout;
binding.OpenTimeout = timeout;
binding.ReceiveTimeout = timeout;
return binding;
}
Next, create event handlers for the two UIButtons in the XIB file as shown below:
private void SayHelloWorldDataButtonTouchUpInside(object sender, EventArgs e)
{
sayHelloWorldText.Text = "Waiting for WCF...";
_client.SayHelloToAsync("Kilroy");
}
private void GetHelloWorldDataButtonTouchUpInside(object sender, EventArgs e)
{
getHelloWorldDataText.Text = "Waiting WCF...";
HelloWorldData data = new HelloWorldData { Name = "Mr. Chad", SayHello = true };
_client.GetHelloDataAsync(data);
}
Finally, add the event handlers for the xxxOnCompleted events that the HelloWorldServiceproxy client will raise when the WCF service sends a reply ba
our application. Add the following two methods to Xamarin_iOSViewController:
private void ClientOnGetHelloDataCompleted(object sender, GetHelloDataCompletedEventArgs e)
{
string msg = null;
48. if (e.Error != null)
{
msg = e.Error.Message;
}
else if (e.Cancelled)
{
msg = "Request was cancelled.";
}
else
{
msg = e.Result.Name;
}
InvokeOnMainThread(() => getHelloWorldDataText.Text = msg);
}
private void ClientOnSayHelloToCompleted(object sender, SayHelloToCompletedEventArgs e)
{
string msg = null;
if (e.Error != null)
{
msg = e.Error.Message;
}
else if (e.Cancelled)
{
msg = "Request was cancelled.";
}
else
{
msg = e.Result;
}
InvokeOnMainThread(() => sayHelloWorldText.Text = msg);
}
Now run the application, and click on each of the buttons in the UI. The WCF service will be called asynchronously. Within 30 seconds a response should be rec
from each WCF method, and our application should look like the following screenshot:
50. This tutorial covered how to work with a WCF service in a mobile application using Xamarin.Android and Xamarin.iOS. It showed how to create a
WCF service and explained how to configure Windows 8 and IIS Express to accept connections from remote devices. It then discussed how to gene
a WCF proxy client using the Silverlight Service Model Proxy Generation Tool ( SLsvcUtil.exe) and demonstrated how to use the proxy client in
both Xamarin.Android and Xamarin.iOS applications.