<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>TechDasher</title>
	<atom:link href="https://www.techdasher.com/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.techdasher.com/</link>
	<description>Tips, Tricks and Tutorials</description>
	<lastBuildDate>Sat, 05 Oct 2024 04:24:08 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.8.5</generator>

<image>
	<url>https://www.techdasher.com/wp-content/uploads/2018/03/cropped-tech_dahser_icon-32x32.png</url>
	<title>TechDasher</title>
	<link>https://www.techdasher.com/</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>Implementing Distributed Task Scheduling in Spring Boot Using ShedLock and MongoDB</title>
		<link>https://www.techdasher.com/implementing-distributed-task-scheduling-in-spring-boot-using-shedlock-and-mongodb/</link>
					<comments>https://www.techdasher.com/implementing-distributed-task-scheduling-in-spring-boot-using-shedlock-and-mongodb/#respond</comments>
		
		<dc:creator><![CDATA[cserajee]]></dc:creator>
		<pubDate>Sat, 05 Oct 2024 04:24:03 +0000</pubDate>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[Spring Boot]]></category>
		<category><![CDATA[MongoDB]]></category>
		<guid isPermaLink="false">https://www.techdasher.com/?p=370</guid>

					<description><![CDATA[<p>In distributed systems, scheduling tasks across multiple instances can be challenging. Without proper synchronization, a task could be executed more than once, leading to unexpected behavior. This is where ShedLock comes in&#8212;a lightweight library that prevents multiple executions of scheduled tasks in distributed applications. This article will explore how to integrate ShedLock with MongoDB to [&#8230;]</p>
<p>The post <a href="https://www.techdasher.com/implementing-distributed-task-scheduling-in-spring-boot-using-shedlock-and-mongodb/">Implementing Distributed Task Scheduling in Spring Boot Using ShedLock and MongoDB</a> appeared first on <a href="https://www.techdasher.com">TechDasher</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<p>In distributed systems, scheduling tasks across multiple instances can be challenging. Without proper synchronization, a task could be executed more than once, leading to unexpected behavior. This is where <a href="https://github.com/lukas-krecan/ShedLock">ShedLock</a> comes in—a lightweight library that prevents multiple executions of scheduled tasks in distributed applications.</p>



<p>This article will explore how to integrate ShedLock with MongoDB to ensure that your scheduled tasks are executed exactly once, even when multiple instances of the application are running.</p>



<h3 class="wp-block-heading">What is ShedLock?</h3>



<p>ShedLock is a library that ensures that only one instance of a scheduled task is executed in a distributed environment, even when multiple instances of an application are running. ShedLock achieves this by storing lock information in a database, making it accessible to all instances of your application.</p>



<p><strong>Why use ShedLock?</strong></p>



<ul class="wp-block-list"><li>It prevents the same scheduled task from being executed multiple times across different application instances.</li><li>It supports various backends like MongoDB, MySQL, Redis, and more.</li><li>It provides a simple API for integrating with Spring&#8217;s <code>@Scheduled</code> annotation.</li></ul>



<h4 class="wp-block-heading">2. <strong>Setting Up MongoDB for ShedLock</strong></h4>



<p>MongoDB is commonly used with ShedLock as a lock provider. Before you can integrate ShedLock with MongoDB, ensure that MongoDB is up and running, and you have the connection details handy.</p>



<h5 class="wp-block-heading"><strong>MongoDB Dependencies</strong></h5>



<p>To get started, add the following dependencies in your <code>pom.xml</code> if you are using Maven:</p>



<pre class="wp-block-code"><code>&lt;dependency>
    &lt;groupId>net.javacrumbs.shedlock&lt;/groupId>
    &lt;artifactId>shedlock-spring&lt;/artifactId>
    &lt;version>5.16.0&lt;/version>
&lt;/dependency>
&lt;dependency>
    &lt;groupId>net.javacrumbs.shedlock&lt;/groupId>
    &lt;artifactId>shedlock-provider-mongo&lt;/artifactId>
    &lt;version>5.16.0&lt;/version>
&lt;/dependency>
&lt;dependency>
    &lt;groupId>org.springframework.boot&lt;/groupId>
    &lt;artifactId>spring-boot-starter-data-mongodb&lt;/artifactId>
&lt;/dependency>
</code></pre>



<h4 class="wp-block-heading">3. <strong>Configuration for ShedLock with MongoDB</strong></h4>



<p>You need to configure MongoDB as a lock provider for ShedLock. Here’s how you can set it up in a Spring Boot application.</p>



<h5 class="wp-block-heading"><strong>MongoDB Configuration</strong>:</h5>



<pre class="wp-block-code"><code>import com.mongodb.client.MongoClient;
import net.javacrumbs.shedlock.core.LockProvider;
import net.javacrumbs.shedlock.provider.mongo.MongoLockProvider;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class ShedLockConfig {

    @Bean
    public MongoLockProvider lockProvider(MongoClient mongoClient) {
        return new MongoLockProvider(mongoClient.getDatabase("mydatabase"));
    }
}
</code></pre>



<p>Here, <code>MongoLockProvider</code> is used to store the lock information in a In this configuration, replace <code>"mydatabase"</code> with the name of your MongoDB database. This will be used by ShedLock to store lock information.</p>



<h5 class="wp-block-heading"><strong>Scheduler Configuration</strong>:</h5>



<p>Now, let’s define a scheduled task that will use ShedLock to ensure it runs only once across all instances. You can annotate your task with <code>@SchedulerLock</code> to handle locking logic.</p>



<pre class="wp-block-code"><code>import net.javacrumbs.shedlock.core.SchedulerLock;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Service;

@Service
public class MyScheduledTask {

    @Scheduled(cron = "0 */1 * * * ?")  // Runs every minute
    @SchedulerLock(name = "scheduledTask", lockAtLeastFor = "PT30S", lockAtMostFor = "PT1M")
    public void executeTask() {
        // Your task logic here
        System.out.println("Scheduled Task executed!");
    }
}
</code></pre>



<p>In this example:</p>



<ul class="wp-block-list"><li><code>@Scheduled</code> specifies the cron expression, which runs the task every minute.</li><li><code>@SchedulerLock</code> ensures that the lock is acquired before running the task. It includes parameters:<ul><li><code>lockAtLeastFor</code>: Ensures the lock is held for at least 30 seconds, preventing other instances from acquiring it too soon.</li><li><code>lockAtMostFor</code>: Specifies the maximum time the lock can be held to avoid situations where a node fails to release the lock.</li></ul></li></ul>



<h5 class="wp-block-heading"><strong>Enable Scheduling:</strong></h5>



<p>Ensure that scheduling is enabled in your Spring Boot application. You can do this by adding <code>@EnableScheduling</code> to your main application class:</p>



<pre class="wp-block-code"><code>import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.scheduling.annotation.EnableScheduling;

@SpringBootApplication
@EnableScheduling
public class MyApplication {

    public static void main(String&#91;] args) {
        SpringApplication.run(MyApplication.class, args);
    }
}</code></pre>



<h4 class="wp-block-heading">4. <strong>How ShedLock Works with MongoDB</strong></h4>



<p>Once you’ve set everything up:</p>



<ul class="wp-block-list"><li>Before a scheduled task runs, ShedLock will attempt to acquire a lock in MongoDB.</li><li>If no lock exists, it will create one and store it in the <code>shedlock</code> collection in MongoDB.</li><li>If the lock exists (i.e., another instance has already acquired it), the task will not be executed by the current instance.</li><li>After the task finishes execution, the lock will be released (or kept for the defined <code>lockAtLeastFor</code> duration).</li></ul>



<p>You can query the <code>shedlock</code> collection in MongoDB to see the locks in real-time:</p>



<pre class="wp-block-code"><code>db.shedlock.find()</code></pre>



<h4 class="wp-block-heading">5. <strong>Best Practices and Considerations</strong></h4>



<ul class="wp-block-list"><li><strong>Handle Clock Skew</strong>: In a distributed system, ensure that your system clocks are synchronized to avoid issues with lock expiration.</li><li><strong>Database Cleanup</strong>: Ensure that old or expired locks are cleaned up periodically.</li><li><strong>Optimizing Lock Duration</strong>: Properly define <code>lockAtMostFor</code> and <code>lockAtLeastFor</code> to strike a balance between preventing task re-execution and ensuring locks are released in case of task failures.</li></ul>



<h4 class="wp-block-heading">6. <strong>Conclusion</strong></h4>



<p>Integrating ShedLock with MongoDB ensures that your scheduled tasks run safely and only once across multiple instances of your application. With simple setup and configuration, ShedLock can prevent duplicate task executions, making it a valuable tool for distributed Spring Boot applications.</p>
<div class="simplesocialbuttons simplesocial-simple-icons simplesocialbuttons_inline simplesocialbuttons-align-left post-370 post  simplesocialbuttons-inline-no-animation">
		<button class="ssb_fbshare-icon"  rel="nofollow"  target="_blank"  aria-label="Facebook Share" data-href="https://www.facebook.com/sharer/sharer.php?u=https://www.techdasher.com/implementing-distributed-task-scheduling-in-spring-boot-using-shedlock-and-mongodb/" onClick="javascript:window.open(this.dataset.href, '', 'menubar=no,toolbar=no,resizable=yes,scrollbars=yes,height=600,width=600');return false;">
						<span class="icon"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" class="_1pbq" color="#ffffff"><path fill="#ffffff" fill-rule="evenodd" class="icon" d="M8 14H3.667C2.733 13.9 2 13.167 2 12.233V3.667A1.65 1.65 0 0 1 3.667 2h8.666A1.65 1.65 0 0 1 14 3.667v8.566c0 .934-.733 1.667-1.667 1.767H10v-3.967h1.3l.7-2.066h-2V6.933c0-.466.167-.9.867-.9H12v-1.8c.033 0-.933-.266-1.533-.266-1.267 0-2.434.7-2.467 2.133v1.867H6v2.066h2V14z"></path></svg></span>
						<span class="simplesocialtxt">Share </span> </button>
<button class="ssb_tweet-icon"  rel="nofollow"  target="_blank"  aria-label="Twitter Share" data-href="https://twitter.com/intent/tweet?text=Implementing+Distributed+Task+Scheduling+in+Spring+Boot+Using+ShedLock+and+MongoDB&url=https://www.techdasher.com/implementing-distributed-task-scheduling-in-spring-boot-using-shedlock-and-mongodb/&via=tech_dasher" onClick="javascript:window.open(this.dataset.href, '', 'menubar=no,toolbar=no,resizable=yes,scrollbars=yes,height=600,width=600');return false;">
						<span class="icon"><svg viewBox="0 0 16 14" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M4.9 0H0L5.782 7.7098L0.315 14H2.17L6.6416 8.8557L10.5 14H15.4L9.3744 5.9654L14.56 0H12.705L8.5148 4.8202L4.9 0ZM11.2 12.6L2.8 1.4H4.2L12.6 12.6H11.2Z" fill="#fff"/></svg></span><i class="simplesocialtxt">Post </i></button>
<button class="ssb_linkedin-icon"  rel="nofollow"  target="_blank"  aria-label="LinkedIn Share" data-href="https://www.linkedin.com/sharing/share-offsite/?url=https://www.techdasher.com/implementing-distributed-task-scheduling-in-spring-boot-using-shedlock-and-mongodb/" onClick="javascript:window.open(this.dataset.href, '', 'menubar=no,toolbar=no,resizable=yes,scrollbars=yes,height=600,width=600');return false;" >
						<span class="icon"> <svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" width="15px" height="14.1px" viewBox="-301.4 387.5 15 14.1" enable-background="new -301.4 387.5 15 14.1" xml:space="preserve"> <g id="XMLID_398_"> <path id="XMLID_399_" fill="#FFFFFF" d="M-296.2,401.6c0-3.2,0-6.3,0-9.5h0.1c1,0,2,0,2.9,0c0.1,0,0.1,0,0.1,0.1c0,0.4,0,0.8,0,1.2 c0.1-0.1,0.2-0.3,0.3-0.4c0.5-0.7,1.2-1,2.1-1.1c0.8-0.1,1.5,0,2.2,0.3c0.7,0.4,1.2,0.8,1.5,1.4c0.4,0.8,0.6,1.7,0.6,2.5 c0,1.8,0,3.6,0,5.4v0.1c-1.1,0-2.1,0-3.2,0c0-0.1,0-0.1,0-0.2c0-1.6,0-3.2,0-4.8c0-0.4,0-0.8-0.2-1.2c-0.2-0.7-0.8-1-1.6-1 c-0.8,0.1-1.3,0.5-1.6,1.2c-0.1,0.2-0.1,0.5-0.1,0.8c0,1.7,0,3.4,0,5.1c0,0.2,0,0.2-0.2,0.2c-1,0-1.9,0-2.9,0 C-296.1,401.6-296.2,401.6-296.2,401.6z"/> <path id="XMLID_400_" fill="#FFFFFF" d="M-298,401.6L-298,401.6c-1.1,0-2.1,0-3,0c-0.1,0-0.1,0-0.1-0.1c0-3.1,0-6.1,0-9.2 c0-0.1,0-0.1,0.1-0.1c1,0,2,0,2.9,0h0.1C-298,395.3-298,398.5-298,401.6z"/> <path id="XMLID_401_" fill="#FFFFFF" d="M-299.6,390.9c-0.7-0.1-1.2-0.3-1.6-0.8c-0.5-0.8-0.2-2.1,1-2.4c0.6-0.2,1.2-0.1,1.8,0.2 c0.5,0.4,0.7,0.9,0.6,1.5c-0.1,0.7-0.5,1.1-1.1,1.3C-299.1,390.8-299.4,390.8-299.6,390.9L-299.6,390.9z"/> </g> </svg> </span>
						<span class="simplesocialtxt">Share</span> </button>
<div class="fb-like ssb-fb-like" aria-label="Facebook Like" data-href="https://www.techdasher.com/implementing-distributed-task-scheduling-in-spring-boot-using-shedlock-and-mongodb/" data-layout="button_count" data-action="like" data-size="small" data-show-faces="false" data-share="false"></div>
</div>
<p>The post <a href="https://www.techdasher.com/implementing-distributed-task-scheduling-in-spring-boot-using-shedlock-and-mongodb/">Implementing Distributed Task Scheduling in Spring Boot Using ShedLock and MongoDB</a> appeared first on <a href="https://www.techdasher.com">TechDasher</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.techdasher.com/implementing-distributed-task-scheduling-in-spring-boot-using-shedlock-and-mongodb/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>How to Implement Auto-Increment Fields in MongoDB with Spring Boot</title>
		<link>https://www.techdasher.com/how-to-implement-auto-increment-fields-in-mongodb-with-spring-boot/</link>
					<comments>https://www.techdasher.com/how-to-implement-auto-increment-fields-in-mongodb-with-spring-boot/#respond</comments>
		
		<dc:creator><![CDATA[cserajee]]></dc:creator>
		<pubDate>Thu, 22 Aug 2024 05:10:18 +0000</pubDate>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[MongoDB]]></category>
		<category><![CDATA[Spring Boot]]></category>
		<category><![CDATA[Auto-Increment]]></category>
		<guid isPermaLink="false">https://www.techdasher.com/?p=359</guid>

					<description><![CDATA[<p>MongoDB, being a NoSQL database, does not have built-in support for auto-incrementing fields like traditional relational databases (e.g., MySQL) do with sequences or identity columns. However, you can still implement auto-increment functionality in MongoDB using a custom approach. In this blog post, we&#8217;ll walk through the process of creating an auto-incrementing sequence in MongoDB using [&#8230;]</p>
<p>The post <a href="https://www.techdasher.com/how-to-implement-auto-increment-fields-in-mongodb-with-spring-boot/">How to Implement Auto-Increment Fields in MongoDB with Spring Boot</a> appeared first on <a href="https://www.techdasher.com">TechDasher</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<p>MongoDB, being a NoSQL database, does not have built-in support for auto-incrementing fields like traditional relational databases (e.g., MySQL) do with sequences or identity columns. However, you can still implement auto-increment functionality in MongoDB using a custom approach. In this blog post, we’ll walk through the process of creating an auto-incrementing sequence in MongoDB using Spring Boot.</p>



<h3 class="wp-block-heading">Why Auto-Increment?</h3>



<p>Auto-increment fields are often used as unique identifiers for records in databases. While MongoDB typically uses ObjectId for unique identifiers, there might be cases where you need a sequential, human-readable ID (e.g., order numbers, invoice IDs). This is where custom auto-increment fields come in handy.</p>



<h2 class="wp-block-heading">Prerequisites</h2>



<p>To follow along, you should have a basic understanding of:</p>



<ul class="wp-block-list"><li>Spring Boot</li><li>MongoDB</li><li>Java</li></ul>



<h2 class="wp-block-heading">Step 1: Set Up the MongoDB Connection in Java</h2>



<p>First, you&#8217;ll need to connect to your MongoDB instance from your Java application. You can use the MongoDB Java Driver to handle the connection.</p>



<p>Add the following dependency to your <code>pom.xml</code> file:</p>



<pre class="wp-block-code"><code>&lt;dependencies>
    &lt;dependency>
        &lt;groupId>org.springframework.boot&lt;/groupId>
        &lt;artifactId>spring-boot-starter-data-mongodb&lt;/artifactId>
    &lt;/dependency>
&lt;/dependencies></code></pre>



<p> </p>



<h3 class="wp-block-heading"><strong>Step 1: Set Up the counter</strong>s <strong>Collection</strong></h3>



<p>MongoDB doesn’t have a built-in mechanism for auto-incrementing fields, but you can use a counters collection to achieve this. First, let’s define a counters document model:</p>



<pre class="wp-block-code"><code>import org.springframework.data.annotation.Id;
import org.springframework.data.mongodb.core.mapping.Document;
import lombok.Data;

@Data
@Document(collection = "database_counters")
public class DatabaseCounter {
    @Id
    private String id;
    private long counter
}</code></pre>



<p>Here, we’re using a <code>DatabaseCounter</code> collection to store our counters. The <code>id</code> field will represent the counter name, and the <code>counter</code>field will store the current counter number.</p>



<h3 class="wp-block-heading"><strong>Step 2: Create a Counter Generator Service</strong></h3>



<p>Next, create a service that will handle the incrementing logic:</p>



<pre class="wp-block-code"><code>import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.mongodb.core.MongoOperations;
import org.springframework.data.mongodb.core.query.Criteria;
import org.springframework.data.mongodb.core.query.Query;
import org.springframework.data.mongodb.core.query.Update;
import org.springframework.stereotype.Service;
import org.springframework.data.mongodb.core.FindAndModifyOptions;

@Service
public class CounterGeneratorService {

    @Autowired
    private MongoOperations mongoOperations;

    public long generateCounter(String counterName) {
        DatabaseCounter counter = mongoOperations.findAndModify(
                Query.query(Criteria.where("_id").is(counterName)),
                new Update().inc("counter", 1),
                FindAndModifyOptions.options().returnNew(true).upsert(true),
                DatabaseCounter.class);
        return counter != null ? counter.getCounter() : 1;
    }
}
</code></pre>



<p>This service defines a <code>generateCounter</code> method that takes the counter name as an argument, increments the counter value, and returns the new value. The <code>findAndModify</code> method is used to atomically update the counter in a thread-safe way.</p>



<h3 class="wp-block-heading"><strong>Step 3: Integrate the Auto-Increment in Your Model</strong></h3>



<p>With the counter generator in place, you can now integrate it into your data models. Suppose you have an <code>Employee</code> model where you want to add an auto-incrementing <code>id</code> field:</p>



<pre class="wp-block-code"><code>import org.springframework.data.annotation.Id;
import org.springframework.data.mongodb.core.mapping.Document;
import org.springframework.data.annotation.Transient;
import lombok.Data;

@Data
@Document(collection = "employees")
public class Employee {
    @Transient
    public static final String COUNTER_NAME = "employee_counter";

    @Id
    private long id;
    private String name;
 
}</code></pre>



<h3 class="wp-block-heading"><strong>Step 4: Test the Implementation</strong></h3>



<p>To ensure that your auto-incrementing field works as expected, create a simple controller to add new employees:</p>



<pre class="wp-block-code"><code>import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/employees")
public class EmployeeController {

    @Autowired
    private EmployeeRepository employeeRepository;

    @Autowired
    private CounterGeneratorService counterGeneratorService;

    @PostMapping
    public Employee createEmployee(@RequestBody Employee employee) {  
        employee.setId(counterGeneratorService.
                generateCounter(Employee.COUNTER_NAME));
        return employeeRepository.save(employee);
    }

    @GetMapping("/{id}")
    public Employee getEmployeeById(@PathVariable long id) {
        return employeeRepository.findById(id).orElse(null);
    }
}
</code></pre>



<p>Now, whenever you create a new employee, the <code>id</code> field will be auto-incremented.</p>



<h3 class="wp-block-heading"><strong>Conclusion</strong></h3>



<p>While MongoDB doesn’t provide built-in support for auto-incrementing fields like relational databases, it’s relatively straightforward to implement this feature using a counters collection and a counter generator service in Spring Boot. This approach gives you the flexibility to create unique identifiers across your collections, even in a distributed environment.</p>



<p>By following the steps outlined in this post, you can efficiently manage auto-incrementing fields in your MongoDB and Spring Boot applications. Happy coding!</p>
<div class="simplesocialbuttons simplesocial-simple-icons simplesocialbuttons_inline simplesocialbuttons-align-left post-359 post  simplesocialbuttons-inline-no-animation">
		<button class="ssb_fbshare-icon"  rel="nofollow"  target="_blank"  aria-label="Facebook Share" data-href="https://www.facebook.com/sharer/sharer.php?u=https://www.techdasher.com/how-to-implement-auto-increment-fields-in-mongodb-with-spring-boot/" onClick="javascript:window.open(this.dataset.href, '', 'menubar=no,toolbar=no,resizable=yes,scrollbars=yes,height=600,width=600');return false;">
						<span class="icon"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" class="_1pbq" color="#ffffff"><path fill="#ffffff" fill-rule="evenodd" class="icon" d="M8 14H3.667C2.733 13.9 2 13.167 2 12.233V3.667A1.65 1.65 0 0 1 3.667 2h8.666A1.65 1.65 0 0 1 14 3.667v8.566c0 .934-.733 1.667-1.667 1.767H10v-3.967h1.3l.7-2.066h-2V6.933c0-.466.167-.9.867-.9H12v-1.8c.033 0-.933-.266-1.533-.266-1.267 0-2.434.7-2.467 2.133v1.867H6v2.066h2V14z"></path></svg></span>
						<span class="simplesocialtxt">Share </span> </button>
<button class="ssb_tweet-icon"  rel="nofollow"  target="_blank"  aria-label="Twitter Share" data-href="https://twitter.com/intent/tweet?text=How+to+Implement+Auto-Increment+Fields+in+MongoDB+with+Spring+Boot&url=https://www.techdasher.com/how-to-implement-auto-increment-fields-in-mongodb-with-spring-boot/&via=tech_dasher" onClick="javascript:window.open(this.dataset.href, '', 'menubar=no,toolbar=no,resizable=yes,scrollbars=yes,height=600,width=600');return false;">
						<span class="icon"><svg viewBox="0 0 16 14" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M4.9 0H0L5.782 7.7098L0.315 14H2.17L6.6416 8.8557L10.5 14H15.4L9.3744 5.9654L14.56 0H12.705L8.5148 4.8202L4.9 0ZM11.2 12.6L2.8 1.4H4.2L12.6 12.6H11.2Z" fill="#fff"/></svg></span><i class="simplesocialtxt">Post </i></button>
<button class="ssb_linkedin-icon"  rel="nofollow"  target="_blank"  aria-label="LinkedIn Share" data-href="https://www.linkedin.com/sharing/share-offsite/?url=https://www.techdasher.com/how-to-implement-auto-increment-fields-in-mongodb-with-spring-boot/" onClick="javascript:window.open(this.dataset.href, '', 'menubar=no,toolbar=no,resizable=yes,scrollbars=yes,height=600,width=600');return false;" >
						<span class="icon"> <svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" width="15px" height="14.1px" viewBox="-301.4 387.5 15 14.1" enable-background="new -301.4 387.5 15 14.1" xml:space="preserve"> <g id="XMLID_398_"> <path id="XMLID_399_" fill="#FFFFFF" d="M-296.2,401.6c0-3.2,0-6.3,0-9.5h0.1c1,0,2,0,2.9,0c0.1,0,0.1,0,0.1,0.1c0,0.4,0,0.8,0,1.2 c0.1-0.1,0.2-0.3,0.3-0.4c0.5-0.7,1.2-1,2.1-1.1c0.8-0.1,1.5,0,2.2,0.3c0.7,0.4,1.2,0.8,1.5,1.4c0.4,0.8,0.6,1.7,0.6,2.5 c0,1.8,0,3.6,0,5.4v0.1c-1.1,0-2.1,0-3.2,0c0-0.1,0-0.1,0-0.2c0-1.6,0-3.2,0-4.8c0-0.4,0-0.8-0.2-1.2c-0.2-0.7-0.8-1-1.6-1 c-0.8,0.1-1.3,0.5-1.6,1.2c-0.1,0.2-0.1,0.5-0.1,0.8c0,1.7,0,3.4,0,5.1c0,0.2,0,0.2-0.2,0.2c-1,0-1.9,0-2.9,0 C-296.1,401.6-296.2,401.6-296.2,401.6z"/> <path id="XMLID_400_" fill="#FFFFFF" d="M-298,401.6L-298,401.6c-1.1,0-2.1,0-3,0c-0.1,0-0.1,0-0.1-0.1c0-3.1,0-6.1,0-9.2 c0-0.1,0-0.1,0.1-0.1c1,0,2,0,2.9,0h0.1C-298,395.3-298,398.5-298,401.6z"/> <path id="XMLID_401_" fill="#FFFFFF" d="M-299.6,390.9c-0.7-0.1-1.2-0.3-1.6-0.8c-0.5-0.8-0.2-2.1,1-2.4c0.6-0.2,1.2-0.1,1.8,0.2 c0.5,0.4,0.7,0.9,0.6,1.5c-0.1,0.7-0.5,1.1-1.1,1.3C-299.1,390.8-299.4,390.8-299.6,390.9L-299.6,390.9z"/> </g> </svg> </span>
						<span class="simplesocialtxt">Share</span> </button>
<div class="fb-like ssb-fb-like" aria-label="Facebook Like" data-href="https://www.techdasher.com/how-to-implement-auto-increment-fields-in-mongodb-with-spring-boot/" data-layout="button_count" data-action="like" data-size="small" data-show-faces="false" data-share="false"></div>
</div>
<p>The post <a href="https://www.techdasher.com/how-to-implement-auto-increment-fields-in-mongodb-with-spring-boot/">How to Implement Auto-Increment Fields in MongoDB with Spring Boot</a> appeared first on <a href="https://www.techdasher.com">TechDasher</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.techdasher.com/how-to-implement-auto-increment-fields-in-mongodb-with-spring-boot/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Restful Web Services</title>
		<link>https://www.techdasher.com/restful-web-services/</link>
					<comments>https://www.techdasher.com/restful-web-services/#respond</comments>
		
		<dc:creator><![CDATA[cserajee]]></dc:creator>
		<pubDate>Fri, 12 Mar 2021 10:11:06 +0000</pubDate>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[Web Services]]></category>
		<category><![CDATA[rest]]></category>
		<category><![CDATA[soap]]></category>
		<category><![CDATA[Webservices]]></category>
		<guid isPermaLink="false">https://www.techdasher.com/?p=345</guid>

					<description><![CDATA[<p>Restful Web Services&#160;is a lightweight, maintainable, and scalable service that is built on the REST architecture. Restful Web Service, expose API from your application in a secure, uniform, stateless manner to the calling client. The calling client can perform predefined operations using the Restful service. The underlying protocol for REST is HTTP. REST stands for [&#8230;]</p>
<p>The post <a href="https://www.techdasher.com/restful-web-services/">Restful Web Services</a> appeared first on <a href="https://www.techdasher.com">TechDasher</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<p><strong>Restful Web Services</strong> is a lightweight, maintainable, and scalable service that is built on the REST architecture. Restful Web Service, expose API from your application in a secure, uniform, stateless manner to the calling client. The calling client can perform predefined operations using the Restful service. The underlying protocol for REST is HTTP. REST stands for REpresentational State Transfer.</p>



<p>In this REST API tutorial, you will learn</p>



<ul class="wp-block-list"><li>Restful Architecture</li><li>RestFul Principles and Constraints</li><li>RESTful Key Elements</li><li>Restful Methods</li><li>Why Restful</li></ul>



<h2 class="wp-block-heading">Restful Architecture</h2>



<p>An application or architecture considered RESTful or REST-style has the following characteristics</p>



<p><strong>1. State and functionality are divided into distributed resources</strong> – This means that every resource should be accessible via the normal HTTP commands of GET, POST, PUT, or DELETE. So if someone wanted to get a file from a server, they should be able to issue the GET request and get the file. If they want to put a file on the server, they should be able to either issue the POST or PUT request. And finally, if they wanted to delete a file from the server, they can issue the DELETE request.</p>



<p><strong>2. The architecture is client/server, stateless, layered, and supports caching</strong></p>



<ul class="wp-block-list"><li>Client-server is the typical architecture where the server can be the web server hosting the application, and the client can be as simple as the web browser.</li><li>Stateless means that the state of the application is not maintained in REST. For example, if you delete a resource from a server using the DELETE command, you cannot expect that delete information to be passed to the next request.</li></ul>



<p>In order to ensure that the resource is deleted, you would need to issue the GET request. The GET request would be used to first get all the resources on the server. After which one would need to see if the resource was actually deleted.</p>



<h2 class="wp-block-heading">RESTFul Principles and Constraints</h2>



<p>The REST architecture is based on a few characteristics which are elaborated below. Any RESTful web service has to comply with the below characteristics in order for it to be called RESTful. These characteristics are also known as design principles which need to be followed when working with RESTful based services.</p>



<ul class="wp-block-list"><li>RESTFul Client-Server</li><li>Stateless</li><li>Cache</li><li>Layered System</li><li>Interface/Uniform Contract</li></ul>



<h4 class="wp-block-heading">1. <strong>RESTFul Client-Server</strong></h4>



<p>This is the most fundamental requirement of a REST based architecture. It means that the server will have a RESTful web service which would provide the required functionality to the client. The client send’s a request to the web service on the server. The server would either reject the request or comply and provide an adequate response to the client.</p>



<h4 class="wp-block-heading">2. <strong>Stateless</strong></h4>



<p>The concept of stateless means that it’s up to the client to ensure that all the required information is provided to the server. This is required so that server can process the response appropriately. The server should not maintain any sort of information between requests from the client. It’s a very simple independent question-answer sequence. The client asks a question, the server answers it appropriately. The client will ask another question. The server will not remember the previous question-answer scenario and will need to answer the new question independently.</p>



<h4 class="wp-block-heading">3. Cache</h4>



<p>The Cache concept is to help with the problem of stateless which was described in the last point. Since each server client request is independent in nature, sometimes the client might ask the server for the same request again. This is even though it had already asked for it in the past. This request will go to the server, and the server will give a response. This increases the traffic across the network. The cache is a concept implemented on the client to store requests which have already been sent to the server. So if the same request is given by the client, instead of going to the server, it would go to the cache and get the required information. This saves the amount of to and fro network traffic from the client to the server.</p>



<h4 class="wp-block-heading">4. <strong>Layered System</strong></h4>



<p>The concept of a layered system is that any additional layer such as a middleware layer can be inserted between the client and the actual server hosting the RESTFul web service (The middleware layer is where all the business logic is created. This can be an extra service created with which the client could interact with before it makes a call to the web service.). But the introduction of this layer needs to be transparent so that it does not disturb the interaction between the client and the server.</p>



<h4 class="wp-block-heading">5. <strong>Interface/Uniform Contract</strong></h4>



<p>This is the underlying technique of how RESTful web services should work. RESTful basically works on the HTTP web layer and uses the below key verbs to work with resources on the server</p>



<ul class="wp-block-list"><li>POST – To create a resource on the server</li><li>GET – To retrieve a resource from the server</li><li>PUT – To change the state of a resource or to update it</li><li>DELETE – To remove or delete a resource from the server</li></ul>



<h2 class="wp-block-heading">RESTful Key Elements</h2>



<p>REST Web services have really come a long way since its inception. In 2002, the Web consortium had released the definition of WSDL and SOAP web services. This formed the standard of how web services are implemented.</p>



<p>In 2004, the web consortium also released the definition of an additional standard called RESTful. Over the past couple of years, this standard has become quite popular. And is being used by many of the popular websites around the world which include Facebook and Twitter.</p>



<p>REST is a way to access resources that lie in a particular environment. For example, you could have a server that could be hosting important documents or pictures, or videos. All of these are an example of resources. If a client, say a web browser needs any of these resources, it has to send a request to the server to access these resources. Now REST services define a way on how these resources can be accessed.<br><br>The key elements of a RESTful implementation are as follows:</p>



<ol class="wp-block-list"><li><strong>Resources</strong> – The first key element is the resource itself. Let&#8217;s assume that a web application on a server has records of several employees. Let’s assume the URL of the web application is <strong>http://demo.<strong>techdasher</strong>.com</strong>. Now in order to access an employee record resource via REST services, one can issue the command <strong>http://demo.<strong>techdasher</strong>.com/employee/101</strong> – This command tells the webserver to please provide the details of the employee whose employee number is 101.</li><li><strong>Request Verbs</strong> – These describe what you want to do with the resource. A browser issues a GET verb to instruct the endpoint it wants to get data. However, there are many other verbs available including things like POST, PUT, and DELETE. So in the case of the example <strong>http://demo.<strong>techdasher</strong>.com/employee/101</strong> , the web browser is actually issuing a GET Verb because it wants to get the details of the employee record.</li><li><strong>Request Headers</strong> – These are additional instructions sent with the request. These might define the type of response required or the authorization details.</li><li><strong>Request Body</strong> – Data is sent with the request. Data is normally sent in the request when a POST request is made to the REST web services. In a POST call, the client actually tells the REST web services that it wants to add a resource to the server. Hence, the request body would have the details of the resource which is required to be added to the server.</li><li><strong>Response Body</strong> – This is the main body of the response. So in our RESTful API example, if we were to query the web server via the request <strong>http://demo.techdasher.com/employee/101</strong> , the web server might return an XML document with all the details of the employee in the Response Body.</li><li><strong>Response Status codes</strong> – These codes are the general codes which are returned along with the response from the web server. An example is the code 200 which is normally returned if there is no error when returning a response to the client.</li></ol>



<h2 class="wp-block-heading">Restful Methods</h2>



<p>The below diagram shows mostly all the verbs (POST, GET, PUT, and DELETE) and a REST API example of what they would mean.</p>



<p>Let’s assume that we have a RESTful web service is defined at the location. <strong>http://demo.<strong>techdasher</strong>.com/employee</strong> . When the client makes any request to this web service, it can specify any of the normal HTTP verbs of GET, POST, DELETE and PUT. Below is what would happen If the respective verbs were sent by the client.</p>



<ol class="wp-block-list"><li><strong>POST</strong> – This would be used to create a new employee using the RESTful web service</li><li><strong>GET</strong> – This would be used to get a list of all employees using the RESTful web service</li><li>PUT – This would be used to update all employees using the RESTful web service</li><li>DELETE – This would be used to delete all employees using the RESTful services</li></ol>



<p>Let’s take a look from a perspective of just a single record. Let’s say there was an employee record with the employee number of 101.<br><br>The following actions would have their respective meanings.</p>



<ol class="wp-block-list"><li><strong>POST</strong> – This would not be applicable since we are fetching data of employee 101 which is already created.</li><li><strong>GET</strong> – This would be used to get the details of the employee with Employee no as 101 using the RESTful web service</li><li><strong>PUT</strong> – This would be used to update the details of the employee with Employee no as 101 using the RESTful web service</li><li><strong>DELETE</strong> – This is used to delete the details of the employee with Employee no as 101</li></ol>



<h2 class="wp-block-heading">Why Restful</h2>



<p>Restful mostly came into popularity due to the following reasons:</p>



<p><strong>1. Heterogeneous languages and environments</strong> – This is one of the fundamental reasons which is the same as we have seen for SOAP as well.</p>



<ul class="wp-block-list"><li>It enables web applications that are built on various programming languages to communicate with each other</li><li>With the help of Restful services, these web applications can reside on different environments, some could be on Windows, and others could be on Linux.</li></ul>



<p>But in the end, no matter what the environment is, the end result should always be the same that they should be able to talk to each other. Restful web services offer this flexibility to applications built on various programming languages and platforms to talk to each other.</p>



<p>The below picture gives an example of a web application which has a requirement to talk to other applications such Facebook, Twitter, and Google.</p>



<p>Now if a client application had to work with sites such as Facebook, Twitter, etc. they would probably have to know what is the language Facebook, Google and Twitter are built on, and also on what platform they are built on.</p>



<p>Based on this, we can write the interfacing code for our web application, but this could prove to be a nightmare.</p>



<p>Facebook, Twitter, and Google expose their functionality in the form of Restful web services. This allows any client application to call these web services via REST.</p>



<p><strong>2. The event of Devices</strong> – Nowadays, everything needs to work on Mobile devices, whether it be the mobile device, the notebooks, or even car systems.</p>



<p>Can you imagine the amount of effort to try and code applications on these devices to talk with normal web applications? Again Restful API’s can make this job simpler because as mentioned in point no 1, you really don’t need to know what is the underlying layer for the device.</p>



<p><strong>3. Finally is the event of the Cloud</strong> – Everything is moving to the cloud. Applications are slowly moving to cloud-based systems such as in Azure or Amazon. Azure and Amazon provide a lot of API’s based on the Restful architecture. Hence, applications now need to be developed in such a way that they are made compatible with the Cloud. So since all Cloud-based architectures work on the REST principle, it makes more sense for web services to be programmed on the REST services based architecture to make the best use of Cloud-based services.</p>
<div class="simplesocialbuttons simplesocial-simple-icons simplesocialbuttons_inline simplesocialbuttons-align-left post-345 post  simplesocialbuttons-inline-no-animation">
		<button class="ssb_fbshare-icon"  rel="nofollow"  target="_blank"  aria-label="Facebook Share" data-href="https://www.facebook.com/sharer/sharer.php?u=https://www.techdasher.com/restful-web-services/" onClick="javascript:window.open(this.dataset.href, '', 'menubar=no,toolbar=no,resizable=yes,scrollbars=yes,height=600,width=600');return false;">
						<span class="icon"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" class="_1pbq" color="#ffffff"><path fill="#ffffff" fill-rule="evenodd" class="icon" d="M8 14H3.667C2.733 13.9 2 13.167 2 12.233V3.667A1.65 1.65 0 0 1 3.667 2h8.666A1.65 1.65 0 0 1 14 3.667v8.566c0 .934-.733 1.667-1.667 1.767H10v-3.967h1.3l.7-2.066h-2V6.933c0-.466.167-.9.867-.9H12v-1.8c.033 0-.933-.266-1.533-.266-1.267 0-2.434.7-2.467 2.133v1.867H6v2.066h2V14z"></path></svg></span>
						<span class="simplesocialtxt">Share </span> </button>
<button class="ssb_tweet-icon"  rel="nofollow"  target="_blank"  aria-label="Twitter Share" data-href="https://twitter.com/intent/tweet?text=Restful+Web+Services&url=https://www.techdasher.com/restful-web-services/&via=tech_dasher" onClick="javascript:window.open(this.dataset.href, '', 'menubar=no,toolbar=no,resizable=yes,scrollbars=yes,height=600,width=600');return false;">
						<span class="icon"><svg viewBox="0 0 16 14" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M4.9 0H0L5.782 7.7098L0.315 14H2.17L6.6416 8.8557L10.5 14H15.4L9.3744 5.9654L14.56 0H12.705L8.5148 4.8202L4.9 0ZM11.2 12.6L2.8 1.4H4.2L12.6 12.6H11.2Z" fill="#fff"/></svg></span><i class="simplesocialtxt">Post </i></button>
<button class="ssb_linkedin-icon"  rel="nofollow"  target="_blank"  aria-label="LinkedIn Share" data-href="https://www.linkedin.com/sharing/share-offsite/?url=https://www.techdasher.com/restful-web-services/" onClick="javascript:window.open(this.dataset.href, '', 'menubar=no,toolbar=no,resizable=yes,scrollbars=yes,height=600,width=600');return false;" >
						<span class="icon"> <svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" width="15px" height="14.1px" viewBox="-301.4 387.5 15 14.1" enable-background="new -301.4 387.5 15 14.1" xml:space="preserve"> <g id="XMLID_398_"> <path id="XMLID_399_" fill="#FFFFFF" d="M-296.2,401.6c0-3.2,0-6.3,0-9.5h0.1c1,0,2,0,2.9,0c0.1,0,0.1,0,0.1,0.1c0,0.4,0,0.8,0,1.2 c0.1-0.1,0.2-0.3,0.3-0.4c0.5-0.7,1.2-1,2.1-1.1c0.8-0.1,1.5,0,2.2,0.3c0.7,0.4,1.2,0.8,1.5,1.4c0.4,0.8,0.6,1.7,0.6,2.5 c0,1.8,0,3.6,0,5.4v0.1c-1.1,0-2.1,0-3.2,0c0-0.1,0-0.1,0-0.2c0-1.6,0-3.2,0-4.8c0-0.4,0-0.8-0.2-1.2c-0.2-0.7-0.8-1-1.6-1 c-0.8,0.1-1.3,0.5-1.6,1.2c-0.1,0.2-0.1,0.5-0.1,0.8c0,1.7,0,3.4,0,5.1c0,0.2,0,0.2-0.2,0.2c-1,0-1.9,0-2.9,0 C-296.1,401.6-296.2,401.6-296.2,401.6z"/> <path id="XMLID_400_" fill="#FFFFFF" d="M-298,401.6L-298,401.6c-1.1,0-2.1,0-3,0c-0.1,0-0.1,0-0.1-0.1c0-3.1,0-6.1,0-9.2 c0-0.1,0-0.1,0.1-0.1c1,0,2,0,2.9,0h0.1C-298,395.3-298,398.5-298,401.6z"/> <path id="XMLID_401_" fill="#FFFFFF" d="M-299.6,390.9c-0.7-0.1-1.2-0.3-1.6-0.8c-0.5-0.8-0.2-2.1,1-2.4c0.6-0.2,1.2-0.1,1.8,0.2 c0.5,0.4,0.7,0.9,0.6,1.5c-0.1,0.7-0.5,1.1-1.1,1.3C-299.1,390.8-299.4,390.8-299.6,390.9L-299.6,390.9z"/> </g> </svg> </span>
						<span class="simplesocialtxt">Share</span> </button>
<div class="fb-like ssb-fb-like" aria-label="Facebook Like" data-href="https://www.techdasher.com/restful-web-services/" data-layout="button_count" data-action="like" data-size="small" data-show-faces="false" data-share="false"></div>
</div>
<p>The post <a href="https://www.techdasher.com/restful-web-services/">Restful Web Services</a> appeared first on <a href="https://www.techdasher.com">TechDasher</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.techdasher.com/restful-web-services/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Soap Web Services</title>
		<link>https://www.techdasher.com/soap-web-services/</link>
					<comments>https://www.techdasher.com/soap-web-services/#respond</comments>
		
		<dc:creator><![CDATA[cserajee]]></dc:creator>
		<pubDate>Wed, 10 Mar 2021 13:47:36 +0000</pubDate>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[soap]]></category>
		<category><![CDATA[webservice]]></category>
		<guid isPermaLink="false">https://www.techdasher.com/?p=338</guid>

					<description><![CDATA[<p>SOAP is known as the Simple Object Access Protocol, but in later times was just shortened to SOAP v1.2. SOAP is a protocol or in other words, is a definition of how web services talk to each other or talk to client applications that invoke them. SOAP is an XML-based protocol for accessing web services [&#8230;]</p>
<p>The post <a href="https://www.techdasher.com/soap-web-services/">Soap Web Services</a> appeared first on <a href="https://www.techdasher.com">TechDasher</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<p>SOAP is known as the Simple Object Access Protocol, but in later times was just shortened to SOAP v1.2. SOAP is a protocol or in other words, is a definition of how web services talk to each other or talk to client applications that invoke them.</p>



<p>SOAP is an XML-based protocol for accessing web services over HTTP. It has some specifications that could be used across all applications.</p>



<p>SOAP was developed as an intermediate language so that applications built on various programming languages could talk easily to each other and avoid the extreme development effort.</p>



<p>In this tutorial, you will learn &#8211;</p>



<div class="wp-block-group"><div class="wp-block-group__inner-container is-layout-flow wp-block-group-is-layout-flow">
<ul class="wp-block-list"><li>SOAP Introduction</li><li>SOAP Building blocks</li><li>SOAP Message Structure</li><li>SOAP Envelope Element</li><li>SOAP Communication Model</li><li>Practical SOAP Example</li><li>Advantages of SOAP</li></ul>



<h2 class="wp-block-heading">SOAP Introduction</h2>



<p>In today’s world, there is a huge number of applications that are built on different programming languages. For example, there could be a web application designed in Java, another in .Net, and another in PHP.</p>



<p>Exchanging data between applications is crucial in today’s networked world. But data exchange between these heterogeneous applications would be complex. So will be the complexity of the code to accomplish this data exchange.</p>
</div></div>



<p>One of the methods used to combat this complexity is to use XML (Extensible Markup Language) as the intermediate language for exchanging data between applications.</p>



<p>Every programming language can understand the XML markup language. Hence, XML was used as the underlying medium for data exchange.</p>



<p>But there are no standard specifications on use of XML across all programming languages for data exchange. That is where SOAP software comes in.</p>



<p>SOAP was designed to work with XML over HTTP and have some sort of specification which could be used across all applications. We will look into further details on the SOAP protocol in the subsequent chapters.</p>



<h2 class="wp-block-heading">SOAP Building Blocks</h2>



<p>The SOAP specification defines something known as a “<strong>SOAP message</strong>” which is what is sent to the web service and the client application.</p>



<p>The below diagram of SOAP architecture shows the various building blocks of a SOAP Message.</p>



<figure class="wp-block-image size-large"><img fetchpriority="high" decoding="async" width="491" height="393" src="https://www.techdasher.com/wp-content/uploads/2022/06/soap_block.png" alt="" class="wp-image-339"/></figure>



<p>The SOAP message is nothing but a mere XML document which has the below components.</p>



<ul class="wp-block-list"><li>An Envelope element that identifies the XML document as a SOAP message – This is the containing part of the SOAP message and is used to encapsulate all the details in the SOAP message. This is the root element in the SOAP message.</li><li>A Header element that contains header information – The header element can contain information such as authentication credentials which can be used by the calling application. It can also contain the definition of complex types which could be used in the SOAP message. By default, the SOAP message can contain parameters that could be of simple types such as strings and numbers, but can also be a complex object types.</li></ul>



<p>A simple SOAP service example of a complex type is shown below.</p>



<p>Suppose we wanted to send a structured data type that had a combination of a “Sample Name” and a “Sample Description,” then we would define the complex type as shown below.</p>



<p>The complex type is defined by the element tag &lt;xsd:complexType&gt;. All of the required elements of the structure along with their respective data types are then defined in the complex type collection.</p>



<pre class="wp-block-code"><code>&lt;xsd:complexType>     
 &lt;xsd:sequence>       
 	&lt;xsd:element name="Name" type="string"/>         
  	&lt;xsd:element name="Description"  type="string"/>
  &lt;/xsd:sequence>
&lt;/xsd:complexType></code></pre>



<p>A Body element that contains call and response information – This element is what contains the actual data which needs to be sent between the web service and the calling application. Below is an SOAP web service example of the SOAP body which actually works on the complex type defined in the header section. Here is the response of the Name and Description that is sent to the calling application which calls this web service.</p>



<pre class="wp-block-code"><code>&lt;soap:Body>
   &lt;GetInfo>
		&lt;Name>Web Services&lt;/Name> 
		&lt;Description>All about web services&lt;/Description> 
   &lt;/GetInfo>
&lt;/soap:Body></code></pre>



<h2 class="wp-block-heading">SOAP Message Structure</h2>



<p>One thing to note is that SOAP messages are normally auto-generated by the web service when it is called.</p>



<p>Whenever a client application calls a method in the web service, the web service will automatically generate a SOAP message which will have the necessary details of the data which will be sent from the web service to the client application.</p>



<p>As discussed in the previous topic of this SOAP tutorial, a simple SOAP Message has the following elements –</p>



<ul class="wp-block-list"><li>The Envelope element</li><li>The header element and</li><li>The body element</li><li>The Fault element (Optional)</li></ul>



<p>Let’s look at an example below of a simple SOAP message and see what element actually does.</p>



<figure class="wp-block-image size-large"><img decoding="async" width="934" height="425" src="https://www.techdasher.com/wp-content/uploads/2022/06/soap_message.png" alt="" class="wp-image-340" srcset="https://www.techdasher.com/wp-content/uploads/2022/06/soap_message.png 934w, https://www.techdasher.com/wp-content/uploads/2022/06/soap_message-768x349.png 768w" sizes="(max-width: 934px) 100vw, 934px" /></figure>



<ol class="wp-block-list"><li>As seen from the above SOAP message, the first part of the SOAP message is the envelope element which is used to encapsulate the entire SOAP message.</li><li>The next element is the SOAP body which contains the details of the actual message.</li><li>Our message contains a web service which has the name of “SampleWebService”.</li><li>The “SampleWebservice” accepts a parameter of the type ‘int’ and has the name of ID.</li></ol>



<p>Now, the above SOAP message will be passed between the web service and the client application.</p>



<p>You can see how useful the above information is to the client application. The SOAP message tells the client application what is the name of the Web service, and also what parameters it expects and also what is the type of each parameter which is taken by the web service.</p>



<h2 class="wp-block-heading">SOAP Envelope Element</h2>



<p>The first bit of the building block is the SOAP Envelope.</p>



<p>The SOAP Envelope is used to encapsulate all of the necessary details of the SOAP messages, which are exchanged between the web service and the client application.</p>



<p>The SOAP envelope element is used to indicate the beginning and end of a SOAP message. This enables the client application which calls the web service to know when the SOAP message ends.</p>



<p>The following points can be noted on the SOAP envelope element.</p>



<ul class="wp-block-list"><li>Every SOAP message needs to have a root Envelope element. It is absolutely mandatory for SOAP message to have an envelope element.</li><li>Every Envelope element needs to have at least one soap body element.</li><li>If an Envelope element contains a header element, it must contain no more than one, and it must appear as the first child of the Envelope, before the body element.</li><li>The envelope changes when SOAP versions change.</li><li>A v1.1-compliant SOAP processor generates a fault upon receiving a message containing the v1.2 envelope namespace.</li><li>A v1.2-compliant SOAP processor generates a Version Mismatch fault if it receives a message that does not include the v1.2 envelope namespace.</li></ul>



<p>Below is an SOAP API example of version 1.2 of the SOAP envelope element.</p>



<pre class="wp-block-code"><code>&lt;?xml version="1.0"?>
&lt;SOAP-ENV:Envelope xmlns:SOAP-ENV="http://www.w3.org/2001/12/soap-envelope" SOAP-ENV:encodingStyle=" http://www.w3.org/2001/12/soap-encoding">
          &lt;soap:Body>
        &lt;SampleWebService xmlns="http://tempuri.org/">
                  &lt;ID>int&lt;/ID>
                &lt;/SampleWebService>
          &lt;/soap:Body>
&lt;/SOAP-ENV:Envelope></code></pre>



<p><strong>The Fault message</strong></p>



<p>When a request is made to a SOAP web service, the response returned can be of either 2 forms which are a successful response or an error response. When success is generated, the response from the server will always be a SOAP message. But if SOAP faults are generated, they are returned as “HTTP 500” errors.</p>



<p>The SOAP Fault message consists of the following elements.</p>



<ol class="wp-block-list"><li><strong>&lt;faultCode&gt;</strong>– This is the code that designates the code of the error. The fault code can be either of any below values<ol><li>SOAP-ENV:VersionMismatch – This is when an invalid namespace for the SOAP Envelope element is encountered.</li><li>SOAP-ENV:MustUnderstand – An immediate child element of the Header element, with the mustUnderstand attribute set to “1”, was not understood.</li><li>SOAP-ENV:Client – The message was incorrectly formed or contained incorrect information.</li><li>SOAP-ENV:Server – There was a problem with the server, so the message could not proceed.</li></ol></li><li><strong>&lt;faultString&gt;</strong> – This is the text message which gives a detailed description of the error.</li><li><strong>&lt;faultActor&gt; (Optional)</strong>– This is a text string which indicates who caused the fault.</li><li><strong>&lt;detail&gt;(Optional)</strong> – This is the element for application-specific error messages. So the application could have a specific error message for different business logic scenarios.</li></ol>



<p><strong>Example for Fault Message</strong></p>



<p>An example of a fault message is given below. The error is generated if the scenario wherein the client tries to use a method called ID in the class GetInfo.</p>



<p>The below fault message gets generated in the event that the method does not exist in the defined class.</p>



<pre class="wp-block-code"><code>&lt;?xml version='1.0' encoding='UTF-8'?>
&lt;SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance" xmlns:xsd="http://www.w3.org/1999/XMLSchema">
      &lt;SOAP-ENV:Body>
         &lt;SOAP-ENV:Fault>
         &lt;faultcode xsi:type="xsd:string">SOAP-ENV:Client&lt;/faultcode>
        &lt;faultstring xsi:type="xsd:string">
            Failed to locate method (GetInfoID) in class (GetInfo)
         &lt;/faultstring>
    &lt;/SOAP-ENV:Fault>
   &lt;/SOAP-ENV:Body>
&lt;/SOAP-ENV:Envelope></code></pre>



<p><strong>Output:</strong></p>



<p>When you execute the above code, it will show the error like “Failed to locate method (GetInfoID) in class (GetInfo)”</p>



<h2 class="wp-block-heading">SOAP Communication Model</h2>



<p>All communication by SOAP is done via the HTTP protocol. Prior to SOAP, a lot of web services used the standard RPC (Remote Procedure Call) style for communication. This was the simplest type of communication, but it had a lot of limitations.</p>



<p>Now in this SOAP API tutorial, let’s consider the below diagram to see how this communication works. In this example, let’s assume the server hosts a web service which provided 2 methods as</p>



<ul class="wp-block-list"><li><strong>GetStudent</strong> – This would get all Student details</li><li><strong>SetSTudent</strong> – This would set the value of the details like student&#8217;s course, year, batch, etc. accordingly.</li></ul>



<p>In the normal RPC style communication, the client would just call the methods in its request and send the required parameters to the server, and the server would then send the desired response.</p>



<figure class="wp-block-image size-large"><img decoding="async" width="639" height="173" src="https://www.techdasher.com/wp-content/uploads/2022/06/soap_comm_model.png" alt="" class="wp-image-341"/></figure>



<p>The above communication model has the below serious limitations</p>



<ol class="wp-block-list"><li><strong>Not Language Independent</strong> – The server hosting the methods would be in a particular programming language and normally the calls to the server would be in that programming language only.</li><li><strong>Not the standard protocol </strong>– When a call is made to the remote procedure, the call is not carried out via the standard protocol. This was an issue since mostly all communication over the web had to be done via the HTTP protocol.</li><li><strong>Firewalls </strong>– Since RPC calls do not go via the normal protocol, separate ports need to be open on the server to allow the client to communicate with the server. Normally all firewalls would block this sort of traffic, and a lot of configuration was generally required to ensure that this sort of communication between the client and the server would work.</li></ol>



<p>To overcome all of the limitations cited above, SOAP would then use the below communication model</p>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="656" height="174" src="https://www.techdasher.com/wp-content/uploads/2022/06/Marshalling_Demarshalling.png" alt="" class="wp-image-342"/></figure>



<ol class="wp-block-list"><li>The client would format the information regarding the procedure call and any arguments into a SOAP message and sends it to the server as part of an HTTP request. This process of encapsulating the data into a SOAP message was known as <strong>Marshalling.</strong></li><li>The server would then unwrap the message sent by the client, see what the client requested for and then send the appropriate response back to the client as a SOAP message. The practice of unwrapping a request sent by the client is known as <strong>Demarshalling.</strong></li></ol>



<h2 class="wp-block-heading">Advantages of SOAP</h2>



<p>SOAP is the protocol used for data interchange between applications. Below are some of the reasons as to why SOAP is used.<br></p>



<ul class="wp-block-list"><li>When developing SOAP based Web services, you need to have some of language which can be used for web services to talk with client applications. SOAP is the perfect medium which was developed in order to achieve this purpose. This protocol is also recommended by the W3C consortium which is the governing body for all web standards.</li><li>SOAP is a light-weight protocol that is used for data interchange between applications. Note the keyword ‘<strong>light</strong>.’ Since SOAP programming is based on the XML language, which itself is a light weight data interchange language, hence SOAP as a protocol that also falls in the same category.</li><li>SOAP is designed to be platform independent and is also designed to be operating system independent. So the SOAP protocol can work any programming language based applications on both Windows and Linux platforms.</li><li>It works on the HTTP protocol –SOAP works on the HTTP protocol, which is the default protocol used by all web applications. Hence, there is no sort of customization which is required to run the web services built on the SOAP protocol to work on the World Wide Web.</li></ul>
<div class="simplesocialbuttons simplesocial-simple-icons simplesocialbuttons_inline simplesocialbuttons-align-left post-338 post  simplesocialbuttons-inline-no-animation">
		<button class="ssb_fbshare-icon"  rel="nofollow"  target="_blank"  aria-label="Facebook Share" data-href="https://www.facebook.com/sharer/sharer.php?u=https://www.techdasher.com/soap-web-services/" onClick="javascript:window.open(this.dataset.href, '', 'menubar=no,toolbar=no,resizable=yes,scrollbars=yes,height=600,width=600');return false;">
						<span class="icon"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" class="_1pbq" color="#ffffff"><path fill="#ffffff" fill-rule="evenodd" class="icon" d="M8 14H3.667C2.733 13.9 2 13.167 2 12.233V3.667A1.65 1.65 0 0 1 3.667 2h8.666A1.65 1.65 0 0 1 14 3.667v8.566c0 .934-.733 1.667-1.667 1.767H10v-3.967h1.3l.7-2.066h-2V6.933c0-.466.167-.9.867-.9H12v-1.8c.033 0-.933-.266-1.533-.266-1.267 0-2.434.7-2.467 2.133v1.867H6v2.066h2V14z"></path></svg></span>
						<span class="simplesocialtxt">Share </span> </button>
<button class="ssb_tweet-icon"  rel="nofollow"  target="_blank"  aria-label="Twitter Share" data-href="https://twitter.com/intent/tweet?text=Soap+Web+Services&url=https://www.techdasher.com/soap-web-services/&via=tech_dasher" onClick="javascript:window.open(this.dataset.href, '', 'menubar=no,toolbar=no,resizable=yes,scrollbars=yes,height=600,width=600');return false;">
						<span class="icon"><svg viewBox="0 0 16 14" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M4.9 0H0L5.782 7.7098L0.315 14H2.17L6.6416 8.8557L10.5 14H15.4L9.3744 5.9654L14.56 0H12.705L8.5148 4.8202L4.9 0ZM11.2 12.6L2.8 1.4H4.2L12.6 12.6H11.2Z" fill="#fff"/></svg></span><i class="simplesocialtxt">Post </i></button>
<button class="ssb_linkedin-icon"  rel="nofollow"  target="_blank"  aria-label="LinkedIn Share" data-href="https://www.linkedin.com/sharing/share-offsite/?url=https://www.techdasher.com/soap-web-services/" onClick="javascript:window.open(this.dataset.href, '', 'menubar=no,toolbar=no,resizable=yes,scrollbars=yes,height=600,width=600');return false;" >
						<span class="icon"> <svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" width="15px" height="14.1px" viewBox="-301.4 387.5 15 14.1" enable-background="new -301.4 387.5 15 14.1" xml:space="preserve"> <g id="XMLID_398_"> <path id="XMLID_399_" fill="#FFFFFF" d="M-296.2,401.6c0-3.2,0-6.3,0-9.5h0.1c1,0,2,0,2.9,0c0.1,0,0.1,0,0.1,0.1c0,0.4,0,0.8,0,1.2 c0.1-0.1,0.2-0.3,0.3-0.4c0.5-0.7,1.2-1,2.1-1.1c0.8-0.1,1.5,0,2.2,0.3c0.7,0.4,1.2,0.8,1.5,1.4c0.4,0.8,0.6,1.7,0.6,2.5 c0,1.8,0,3.6,0,5.4v0.1c-1.1,0-2.1,0-3.2,0c0-0.1,0-0.1,0-0.2c0-1.6,0-3.2,0-4.8c0-0.4,0-0.8-0.2-1.2c-0.2-0.7-0.8-1-1.6-1 c-0.8,0.1-1.3,0.5-1.6,1.2c-0.1,0.2-0.1,0.5-0.1,0.8c0,1.7,0,3.4,0,5.1c0,0.2,0,0.2-0.2,0.2c-1,0-1.9,0-2.9,0 C-296.1,401.6-296.2,401.6-296.2,401.6z"/> <path id="XMLID_400_" fill="#FFFFFF" d="M-298,401.6L-298,401.6c-1.1,0-2.1,0-3,0c-0.1,0-0.1,0-0.1-0.1c0-3.1,0-6.1,0-9.2 c0-0.1,0-0.1,0.1-0.1c1,0,2,0,2.9,0h0.1C-298,395.3-298,398.5-298,401.6z"/> <path id="XMLID_401_" fill="#FFFFFF" d="M-299.6,390.9c-0.7-0.1-1.2-0.3-1.6-0.8c-0.5-0.8-0.2-2.1,1-2.4c0.6-0.2,1.2-0.1,1.8,0.2 c0.5,0.4,0.7,0.9,0.6,1.5c-0.1,0.7-0.5,1.1-1.1,1.3C-299.1,390.8-299.4,390.8-299.6,390.9L-299.6,390.9z"/> </g> </svg> </span>
						<span class="simplesocialtxt">Share</span> </button>
<div class="fb-like ssb-fb-like" aria-label="Facebook Like" data-href="https://www.techdasher.com/soap-web-services/" data-layout="button_count" data-action="like" data-size="small" data-show-faces="false" data-share="false"></div>
</div>
<p>The post <a href="https://www.techdasher.com/soap-web-services/">Soap Web Services</a> appeared first on <a href="https://www.techdasher.com">TechDasher</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.techdasher.com/soap-web-services/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Web Services</title>
		<link>https://www.techdasher.com/web-services/</link>
					<comments>https://www.techdasher.com/web-services/#respond</comments>
		
		<dc:creator><![CDATA[cserajee]]></dc:creator>
		<pubDate>Sat, 06 Mar 2021 12:45:41 +0000</pubDate>
				<category><![CDATA[General]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[rest]]></category>
		<category><![CDATA[soap]]></category>
		<category><![CDATA[Webservices]]></category>
		<guid isPermaLink="false">https://www.techdasher.com/?p=333</guid>

					<description><![CDATA[<p>Web service&#160;is a standardized medium to propagate communication between the client and server applications over the internet. A web service is a software module that is designed to perform a certain set of tasks. In this Web Service tutorial, you will learn Web services basics- How do Web Services work? Why do you need a [&#8230;]</p>
<p>The post <a href="https://www.techdasher.com/web-services/">Web Services</a> appeared first on <a href="https://www.techdasher.com">TechDasher</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<p><strong>Web service</strong>&nbsp;is a standardized medium to propagate communication between the client and server applications over the internet. A web service is a software module that is designed to perform a certain set of tasks.</p>



<p>In this Web Service tutorial, you will learn Web services basics-</p>



<ul class="wp-block-list"><li>How do Web Services work?</li><li>Why do you need a Web Service?</li><li>Type of Web Service</li><li>Web Services Advantages</li><li>Web Service Architecture</li><li>Web Service Characteristics</li></ul>



<h2 class="wp-block-heading">How do Web Services work?</h2>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="721" height="514" src="https://www.techdasher.com/wp-content/uploads/2022/06/client_Server_flow.jpg" alt="" class="wp-image-334"/></figure>



<p>The above diagram shows a very simplistic view of how a web service would actually work. The client would invoke a series of web service calls via requests to a server that would host the actual web service.</p>



<p>These requests are made through what is known as remote procedure calls. Remote Procedure Calls(RPC) are calls made to methods that are hosted by the relevant web service.</p>



<p>As an example, Amazon provides a web service that provides prices for products sold online via amazon.com. The front end or presentation layer can be in .Net or&nbsp;Java&nbsp;but either programming language would have the ability to communicate with the web service.</p>



<p>The main component of a web service design is the data that is transferred between the client and the server, and that is XML. XML (Extensible markup language) is a counterpart to HTML and is easy to understand an intermediate language that is understood by many programming languages.</p>



<p>So when applications talk to each other, they actually talk in XML. This provides a common platform for applications developed in various programming languages to talk to each other.</p>



<p>Web services use something known as SOAP (Simple Object Access Protocol) for sending the XML data between applications. The data is sent over normal HTTP. The data which is sent from the web service to the application is called a SOAP message. The SOAP message is nothing but an XML document. Since the document is written in XML, the client application calling the web service can be written in any programming language.</p>



<h2 class="wp-block-heading">Why do you need a Web Service?</h2>



<p>Modern-day business applications use a variety of programming platforms to develop web-based applications. Some applications may be developed in Java, others in .Net, while some others in Angular JS, Node.js, etc.</p>



<p>Most often than not, these heterogeneous applications need some sort of communication to happen between them. Since they are built using different development languages, it becomes really difficult to ensure accurate communication between applications.</p>



<p>Here is where web services come in. Web services provide a common platform that allows multiple applications built on various&nbsp;programming languages&nbsp;to have the ability to communicate with each other.</p>



<h2 class="wp-block-heading">Type of Web Service</h2>



<p>There are mainly two types of web services.</p>



<ol class="wp-block-list"><li><a href="https://www.techdasher.com/soap-web-services/">SOAP web services.</a></li><li><a href="https://www.techdasher.com/restful-web-services/">RESTful web services.</a></li></ol>



<p>In order for a web service to be fully functional, there are certain components that need to be in place. These components need to be present irrespective of whatever development language is used for programming the web service.</p>



<p>Let’s look at these components in more detail.</p>



<h3 class="wp-block-heading">SOAP (Simple Object Access Protocol)</h3>



<p>SOAP is known as a transport-independent messaging protocol. SOAP is based on transferring XML data as SOAP Messages. Each message has something which is known as an XML document. Only the structure of the XML document follows a specific pattern, but not the content. The best part of Web services and SOAP is that it&#8217;s all sent via HTTP, which is the standard web protocol.</p>



<p>Here is what a SOAP message consists of</p>



<ul class="wp-block-list"><li>Each SOAP document needs to have a root element known as the &lt;Envelope&gt; element. The root element is the first element in an XML document.</li><li>The “envelope” is in turn divided into 2 parts. The first is the header, and the next is the body.</li><li>The header contains the routing data which is basically the information that tells the XML document to which client it needs to be sent.</li><li>The body will contain the actual message.</li></ul>



<figure class="wp-block-image size-large is-resized"><img loading="lazy" decoding="async" src="https://www.techdasher.com/wp-content/uploads/2022/06/soap_Comm.png" alt="" class="wp-image-335" width="500" height="331" srcset="https://www.techdasher.com/wp-content/uploads/2022/06/soap_Comm.png 631w, https://www.techdasher.com/wp-content/uploads/2022/06/soap_Comm-177x118.png 177w" sizes="auto, (max-width: 500px) 100vw, 500px" /><figcaption>A simple example of the communication via SOAP</figcaption></figure>



<h3 class="wp-block-heading"><strong>WSDL (Web services description language)</strong></h3>



<p><strong>A web service cannot be used if it cannot be found</strong>. The client invoking the web service should know where the web service actually resides.</p>



<p>Secondly, the client application needs to know what the web service actually does, so that it can invoke the right web service. This is done with the help of the WSDL, known as the Web services description language. The WSDL file is again an XML-based file that basically tells the client application what the web service does. By using the WSDL document, the client application would be able to understand where the web service is located and how it can be utilized.</p>



<h4 class="wp-block-heading">Web Service Example</h4>



<p>A Web services example of a WSDL file is given below.</p>



<pre class="wp-block-preformatted">&lt;definitions&gt;	
   &lt;message name="SampleRequest"&gt;
      &lt;part name="SampleID" type="xsd:string"/&gt;
   &lt;/message&gt;
     
   &lt;message name="SampleResponse"&gt;
      &lt;part name="SampleName" type="xsd:string"/&gt;
   &lt;/message&gt;

   &lt;portType name="Sample_PortType"&gt;
      &lt;operation name="Sample"&gt;
         &lt;input message="tns:SampleRequest"/&gt;
         &lt;output message="tns:SampleResponse"/&gt;
      &lt;/operation&gt;
   &lt;/portType&gt;

   &lt;binding name="Sample_Binding" type="tns:Sample_PortType"&gt;
      &lt;soap:binding style="rpc"
         transport="http://schemas.xmlsoap.org/soap/http"/&gt;
      &lt;operation name="Sample"&gt;
         &lt;soap:operation soapAction="Sample"/&gt;
         &lt;input&gt;
            &lt;soap:body
               encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
               namespace="urn:examples:Sampleservice"
               use="encoded"/&gt;
         &lt;/input&gt;
         
		 &lt;output&gt;
            &lt;soap:body
               encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
               namespace="urn:examples:Sampleservice"
               use="encoded"/&gt;
         &lt;/output&gt;
      &lt;/operation&gt;
   &lt;/binding&gt;
&lt;/definitions&gt;
</pre>



<p>The important aspects to note about the above WSDL declaration examples of web services are as follows:</p>



<ol class="wp-block-list"><li><strong>&lt;message&gt;</strong>&nbsp;– The message parameter in the WSDL definition is used to define the different data elements for each operation performed by the web service. So in the web services examples above, we have 2 messages which can be exchanged between the web service and the client application, one is the “SampleRequest”, and the other is the “SampleResponse” operation. The SampleRequest contains an element called “SampleID” which is of the type string. Similarly, the SampleResponse operation contains an element called “SampleName” which is also a type string.</li><li><strong>&lt;portType&gt;</strong>&nbsp;– This actually describes the operation which can be performed by the web service, which in our case is called Sample. This operation can take 2 messages; one is an input message, and the other is the output message.</li><li><strong>&lt;binding&gt;</strong>&nbsp;– This element contains the protocol which is used. So in our case, we are defining it to use HTTP (<strong>http://schemas.xmlsoap.org/soap/http</strong>). We also specify other details for the body of the operation, like the namespace and whether the message should be encoded.</li></ol>



<h3 class="wp-block-heading"><strong>Universal Description, Discovery, and Integration (UDDI)</strong></h3>



<p>UDDI is a standard for describing, publishing, and discovering the web services that are provided by a particular service provider. It provides a specification that helps in hosting the information on web services.</p>



<p>Now we discussed the previous topic about WSDL and how it contains information on what the Web service actually does. But how can a client application locate a WSDL file to understand the various operations offered by a web service? So UDDI is the answer to this and provides a repository on which WSDL files can be hosted. So the client application will have complete access to the UDDI, which acts as a database containing all the WSDL files.</p>



<p><strong>Just as a telephone directory has the name, address, and telephone number of a particular person, the same way the UDDI registry will have the relevant information for the web service</strong>. So that a client application knows, where it can be found.</p>



<h2 class="wp-block-heading">Web Services Advantages</h2>



<p>We already understand why web services came about in the first place, which was to provide a platform that could allow different applications to talk to each other.</p>



<p>But let’s look at the list of web services advantages for why it is important to use web services.</p>



<ol class="wp-block-list"><li><strong>Exposing Business Functionality on the network</strong>&nbsp;– A web service is a unit of managed code that provides some sort of functionality to client applications or end-users. This functionality can be invoked over the HTTP protocol which means that it can also be invoked over the internet. Nowadays all applications are on the internet which makes the purpose of Web services more useful. That means the web service can be anywhere on the internet and provide the necessary functionality as required.</li><li>Interoperability amongst applications&nbsp;– Web services allow various applications to talk to each other and share data and services among themselves. All types of applications can talk to each other. So instead of writing specific code which can only be understood by specific applications, you can now write generic code that can be understood by all applications</li><li>A Standardized Protocol which everybody understands&nbsp;– Web services use standardized industry protocol for communication. All four layers (Service Transport, XML Messaging, Service Description, and Service Discovery layers) use well-defined protocols in the web services protocol stack.</li><li><strong>Reduction in cost of communication</strong>&nbsp;– Web services use SOAP over HTTP protocol, so you can use your existing low-cost internet for implementing web services.</li></ol>



<h2 class="wp-block-heading">Web Services Architecture</h2>



<p>Every framework needs some sort of architecture to make sure the entire framework works as desired, similarly, in web services. The&nbsp;<strong>Web Services Architecture</strong>&nbsp;consists of three distinct roles as given below :</p>



<ol class="wp-block-list"><li><strong>Provider</strong>&nbsp;– The provider creates the web service and makes it available to client applications who want to use it.</li><li>Requestor&nbsp;– A requestor is nothing but the client application that needs to contact a web service. The client application can be a .Net, Java, or any other language-based application which looks for some sort of functionality via a web service.</li><li><strong>Broker</strong>&nbsp;– The broker is nothing but the application which provides access to the UDDI. The UDDI, as discussed in the earlier topic enables the client application to locate the web service.</li></ol>



<h2 class="wp-block-heading">Web service Characteristics</h2>



<p>Web services have the following special behavioral characteristics:</p>



<ol class="wp-block-list"><li><strong>They are XML-Based</strong>&nbsp;– Web Services uses XML to represent the data at the representation and data transportation layers. Using XML eliminates any networking, operating system, or platform sort of dependency since XML is the common language understood by all.</li><li><strong>Loosely Coupled</strong>&nbsp;– Loosely coupled means that the client and the web service are not bound to each other, which means that even if the web service changes over time, it should not change the way the client calls the web service. Adopting a loosely coupled architecture tends to make software systems more manageable and allows simpler integration between different systems.</li><li><strong>Synchronous or Asynchronous functionality</strong>&nbsp;– Synchronicity refers to the binding of the client to the execution of the service. In synchronous operations, the client will actually wait for the web service to complete an operation. An example of this is probably a scenario wherein a database read and write operation are being performed. If data is read from one database and subsequently written to another, then the operations have to be done in a sequential manner. Asynchronous operations allow a client to invoke a service and then execute other functions in parallel. This is one of the common and probably the most preferred techniques for ensuring that other services are not stopped when a particular operation is being carried out.</li><li><strong>Ability to support Remote Procedure Calls (RPCs)</strong>&nbsp;– Web services enable clients to invoke procedures, functions, and methods on remote objects using an XML-based protocol. Remote procedures expose input and output parameters that a web service must support.</li><li><strong>Supports Document Exchange</strong>&nbsp;– One of the key benefits of XML is its generic way of representing not only data but also complex documents. These documents can be as simple as representing a current address, or they can be as complex as representing an entire book.</li></ol>
<div class="simplesocialbuttons simplesocial-simple-icons simplesocialbuttons_inline simplesocialbuttons-align-left post-333 post  simplesocialbuttons-inline-no-animation">
		<button class="ssb_fbshare-icon"  rel="nofollow"  target="_blank"  aria-label="Facebook Share" data-href="https://www.facebook.com/sharer/sharer.php?u=https://www.techdasher.com/web-services/" onClick="javascript:window.open(this.dataset.href, '', 'menubar=no,toolbar=no,resizable=yes,scrollbars=yes,height=600,width=600');return false;">
						<span class="icon"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" class="_1pbq" color="#ffffff"><path fill="#ffffff" fill-rule="evenodd" class="icon" d="M8 14H3.667C2.733 13.9 2 13.167 2 12.233V3.667A1.65 1.65 0 0 1 3.667 2h8.666A1.65 1.65 0 0 1 14 3.667v8.566c0 .934-.733 1.667-1.667 1.767H10v-3.967h1.3l.7-2.066h-2V6.933c0-.466.167-.9.867-.9H12v-1.8c.033 0-.933-.266-1.533-.266-1.267 0-2.434.7-2.467 2.133v1.867H6v2.066h2V14z"></path></svg></span>
						<span class="simplesocialtxt">Share </span> </button>
<button class="ssb_tweet-icon"  rel="nofollow"  target="_blank"  aria-label="Twitter Share" data-href="https://twitter.com/intent/tweet?text=Web+Services&url=https://www.techdasher.com/web-services/&via=tech_dasher" onClick="javascript:window.open(this.dataset.href, '', 'menubar=no,toolbar=no,resizable=yes,scrollbars=yes,height=600,width=600');return false;">
						<span class="icon"><svg viewBox="0 0 16 14" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M4.9 0H0L5.782 7.7098L0.315 14H2.17L6.6416 8.8557L10.5 14H15.4L9.3744 5.9654L14.56 0H12.705L8.5148 4.8202L4.9 0ZM11.2 12.6L2.8 1.4H4.2L12.6 12.6H11.2Z" fill="#fff"/></svg></span><i class="simplesocialtxt">Post </i></button>
<button class="ssb_linkedin-icon"  rel="nofollow"  target="_blank"  aria-label="LinkedIn Share" data-href="https://www.linkedin.com/sharing/share-offsite/?url=https://www.techdasher.com/web-services/" onClick="javascript:window.open(this.dataset.href, '', 'menubar=no,toolbar=no,resizable=yes,scrollbars=yes,height=600,width=600');return false;" >
						<span class="icon"> <svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" width="15px" height="14.1px" viewBox="-301.4 387.5 15 14.1" enable-background="new -301.4 387.5 15 14.1" xml:space="preserve"> <g id="XMLID_398_"> <path id="XMLID_399_" fill="#FFFFFF" d="M-296.2,401.6c0-3.2,0-6.3,0-9.5h0.1c1,0,2,0,2.9,0c0.1,0,0.1,0,0.1,0.1c0,0.4,0,0.8,0,1.2 c0.1-0.1,0.2-0.3,0.3-0.4c0.5-0.7,1.2-1,2.1-1.1c0.8-0.1,1.5,0,2.2,0.3c0.7,0.4,1.2,0.8,1.5,1.4c0.4,0.8,0.6,1.7,0.6,2.5 c0,1.8,0,3.6,0,5.4v0.1c-1.1,0-2.1,0-3.2,0c0-0.1,0-0.1,0-0.2c0-1.6,0-3.2,0-4.8c0-0.4,0-0.8-0.2-1.2c-0.2-0.7-0.8-1-1.6-1 c-0.8,0.1-1.3,0.5-1.6,1.2c-0.1,0.2-0.1,0.5-0.1,0.8c0,1.7,0,3.4,0,5.1c0,0.2,0,0.2-0.2,0.2c-1,0-1.9,0-2.9,0 C-296.1,401.6-296.2,401.6-296.2,401.6z"/> <path id="XMLID_400_" fill="#FFFFFF" d="M-298,401.6L-298,401.6c-1.1,0-2.1,0-3,0c-0.1,0-0.1,0-0.1-0.1c0-3.1,0-6.1,0-9.2 c0-0.1,0-0.1,0.1-0.1c1,0,2,0,2.9,0h0.1C-298,395.3-298,398.5-298,401.6z"/> <path id="XMLID_401_" fill="#FFFFFF" d="M-299.6,390.9c-0.7-0.1-1.2-0.3-1.6-0.8c-0.5-0.8-0.2-2.1,1-2.4c0.6-0.2,1.2-0.1,1.8,0.2 c0.5,0.4,0.7,0.9,0.6,1.5c-0.1,0.7-0.5,1.1-1.1,1.3C-299.1,390.8-299.4,390.8-299.6,390.9L-299.6,390.9z"/> </g> </svg> </span>
						<span class="simplesocialtxt">Share</span> </button>
<div class="fb-like ssb-fb-like" aria-label="Facebook Like" data-href="https://www.techdasher.com/web-services/" data-layout="button_count" data-action="like" data-size="small" data-show-faces="false" data-share="false"></div>
</div>
<p>The post <a href="https://www.techdasher.com/web-services/">Web Services</a> appeared first on <a href="https://www.techdasher.com">TechDasher</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.techdasher.com/web-services/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Android Application &#8211; Kolam</title>
		<link>https://www.techdasher.com/android-application-kolam/</link>
					<comments>https://www.techdasher.com/android-application-kolam/#respond</comments>
		
		<dc:creator><![CDATA[cserajee]]></dc:creator>
		<pubDate>Sun, 12 Apr 2020 12:47:49 +0000</pubDate>
				<category><![CDATA[Portfolios]]></category>
		<category><![CDATA[Android]]></category>
		<category><![CDATA[Flutter]]></category>
		<category><![CDATA[MySQLi]]></category>
		<category><![CDATA[PHP]]></category>
		<guid isPermaLink="false">https://www.techdasher.com/?p=313</guid>

					<description><![CDATA[<p>My First android application at playstore.</p>
<p>The post <a href="https://www.techdasher.com/android-application-kolam/">Android Application &#8211; Kolam</a> appeared first on <a href="https://www.techdasher.com">TechDasher</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<p>My First android application at <a href="https://play.google.com/store/apps/details?id=com.mykolam" target="_blank" rel="noreferrer noopener">playstore</a>. </p>
<div class="simplesocialbuttons simplesocial-simple-icons simplesocialbuttons_inline simplesocialbuttons-align-left post-313 post  simplesocialbuttons-inline-no-animation">
		<button class="ssb_fbshare-icon"  rel="nofollow"  target="_blank"  aria-label="Facebook Share" data-href="https://www.facebook.com/sharer/sharer.php?u=https://www.techdasher.com/android-application-kolam/" onClick="javascript:window.open(this.dataset.href, '', 'menubar=no,toolbar=no,resizable=yes,scrollbars=yes,height=600,width=600');return false;">
						<span class="icon"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" class="_1pbq" color="#ffffff"><path fill="#ffffff" fill-rule="evenodd" class="icon" d="M8 14H3.667C2.733 13.9 2 13.167 2 12.233V3.667A1.65 1.65 0 0 1 3.667 2h8.666A1.65 1.65 0 0 1 14 3.667v8.566c0 .934-.733 1.667-1.667 1.767H10v-3.967h1.3l.7-2.066h-2V6.933c0-.466.167-.9.867-.9H12v-1.8c.033 0-.933-.266-1.533-.266-1.267 0-2.434.7-2.467 2.133v1.867H6v2.066h2V14z"></path></svg></span>
						<span class="simplesocialtxt">Share </span> </button>
<button class="ssb_tweet-icon"  rel="nofollow"  target="_blank"  aria-label="Twitter Share" data-href="https://twitter.com/intent/tweet?text=Android+Application+%E2%80%93+Kolam&url=https://www.techdasher.com/android-application-kolam/&via=tech_dasher" onClick="javascript:window.open(this.dataset.href, '', 'menubar=no,toolbar=no,resizable=yes,scrollbars=yes,height=600,width=600');return false;">
						<span class="icon"><svg viewBox="0 0 16 14" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M4.9 0H0L5.782 7.7098L0.315 14H2.17L6.6416 8.8557L10.5 14H15.4L9.3744 5.9654L14.56 0H12.705L8.5148 4.8202L4.9 0ZM11.2 12.6L2.8 1.4H4.2L12.6 12.6H11.2Z" fill="#fff"/></svg></span><i class="simplesocialtxt">Post </i></button>
<button class="ssb_linkedin-icon"  rel="nofollow"  target="_blank"  aria-label="LinkedIn Share" data-href="https://www.linkedin.com/sharing/share-offsite/?url=https://www.techdasher.com/android-application-kolam/" onClick="javascript:window.open(this.dataset.href, '', 'menubar=no,toolbar=no,resizable=yes,scrollbars=yes,height=600,width=600');return false;" >
						<span class="icon"> <svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" width="15px" height="14.1px" viewBox="-301.4 387.5 15 14.1" enable-background="new -301.4 387.5 15 14.1" xml:space="preserve"> <g id="XMLID_398_"> <path id="XMLID_399_" fill="#FFFFFF" d="M-296.2,401.6c0-3.2,0-6.3,0-9.5h0.1c1,0,2,0,2.9,0c0.1,0,0.1,0,0.1,0.1c0,0.4,0,0.8,0,1.2 c0.1-0.1,0.2-0.3,0.3-0.4c0.5-0.7,1.2-1,2.1-1.1c0.8-0.1,1.5,0,2.2,0.3c0.7,0.4,1.2,0.8,1.5,1.4c0.4,0.8,0.6,1.7,0.6,2.5 c0,1.8,0,3.6,0,5.4v0.1c-1.1,0-2.1,0-3.2,0c0-0.1,0-0.1,0-0.2c0-1.6,0-3.2,0-4.8c0-0.4,0-0.8-0.2-1.2c-0.2-0.7-0.8-1-1.6-1 c-0.8,0.1-1.3,0.5-1.6,1.2c-0.1,0.2-0.1,0.5-0.1,0.8c0,1.7,0,3.4,0,5.1c0,0.2,0,0.2-0.2,0.2c-1,0-1.9,0-2.9,0 C-296.1,401.6-296.2,401.6-296.2,401.6z"/> <path id="XMLID_400_" fill="#FFFFFF" d="M-298,401.6L-298,401.6c-1.1,0-2.1,0-3,0c-0.1,0-0.1,0-0.1-0.1c0-3.1,0-6.1,0-9.2 c0-0.1,0-0.1,0.1-0.1c1,0,2,0,2.9,0h0.1C-298,395.3-298,398.5-298,401.6z"/> <path id="XMLID_401_" fill="#FFFFFF" d="M-299.6,390.9c-0.7-0.1-1.2-0.3-1.6-0.8c-0.5-0.8-0.2-2.1,1-2.4c0.6-0.2,1.2-0.1,1.8,0.2 c0.5,0.4,0.7,0.9,0.6,1.5c-0.1,0.7-0.5,1.1-1.1,1.3C-299.1,390.8-299.4,390.8-299.6,390.9L-299.6,390.9z"/> </g> </svg> </span>
						<span class="simplesocialtxt">Share</span> </button>
<div class="fb-like ssb-fb-like" aria-label="Facebook Like" data-href="https://www.techdasher.com/android-application-kolam/" data-layout="button_count" data-action="like" data-size="small" data-show-faces="false" data-share="false"></div>
</div>
<p>The post <a href="https://www.techdasher.com/android-application-kolam/">Android Application &#8211; Kolam</a> appeared first on <a href="https://www.techdasher.com">TechDasher</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.techdasher.com/android-application-kolam/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>How to integrate Google reCAPTCHA in PHP Form</title>
		<link>https://www.techdasher.com/how-to-integrate-google-recaptcha-in-php-form/</link>
					<comments>https://www.techdasher.com/how-to-integrate-google-recaptcha-in-php-form/#comments</comments>
		
		<dc:creator><![CDATA[cserajee]]></dc:creator>
		<pubDate>Thu, 28 Feb 2019 11:57:56 +0000</pubDate>
				<category><![CDATA[General]]></category>
		<category><![CDATA[Google API]]></category>
		<category><![CDATA[HTML]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[JavaScript]]></category>
		<guid isPermaLink="false">https://www.techdasher.com/?p=278</guid>

					<description><![CDATA[<p>Hi all, I&#8217;ve to show, how to integrate Google reCAPTCHA in PHP form. reCAPTCHA protects your website from spam and abuse in form submission. reCAPTCHA uses an advanced risk analysis engine and adaptive challenges to keep automated software from engaging in abusive activities on your website. Here I&#8217;ve&#160; integrate google reCAPTCHA in subscription form for [&#8230;]</p>
<p>The post <a href="https://www.techdasher.com/how-to-integrate-google-recaptcha-in-php-form/">How to integrate Google reCAPTCHA in PHP Form</a> appeared first on <a href="https://www.techdasher.com">TechDasher</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<p>Hi all,  I&#8217;ve to show, how to integrate Google reCAPTCHA in PHP form.  reCAPTCHA protects your website from spam and abuse in form submission. reCAPTCHA uses an advanced risk analysis engine and adaptive challenges to keep automated software from engaging in abusive activities on your website. <br></p>



<p>Here I&#8217;ve&nbsp; integrate google reCAPTCHA in subscription form for collecting subscriber name and email. <br></p>



<h3 class="wp-block-heading">Register your website and get API key.</h3>



<ul class="wp-block-list"><li>Click the below link, Sign in using google account&nbsp;</li></ul>



<h4 class="wp-block-heading"><a href="https://www.google.com/recaptcha/admin" target="_blank" rel="noreferrer noopener" aria-label="https://www.google.com/recaptcha/admin

 (opens in a new tab)">https://www.google.com/recaptcha/admin</a><br><br></h4>



<ul class="wp-block-list"><li>Click <strong>create button (+)</strong> on right top of the window. It will redirect to register a new site.</li></ul>



<figure class="wp-block-image"><img loading="lazy" decoding="async" width="800" height="500" src="https://www.techdasher.com/wp-content/uploads/2019/02/Dashboard_How_to_integrate_Google_reCAPTCHA_in_PHP_Form.jpg" alt="" class="wp-image-284" srcset="https://www.techdasher.com/wp-content/uploads/2019/02/Dashboard_How_to_integrate_Google_reCAPTCHA_in_PHP_Form.jpg 800w, https://www.techdasher.com/wp-content/uploads/2019/02/Dashboard_How_to_integrate_Google_reCAPTCHA_in_PHP_Form-768x480.jpg 768w" sizes="auto, (max-width: 800px) 100vw, 800px" /></figure>



<ul class="wp-block-list"><li>Enter the following details<ul><li>Label</li><li>reCAPTCHA type (reCAPTCHA v2 -&gt; &#8220;I&#8217;m not a robot&#8221;)</li><li>Domains</li><li>Accept reCAPTCHA Terms of Service</li><li>Finally click Submit button.</li></ul></li></ul>



<figure class="wp-block-image"><img loading="lazy" decoding="async" width="700" height="850" src="https://www.techdasher.com/wp-content/uploads/2019/02/Register_form_How_to_integrate_Google_reCAPTCHA_in_PHP_Form.jpg" alt="" class="wp-image-283"/></figure>



<ul class="wp-block-list"><li>After registered successfully you will get two API key<br><ul><li><strong>site key</strong>: Use this in the HTML code your site serves to users. <br></li><li><strong>secret key</strong>: Use this for communication between your site and reCAPTCHA.</li></ul></li></ul>



<figure class="wp-block-image"><img loading="lazy" decoding="async" width="800" height="500" src="https://www.techdasher.com/wp-content/uploads/2019/02/API_KEY_How_to_integrate_Google_reCAPTCHA_in_PHP_Form.jpg" alt="" class="wp-image-282" srcset="https://www.techdasher.com/wp-content/uploads/2019/02/API_KEY_How_to_integrate_Google_reCAPTCHA_in_PHP_Form.jpg 800w, https://www.techdasher.com/wp-content/uploads/2019/02/API_KEY_How_to_integrate_Google_reCAPTCHA_in_PHP_Form-768x480.jpg 768w" sizes="auto, (max-width: 800px) 100vw, 800px" /></figure>



<h3 class="wp-block-heading">Adding Site Key</h3>



<p>Add the following <strong>JavaScript library file</strong> inside the head tag</p>



<pre class="wp-block-code"><code>&lt;script src='https://www.google.com/recaptcha/api.js'>&lt;/script></code></pre>



<p>Add <strong>site key</strong> inside the form tag</p>



<pre class="wp-block-code"><code>&lt;form> 
&lt;div class="g-recaptcha" data-sitekey="__SITE_KEY__">&lt;/div> 
&lt;/form></code></pre>



<h3 class="wp-block-heading">Server Validation</h3>



<p>In server side PHP fetch google reCAPTCHA response token from user request, send a request to the API with secret key and response token for Validation. API sends a JSON response valid or not.</p>



<pre class="wp-block-code"><code>&lt;?PHP 
if ($_POST['g-recaptcha-response']) {
    $recaptcha_secret = "____SECRET_KEY_PASTE_HERE____";
    $request_url = "https://www.google.com/recaptcha/api/siteverify?secret=" . $recaptcha_secret . "&amp;response=" . $_POST['g-recaptcha-response'];
    $ch = curl_init();
    curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
    curl_setopt($ch, CURLOPT_URL, $request_url);
    $response = curl_exec($ch);
    curl_close($ch); 
    $response = json_decode($response, true); 
    if ($response["success"] === true) {
        echo '&lt;strong>Captcha Verified!&lt;/strong> Success...';
        } else {
        echo '&lt;strong>Captcha mismatched!&lt;/strong> Please try again...';
    }
}
?></code></pre>



<h3 class="wp-block-heading">Source Code<br></h3>



<pre class="wp-block-code"><code>&lt;?PHP 
if ($_POST['g-recaptcha-response']) {
    $recaptcha_secret = "____SECRET_KEY_PASTE_HERE____";
    $request_url = "https://www.google.com/recaptcha/api/siteverify?secret=" . $recaptcha_secret . "&amp;response=" . $_POST['g-recaptcha-response'];
    $ch = curl_init();
    curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
    curl_setopt($ch, CURLOPT_URL, $request_url);
    $response = curl_exec($ch);
    curl_close($ch); 
    $response = json_decode($response, true); 
    $response = json_decode($response, true);
    if ($response["success"] === true) {
        echo '&lt;strong>Captcha Verified!&lt;/strong> Success...';
        } else {
        echo '&lt;strong>Captcha mismatched!&lt;/strong> Please try again...';
    }
}
?>
&lt;!DOCTYPE html>
&lt;html>
&lt;head>
    &lt;meta http-equiv="content-type" content="text/html; charset=UTF-8">
    &lt;meta name="viewport" content="width=device-width, initial-scale=1">
    &lt;script src='https://www.google.com/recaptcha/api.js'>&lt;/script>
&lt;style>
body{background:#88E7EF; }
form{margin: 0 auto;width: 300px;}
p{ padding:10px 10px 0px 0px; margin:0px; font-size:14px; font-family:arial; }
form input{ padding:5px; margin:0px 0px 10px; width:80%;}
form button{ padding:5px; width:50%; margin:10px 0px;}
&lt;/style>
&lt;/head>
&lt;body>
    &lt;form method="post">
        &lt;p>Name&lt;/p>
        &lt;input type="text" name="name" autocomplete="off" id="name" />
        &lt;p>Email&lt;/p>
        &lt;input type="email" name="email" autocomplete="off" id="email" />
        &lt;div class="g-recaptcha" data-sitekey="____SITE_KEY_PASTE_HERE____">&lt;/div>
        &lt;button type="submit" id="form-submit" name="form-submit" value="Submit">Submit&lt;/button>
    &lt;/form>
&lt;/body>
&lt;/html> </code></pre>



<h3 class="wp-block-heading">Output Screen<br></h3>



<div class="wp-block-image"><figure class="aligncenter is-resized"><img loading="lazy" decoding="async" src="https://www.techdasher.com/wp-content/uploads/2019/02/Output_How_to_integrate_Google_reCAPTCHA_in_PHP_Form.png" alt="" class="wp-image-289" width="437" height="352"/></figure></div>
<div class="simplesocialbuttons simplesocial-simple-icons simplesocialbuttons_inline simplesocialbuttons-align-left post-278 post  simplesocialbuttons-inline-no-animation">
		<button class="ssb_fbshare-icon"  rel="nofollow"  target="_blank"  aria-label="Facebook Share" data-href="https://www.facebook.com/sharer/sharer.php?u=https://www.techdasher.com/how-to-integrate-google-recaptcha-in-php-form/" onClick="javascript:window.open(this.dataset.href, '', 'menubar=no,toolbar=no,resizable=yes,scrollbars=yes,height=600,width=600');return false;">
						<span class="icon"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" class="_1pbq" color="#ffffff"><path fill="#ffffff" fill-rule="evenodd" class="icon" d="M8 14H3.667C2.733 13.9 2 13.167 2 12.233V3.667A1.65 1.65 0 0 1 3.667 2h8.666A1.65 1.65 0 0 1 14 3.667v8.566c0 .934-.733 1.667-1.667 1.767H10v-3.967h1.3l.7-2.066h-2V6.933c0-.466.167-.9.867-.9H12v-1.8c.033 0-.933-.266-1.533-.266-1.267 0-2.434.7-2.467 2.133v1.867H6v2.066h2V14z"></path></svg></span>
						<span class="simplesocialtxt">Share </span> </button>
<button class="ssb_tweet-icon"  rel="nofollow"  target="_blank"  aria-label="Twitter Share" data-href="https://twitter.com/intent/tweet?text=How+to+integrate+Google+reCAPTCHA+in+PHP+Form&url=https://www.techdasher.com/how-to-integrate-google-recaptcha-in-php-form/&via=tech_dasher" onClick="javascript:window.open(this.dataset.href, '', 'menubar=no,toolbar=no,resizable=yes,scrollbars=yes,height=600,width=600');return false;">
						<span class="icon"><svg viewBox="0 0 16 14" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M4.9 0H0L5.782 7.7098L0.315 14H2.17L6.6416 8.8557L10.5 14H15.4L9.3744 5.9654L14.56 0H12.705L8.5148 4.8202L4.9 0ZM11.2 12.6L2.8 1.4H4.2L12.6 12.6H11.2Z" fill="#fff"/></svg></span><i class="simplesocialtxt">Post </i></button>
<button class="ssb_linkedin-icon"  rel="nofollow"  target="_blank"  aria-label="LinkedIn Share" data-href="https://www.linkedin.com/sharing/share-offsite/?url=https://www.techdasher.com/how-to-integrate-google-recaptcha-in-php-form/" onClick="javascript:window.open(this.dataset.href, '', 'menubar=no,toolbar=no,resizable=yes,scrollbars=yes,height=600,width=600');return false;" >
						<span class="icon"> <svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" width="15px" height="14.1px" viewBox="-301.4 387.5 15 14.1" enable-background="new -301.4 387.5 15 14.1" xml:space="preserve"> <g id="XMLID_398_"> <path id="XMLID_399_" fill="#FFFFFF" d="M-296.2,401.6c0-3.2,0-6.3,0-9.5h0.1c1,0,2,0,2.9,0c0.1,0,0.1,0,0.1,0.1c0,0.4,0,0.8,0,1.2 c0.1-0.1,0.2-0.3,0.3-0.4c0.5-0.7,1.2-1,2.1-1.1c0.8-0.1,1.5,0,2.2,0.3c0.7,0.4,1.2,0.8,1.5,1.4c0.4,0.8,0.6,1.7,0.6,2.5 c0,1.8,0,3.6,0,5.4v0.1c-1.1,0-2.1,0-3.2,0c0-0.1,0-0.1,0-0.2c0-1.6,0-3.2,0-4.8c0-0.4,0-0.8-0.2-1.2c-0.2-0.7-0.8-1-1.6-1 c-0.8,0.1-1.3,0.5-1.6,1.2c-0.1,0.2-0.1,0.5-0.1,0.8c0,1.7,0,3.4,0,5.1c0,0.2,0,0.2-0.2,0.2c-1,0-1.9,0-2.9,0 C-296.1,401.6-296.2,401.6-296.2,401.6z"/> <path id="XMLID_400_" fill="#FFFFFF" d="M-298,401.6L-298,401.6c-1.1,0-2.1,0-3,0c-0.1,0-0.1,0-0.1-0.1c0-3.1,0-6.1,0-9.2 c0-0.1,0-0.1,0.1-0.1c1,0,2,0,2.9,0h0.1C-298,395.3-298,398.5-298,401.6z"/> <path id="XMLID_401_" fill="#FFFFFF" d="M-299.6,390.9c-0.7-0.1-1.2-0.3-1.6-0.8c-0.5-0.8-0.2-2.1,1-2.4c0.6-0.2,1.2-0.1,1.8,0.2 c0.5,0.4,0.7,0.9,0.6,1.5c-0.1,0.7-0.5,1.1-1.1,1.3C-299.1,390.8-299.4,390.8-299.6,390.9L-299.6,390.9z"/> </g> </svg> </span>
						<span class="simplesocialtxt">Share</span> </button>
<div class="fb-like ssb-fb-like" aria-label="Facebook Like" data-href="https://www.techdasher.com/how-to-integrate-google-recaptcha-in-php-form/" data-layout="button_count" data-action="like" data-size="small" data-show-faces="false" data-share="false"></div>
</div>
<p>The post <a href="https://www.techdasher.com/how-to-integrate-google-recaptcha-in-php-form/">How to integrate Google reCAPTCHA in PHP Form</a> appeared first on <a href="https://www.techdasher.com">TechDasher</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.techdasher.com/how-to-integrate-google-recaptcha-in-php-form/feed/</wfw:commentRss>
			<slash:comments>1</slash:comments>
		
		
			</item>
		<item>
		<title>Corners Position Picker Using HTML CSS</title>
		<link>https://www.techdasher.com/corners-position-picker-using-html-css/</link>
					<comments>https://www.techdasher.com/corners-position-picker-using-html-css/#respond</comments>
		
		<dc:creator><![CDATA[cserajee]]></dc:creator>
		<pubDate>Sat, 29 Dec 2018 06:44:48 +0000</pubDate>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[HTML]]></category>
		<guid isPermaLink="false">https://www.techdasher.com/?p=267</guid>

					<description><![CDATA[<p>In this post, I&#8217;ve shared a code for corner position picker using HTML and CSS. HTML Code &#60;div id="aOrginCon"&#62; &#60;label class="aOrType lt"&#62;&#60;input type="radio" name="wcs-orgin" value="left-top" /&#62; &#60;div&#62;&#60;/div&#62; &#60;/label&#62; &#60;label class="aOrType ct"&#62;&#60;input type="radio" name="wcs-orgin" value="center-top" /&#62; &#60;div&#62;&#60;/div&#62; &#60;/label&#62; &#60;label class="aOrType rt"&#62;&#60;input type="radio" name="wcs-orgin" value="right-top" /&#62; &#60;div&#62;&#60;/div&#62; &#60;/label&#62; &#60;label class="aOrType lc"&#62;&#60;input type="radio" name="wcs-orgin" value="left-center" /&#62; &#60;div&#62;&#60;/div&#62; &#60;/label&#62; [&#8230;]</p>
<p>The post <a href="https://www.techdasher.com/corners-position-picker-using-html-css/">Corners Position Picker Using HTML CSS</a> appeared first on <a href="https://www.techdasher.com">TechDasher</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<p>In this post, I&#8217;ve shared a code for corner position picker using HTML and CSS.</p>



<h4 class="wp-block-heading">HTML Code<br></h4>



<pre class="wp-block-preformatted">&lt;div id="aOrginCon"&gt;<br>    &lt;label class="aOrType lt"&gt;&lt;input type="radio" name="wcs-orgin" value="left-top" /&gt;<br>        &lt;div&gt;&lt;/div&gt;<br>    &lt;/label&gt;<br>    &lt;label class="aOrType ct"&gt;&lt;input type="radio" name="wcs-orgin" value="center-top" /&gt;<br>        &lt;div&gt;&lt;/div&gt;<br>    &lt;/label&gt;<br>    &lt;label class="aOrType rt"&gt;&lt;input type="radio" name="wcs-orgin" value="right-top" /&gt;<br>        &lt;div&gt;&lt;/div&gt;<br>    &lt;/label&gt; <br>    &lt;label class="aOrType lc"&gt;&lt;input type="radio" name="wcs-orgin" value="left-center" /&gt;<br>        &lt;div&gt;&lt;/div&gt;<br>    &lt;/label&gt;<br>    &lt;label class="aOrType cc"&gt;&lt;input type="radio" name="wcs-orgin" value="center-center" /&gt;<br>        &lt;div&gt;&lt;/div&gt;<br>    &lt;/label&gt;<br>    &lt;label class="aOrType rc"&gt;&lt;input type="radio" name="wcs-orgin" value="right-center" /&gt;<br>        &lt;div&gt;&lt;/div&gt;<br>    &lt;/label&gt; <br>    &lt;label class="aOrType lb"&gt;&lt;input type="radio" name="wcs-orgin" value="left-bottom" /&gt;<br>        &lt;div&gt;&lt;/div&gt;<br>    &lt;/label&gt;<br>    &lt;label class="aOrType cb"&gt;&lt;input type="radio" name="wcs-orgin" value="center-bottom" /&gt;<br>        &lt;div&gt;&lt;/div&gt;<br>    &lt;/label&gt;<br>    &lt;label class="aOrType rb"&gt;&lt;input type="radio" name="wcs-orgin" value="right-bottom" /&gt;<br>        &lt;div&gt;&lt;/div&gt;<br>    &lt;/label&gt;<br>&lt;/div&gt;</pre>



<p data-height="265" data-theme-id="dark" data-slug-hash="QzMQLo" data-default-tab="html,result" data-user="cserajee" data-pen-title="HTML CSS Select Position" class="codepen">See the Pen <a href="https://codepen.io/cserajee/pen/QzMQLo/">HTML CSS Select Position</a> by Raj (<a href="https://codepen.io/cserajee">@cserajee</a>) on <a href="https://codepen.io">CodePen</a>.</p>
<script async src="https://static.codepen.io/assets/embed/ei.js"></script>



<h4 class="wp-block-heading">CSS Code<br></h4>



<pre class="wp-block-preformatted">#aOrginCon {<br>    margin: 50px auto;<br>    width: 50px;<br>    height: 50px;<br>    border: solid 1px #666;<br>    position: relative;<br>}<br><br>.aOrType {<br>    position: absolute;<br>}<br><br>.aOrType input {<br>    display: none;<br>}<br><br>.aOrType input+div {<br>    border: solid 1px #000;<br>    margin: 0px;<br>    padding: 5px;<br>    cursor: pointer;<br>}<br><br>.aOrType input:checked+div {<br>    background: #000;<br>}<br><br>.aOrType.lt {<br>    left: -6px;<br>    top: -6px;<br>}<br><br>.aOrType.ct {<br>    left: 19px;<br>    top: -6px;<br>}<br><br>.aOrType.rt {<br>    right: -6px;<br>    top: -6px;<br>}<br><br><br>.aOrType.lc {<br>    left: -6px;<br>    top: 18px;<br>}<br><br>.aOrType.cc {<br>    left: 19px;<br>    top: 18px;<br>}<br><br>.aOrType.rc {<br>    right: -6px;<br>    top: 18px;<br>}<br><br><br>.aOrType.lb {<br>    left: -6px;<br>    top: 44px;<br>}<br><br>.aOrType.cb {<br>    left: 19px;<br>    top: 44px;<br>}<br><br>.aOrType.rb {<br>    right: -6px;<br>    top: 44px;<br>}</pre>
<div class="simplesocialbuttons simplesocial-simple-icons simplesocialbuttons_inline simplesocialbuttons-align-left post-267 post  simplesocialbuttons-inline-no-animation">
		<button class="ssb_fbshare-icon"  rel="nofollow"  target="_blank"  aria-label="Facebook Share" data-href="https://www.facebook.com/sharer/sharer.php?u=https://www.techdasher.com/corners-position-picker-using-html-css/" onClick="javascript:window.open(this.dataset.href, '', 'menubar=no,toolbar=no,resizable=yes,scrollbars=yes,height=600,width=600');return false;">
						<span class="icon"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" class="_1pbq" color="#ffffff"><path fill="#ffffff" fill-rule="evenodd" class="icon" d="M8 14H3.667C2.733 13.9 2 13.167 2 12.233V3.667A1.65 1.65 0 0 1 3.667 2h8.666A1.65 1.65 0 0 1 14 3.667v8.566c0 .934-.733 1.667-1.667 1.767H10v-3.967h1.3l.7-2.066h-2V6.933c0-.466.167-.9.867-.9H12v-1.8c.033 0-.933-.266-1.533-.266-1.267 0-2.434.7-2.467 2.133v1.867H6v2.066h2V14z"></path></svg></span>
						<span class="simplesocialtxt">Share </span> </button>
<button class="ssb_tweet-icon"  rel="nofollow"  target="_blank"  aria-label="Twitter Share" data-href="https://twitter.com/intent/tweet?text=Corners+Position+Picker+Using+HTML+CSS&url=https://www.techdasher.com/corners-position-picker-using-html-css/&via=tech_dasher" onClick="javascript:window.open(this.dataset.href, '', 'menubar=no,toolbar=no,resizable=yes,scrollbars=yes,height=600,width=600');return false;">
						<span class="icon"><svg viewBox="0 0 16 14" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M4.9 0H0L5.782 7.7098L0.315 14H2.17L6.6416 8.8557L10.5 14H15.4L9.3744 5.9654L14.56 0H12.705L8.5148 4.8202L4.9 0ZM11.2 12.6L2.8 1.4H4.2L12.6 12.6H11.2Z" fill="#fff"/></svg></span><i class="simplesocialtxt">Post </i></button>
<button class="ssb_linkedin-icon"  rel="nofollow"  target="_blank"  aria-label="LinkedIn Share" data-href="https://www.linkedin.com/sharing/share-offsite/?url=https://www.techdasher.com/corners-position-picker-using-html-css/" onClick="javascript:window.open(this.dataset.href, '', 'menubar=no,toolbar=no,resizable=yes,scrollbars=yes,height=600,width=600');return false;" >
						<span class="icon"> <svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" width="15px" height="14.1px" viewBox="-301.4 387.5 15 14.1" enable-background="new -301.4 387.5 15 14.1" xml:space="preserve"> <g id="XMLID_398_"> <path id="XMLID_399_" fill="#FFFFFF" d="M-296.2,401.6c0-3.2,0-6.3,0-9.5h0.1c1,0,2,0,2.9,0c0.1,0,0.1,0,0.1,0.1c0,0.4,0,0.8,0,1.2 c0.1-0.1,0.2-0.3,0.3-0.4c0.5-0.7,1.2-1,2.1-1.1c0.8-0.1,1.5,0,2.2,0.3c0.7,0.4,1.2,0.8,1.5,1.4c0.4,0.8,0.6,1.7,0.6,2.5 c0,1.8,0,3.6,0,5.4v0.1c-1.1,0-2.1,0-3.2,0c0-0.1,0-0.1,0-0.2c0-1.6,0-3.2,0-4.8c0-0.4,0-0.8-0.2-1.2c-0.2-0.7-0.8-1-1.6-1 c-0.8,0.1-1.3,0.5-1.6,1.2c-0.1,0.2-0.1,0.5-0.1,0.8c0,1.7,0,3.4,0,5.1c0,0.2,0,0.2-0.2,0.2c-1,0-1.9,0-2.9,0 C-296.1,401.6-296.2,401.6-296.2,401.6z"/> <path id="XMLID_400_" fill="#FFFFFF" d="M-298,401.6L-298,401.6c-1.1,0-2.1,0-3,0c-0.1,0-0.1,0-0.1-0.1c0-3.1,0-6.1,0-9.2 c0-0.1,0-0.1,0.1-0.1c1,0,2,0,2.9,0h0.1C-298,395.3-298,398.5-298,401.6z"/> <path id="XMLID_401_" fill="#FFFFFF" d="M-299.6,390.9c-0.7-0.1-1.2-0.3-1.6-0.8c-0.5-0.8-0.2-2.1,1-2.4c0.6-0.2,1.2-0.1,1.8,0.2 c0.5,0.4,0.7,0.9,0.6,1.5c-0.1,0.7-0.5,1.1-1.1,1.3C-299.1,390.8-299.4,390.8-299.6,390.9L-299.6,390.9z"/> </g> </svg> </span>
						<span class="simplesocialtxt">Share</span> </button>
<div class="fb-like ssb-fb-like" aria-label="Facebook Like" data-href="https://www.techdasher.com/corners-position-picker-using-html-css/" data-layout="button_count" data-action="like" data-size="small" data-show-faces="false" data-share="false"></div>
</div>
<p>The post <a href="https://www.techdasher.com/corners-position-picker-using-html-css/">Corners Position Picker Using HTML CSS</a> appeared first on <a href="https://www.techdasher.com">TechDasher</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.techdasher.com/corners-position-picker-using-html-css/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Simple Sign in and Account Management Module using PHP</title>
		<link>https://www.techdasher.com/simple-sign-in-and-account-management-module-using-php/</link>
					<comments>https://www.techdasher.com/simple-sign-in-and-account-management-module-using-php/#respond</comments>
		
		<dc:creator><![CDATA[cserajee]]></dc:creator>
		<pubDate>Tue, 30 Oct 2018 10:09:38 +0000</pubDate>
				<category><![CDATA[MySQL]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[MySQLi]]></category>
		<guid isPermaLink="false">https://www.techdasher.com/?p=243</guid>

					<description><![CDATA[<p>Simple login and account management module using PHP &#38; MySQL. Using this module we have to perform login with session management, adding new user, edit &#38; delete user. click here to download source code 1. Creating Database &#38; Table Create a database in MySQL. For example, I&#8217;ve create database &#8220;account&#8221; for more details for creating [&#8230;]</p>
<p>The post <a href="https://www.techdasher.com/simple-sign-in-and-account-management-module-using-php/">Simple Sign in and Account Management Module using PHP</a> appeared first on <a href="https://www.techdasher.com">TechDasher</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<p>Simple login and account management module using PHP &amp; MySQL. Using this module we have to perform login with session management, adding new user, edit &amp; delete user.</p>



<p><a href="https://www.techdasher.com/wp-content/uploads/2018/10/simple-sign-in-and-account-management-module-using-php.zip">click here</a> to download source code<br/></p>



<h3 class="wp-block-heading">1. Creating Database &amp; Table<br/></h3>



<p>Create a database in MySQL. For example, I&#8217;ve create database <strong>&#8220;account&#8221;</strong> for more details for creating database <a href="https://www.techdasher.com/php-mysqli-crud-1/">click here</a><br/></p>



<pre class="wp-block-preformatted">CREATE Database account</pre>



<p>Create a table <strong>&#8220;account_tb&#8221;</strong> <br/></p>



<pre class="wp-block-preformatted">CREATE TABLE account_tb(<br/>acc_id INT(20) NOT NULL AUTO_INCREMENT, <br/>acc_name VARCHAR(155) NOT NULL, <br/>acc_email  VARCHAR(155) NOT NULL, <br/>acc_password   VARCHAR(155) NOT NULL,  <br/>created_dt DATETIME NOT NULL, <br/>status INT(1) NOT NULL DEFAULT "1", <br/>primary key ( acc_id )) <br/></pre>



<p>Insert default data for login the application<br/></p>



<pre class="wp-block-preformatted">INSERT INTO <code>account_tb</code> (<br/><code>acc_id</code>, <code>acc_name</code>, <code>acc_email</code>, <code>acc_password</code>, <code>status</code>) VALUES<br/>(1, 'Admin', 'admin@admin.com', '21232f297a57a5a743894a0e4a801fc3', 1)</pre>



<h3 class="wp-block-heading">2. Config and Run <br/></h3>



<p>Extract the downloaded zip file in &#8220;<strong>html</strong> directory in wamp&#8221; (or) &#8220;<strong>htdocs</strong> directory in Xampp&#8221;. </p>



<p>Open app/config.php, change hostname, database name, username and password. run the application.<br/></p>



<p><a href="https://www.techdasher.com/wp-content/uploads/2018/10/simple-sign-in-and-account-management-module-using-php.zip">Click here</a> to download source code</p>



<h3 class="wp-block-heading">3. Output Screen<br/></h3>



<figure class="wp-block-image"><img loading="lazy" decoding="async" width="558" height="435" src="https://www.techdasher.com/wp-content/uploads/2018/10/simple-sign-in-and-account-management-module-using-php-1_signin.png" alt="" class="wp-image-254"/><figcaption>Login Page<br/>Email: admin@admin.com<br/>Password: admin</figcaption></figure>



<figure class="wp-block-image"><img loading="lazy" decoding="async" width="802" height="731" src="https://www.techdasher.com/wp-content/uploads/2018/10/simple-sign-in-and-account-management-module-using-php-2_dashboard.png" alt="" class="wp-image-255" srcset="https://www.techdasher.com/wp-content/uploads/2018/10/simple-sign-in-and-account-management-module-using-php-2_dashboard.png 802w, https://www.techdasher.com/wp-content/uploads/2018/10/simple-sign-in-and-account-management-module-using-php-2_dashboard-768x700.png 768w" sizes="auto, (max-width: 802px) 100vw, 802px" /><figcaption>Dashboard</figcaption></figure>



<figure class="wp-block-image"><img loading="lazy" decoding="async" width="897" height="731" src="https://www.techdasher.com/wp-content/uploads/2018/10/simple-sign-in-and-account-management-module-using-php-3_account.png" alt="" class="wp-image-256" srcset="https://www.techdasher.com/wp-content/uploads/2018/10/simple-sign-in-and-account-management-module-using-php-3_account.png 897w, https://www.techdasher.com/wp-content/uploads/2018/10/simple-sign-in-and-account-management-module-using-php-3_account-768x626.png 768w" sizes="auto, (max-width: 897px) 100vw, 897px" /><figcaption>View Account</figcaption></figure>



<figure class="wp-block-image"><img loading="lazy" decoding="async" width="897" height="731" src="https://www.techdasher.com/wp-content/uploads/2018/10/simple-sign-in-and-account-management-module-using-php-4_account_edit.png" alt="" class="wp-image-257" srcset="https://www.techdasher.com/wp-content/uploads/2018/10/simple-sign-in-and-account-management-module-using-php-4_account_edit.png 897w, https://www.techdasher.com/wp-content/uploads/2018/10/simple-sign-in-and-account-management-module-using-php-4_account_edit-768x626.png 768w" sizes="auto, (max-width: 897px) 100vw, 897px" /><figcaption>Update Account</figcaption></figure>



<figure class="wp-block-image"><img loading="lazy" decoding="async" width="897" height="731" src="https://www.techdasher.com/wp-content/uploads/2018/10/simple-sign-in-and-account-management-module-using-php-5_account_add.png" alt="" class="wp-image-258" srcset="https://www.techdasher.com/wp-content/uploads/2018/10/simple-sign-in-and-account-management-module-using-php-5_account_add.png 897w, https://www.techdasher.com/wp-content/uploads/2018/10/simple-sign-in-and-account-management-module-using-php-5_account_add-768x626.png 768w" sizes="auto, (max-width: 897px) 100vw, 897px" /><figcaption>Add New Account</figcaption></figure>
<div class="simplesocialbuttons simplesocial-simple-icons simplesocialbuttons_inline simplesocialbuttons-align-left post-243 post  simplesocialbuttons-inline-no-animation">
		<button class="ssb_fbshare-icon"  rel="nofollow"  target="_blank"  aria-label="Facebook Share" data-href="https://www.facebook.com/sharer/sharer.php?u=https://www.techdasher.com/simple-sign-in-and-account-management-module-using-php/" onClick="javascript:window.open(this.dataset.href, '', 'menubar=no,toolbar=no,resizable=yes,scrollbars=yes,height=600,width=600');return false;">
						<span class="icon"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" class="_1pbq" color="#ffffff"><path fill="#ffffff" fill-rule="evenodd" class="icon" d="M8 14H3.667C2.733 13.9 2 13.167 2 12.233V3.667A1.65 1.65 0 0 1 3.667 2h8.666A1.65 1.65 0 0 1 14 3.667v8.566c0 .934-.733 1.667-1.667 1.767H10v-3.967h1.3l.7-2.066h-2V6.933c0-.466.167-.9.867-.9H12v-1.8c.033 0-.933-.266-1.533-.266-1.267 0-2.434.7-2.467 2.133v1.867H6v2.066h2V14z"></path></svg></span>
						<span class="simplesocialtxt">Share </span> </button>
<button class="ssb_tweet-icon"  rel="nofollow"  target="_blank"  aria-label="Twitter Share" data-href="https://twitter.com/intent/tweet?text=Simple+Sign+in+and+Account+Management+Module+using+PHP&url=https://www.techdasher.com/simple-sign-in-and-account-management-module-using-php/&via=tech_dasher" onClick="javascript:window.open(this.dataset.href, '', 'menubar=no,toolbar=no,resizable=yes,scrollbars=yes,height=600,width=600');return false;">
						<span class="icon"><svg viewBox="0 0 16 14" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M4.9 0H0L5.782 7.7098L0.315 14H2.17L6.6416 8.8557L10.5 14H15.4L9.3744 5.9654L14.56 0H12.705L8.5148 4.8202L4.9 0ZM11.2 12.6L2.8 1.4H4.2L12.6 12.6H11.2Z" fill="#fff"/></svg></span><i class="simplesocialtxt">Post </i></button>
<button class="ssb_linkedin-icon"  rel="nofollow"  target="_blank"  aria-label="LinkedIn Share" data-href="https://www.linkedin.com/sharing/share-offsite/?url=https://www.techdasher.com/simple-sign-in-and-account-management-module-using-php/" onClick="javascript:window.open(this.dataset.href, '', 'menubar=no,toolbar=no,resizable=yes,scrollbars=yes,height=600,width=600');return false;" >
						<span class="icon"> <svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" width="15px" height="14.1px" viewBox="-301.4 387.5 15 14.1" enable-background="new -301.4 387.5 15 14.1" xml:space="preserve"> <g id="XMLID_398_"> <path id="XMLID_399_" fill="#FFFFFF" d="M-296.2,401.6c0-3.2,0-6.3,0-9.5h0.1c1,0,2,0,2.9,0c0.1,0,0.1,0,0.1,0.1c0,0.4,0,0.8,0,1.2 c0.1-0.1,0.2-0.3,0.3-0.4c0.5-0.7,1.2-1,2.1-1.1c0.8-0.1,1.5,0,2.2,0.3c0.7,0.4,1.2,0.8,1.5,1.4c0.4,0.8,0.6,1.7,0.6,2.5 c0,1.8,0,3.6,0,5.4v0.1c-1.1,0-2.1,0-3.2,0c0-0.1,0-0.1,0-0.2c0-1.6,0-3.2,0-4.8c0-0.4,0-0.8-0.2-1.2c-0.2-0.7-0.8-1-1.6-1 c-0.8,0.1-1.3,0.5-1.6,1.2c-0.1,0.2-0.1,0.5-0.1,0.8c0,1.7,0,3.4,0,5.1c0,0.2,0,0.2-0.2,0.2c-1,0-1.9,0-2.9,0 C-296.1,401.6-296.2,401.6-296.2,401.6z"/> <path id="XMLID_400_" fill="#FFFFFF" d="M-298,401.6L-298,401.6c-1.1,0-2.1,0-3,0c-0.1,0-0.1,0-0.1-0.1c0-3.1,0-6.1,0-9.2 c0-0.1,0-0.1,0.1-0.1c1,0,2,0,2.9,0h0.1C-298,395.3-298,398.5-298,401.6z"/> <path id="XMLID_401_" fill="#FFFFFF" d="M-299.6,390.9c-0.7-0.1-1.2-0.3-1.6-0.8c-0.5-0.8-0.2-2.1,1-2.4c0.6-0.2,1.2-0.1,1.8,0.2 c0.5,0.4,0.7,0.9,0.6,1.5c-0.1,0.7-0.5,1.1-1.1,1.3C-299.1,390.8-299.4,390.8-299.6,390.9L-299.6,390.9z"/> </g> </svg> </span>
						<span class="simplesocialtxt">Share</span> </button>
<div class="fb-like ssb-fb-like" aria-label="Facebook Like" data-href="https://www.techdasher.com/simple-sign-in-and-account-management-module-using-php/" data-layout="button_count" data-action="like" data-size="small" data-show-faces="false" data-share="false"></div>
</div>
<p>The post <a href="https://www.techdasher.com/simple-sign-in-and-account-management-module-using-php/">Simple Sign in and Account Management Module using PHP</a> appeared first on <a href="https://www.techdasher.com">TechDasher</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.techdasher.com/simple-sign-in-and-account-management-module-using-php/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>How to install ImageMagick (imagick) in WHM</title>
		<link>https://www.techdasher.com/how-to-install-imagemagick-imagick-in-whm/</link>
					<comments>https://www.techdasher.com/how-to-install-imagemagick-imagick-in-whm/#comments</comments>
		
		<dc:creator><![CDATA[cserajee]]></dc:creator>
		<pubDate>Fri, 12 Oct 2018 11:36:04 +0000</pubDate>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[Web]]></category>
		<category><![CDATA[WHM]]></category>
		<guid isPermaLink="false">https://www.techdasher.com/?p=240</guid>

					<description><![CDATA[<p>In this post, I will show how to install ImageMagick (imagick) in whm. ImageMagick is a software suite to perform the simple image conversions such as create, edit, compose, or convert bitmap images. It can read and write images in a variety of formats over 200 including PNG, JPEG, GIF, TIFF,&#160; PDF and SVG. Also [&#8230;]</p>
<p>The post <a href="https://www.techdasher.com/how-to-install-imagemagick-imagick-in-whm/">How to install ImageMagick (imagick) in WHM</a> appeared first on <a href="https://www.techdasher.com">TechDasher</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<p>In this post, I will show how to install ImageMagick (imagick) in whm. ImageMagick is a software suite to perform the simple image conversions such as create, edit, compose, or convert bitmap images. It can read and write images in a variety of formats over 200 including PNG, JPEG, GIF, TIFF,  PDF and SVG. Also used to resize, flip, mirror, rotate, distort, shear and transform images, adjust image colors, apply various special effects, or draw text, lines, polygons, ellipses and Bezier curves.</p>



<h4 class="wp-block-heading">Install following using RPM</h4>



<ol class="wp-block-list"><li>WHM  » Software » Install an RPM</li><li>Select  &#8220;<strong>ImageMagick</strong>&#8220;, click  <strong>install.</strong></li><li>Select  &#8220;<strong>ImageMagick-devel</strong>&#8220;, click  <strong>install.</strong></li><li>Select  &#8220;<strong>pcre-devel</strong>&#8220;, click  <strong>install.</strong></li></ol>



<h4 class="wp-block-heading">Install following using Module Installers<br/></h4>



<ol class="wp-block-list"><li>WHM  » Software » Module Installers</li><li>Click PHP Pecl &#8220;<strong>Manage</strong>&#8220;</li><li>Search &#8220;<strong>imagick</strong>&#8220;, click <strong>Go</strong>.</li><li>Finally  click  <strong>install. </strong><strong></strong></li><li><strong></strong>Restart  <strong>apache</strong>.<br/></li></ol>



<h4 class="wp-block-heading"><br/></h4>



<p></p>
<div class="simplesocialbuttons simplesocial-simple-icons simplesocialbuttons_inline simplesocialbuttons-align-left post-240 post  simplesocialbuttons-inline-no-animation">
		<button class="ssb_fbshare-icon"  rel="nofollow"  target="_blank"  aria-label="Facebook Share" data-href="https://www.facebook.com/sharer/sharer.php?u=https://www.techdasher.com/how-to-install-imagemagick-imagick-in-whm/" onClick="javascript:window.open(this.dataset.href, '', 'menubar=no,toolbar=no,resizable=yes,scrollbars=yes,height=600,width=600');return false;">
						<span class="icon"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" class="_1pbq" color="#ffffff"><path fill="#ffffff" fill-rule="evenodd" class="icon" d="M8 14H3.667C2.733 13.9 2 13.167 2 12.233V3.667A1.65 1.65 0 0 1 3.667 2h8.666A1.65 1.65 0 0 1 14 3.667v8.566c0 .934-.733 1.667-1.667 1.767H10v-3.967h1.3l.7-2.066h-2V6.933c0-.466.167-.9.867-.9H12v-1.8c.033 0-.933-.266-1.533-.266-1.267 0-2.434.7-2.467 2.133v1.867H6v2.066h2V14z"></path></svg></span>
						<span class="simplesocialtxt">Share </span> </button>
<button class="ssb_tweet-icon"  rel="nofollow"  target="_blank"  aria-label="Twitter Share" data-href="https://twitter.com/intent/tweet?text=How+to+install+ImageMagick+%28imagick%29+in+WHM&url=https://www.techdasher.com/how-to-install-imagemagick-imagick-in-whm/&via=tech_dasher" onClick="javascript:window.open(this.dataset.href, '', 'menubar=no,toolbar=no,resizable=yes,scrollbars=yes,height=600,width=600');return false;">
						<span class="icon"><svg viewBox="0 0 16 14" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M4.9 0H0L5.782 7.7098L0.315 14H2.17L6.6416 8.8557L10.5 14H15.4L9.3744 5.9654L14.56 0H12.705L8.5148 4.8202L4.9 0ZM11.2 12.6L2.8 1.4H4.2L12.6 12.6H11.2Z" fill="#fff"/></svg></span><i class="simplesocialtxt">Post </i></button>
<button class="ssb_linkedin-icon"  rel="nofollow"  target="_blank"  aria-label="LinkedIn Share" data-href="https://www.linkedin.com/sharing/share-offsite/?url=https://www.techdasher.com/how-to-install-imagemagick-imagick-in-whm/" onClick="javascript:window.open(this.dataset.href, '', 'menubar=no,toolbar=no,resizable=yes,scrollbars=yes,height=600,width=600');return false;" >
						<span class="icon"> <svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" width="15px" height="14.1px" viewBox="-301.4 387.5 15 14.1" enable-background="new -301.4 387.5 15 14.1" xml:space="preserve"> <g id="XMLID_398_"> <path id="XMLID_399_" fill="#FFFFFF" d="M-296.2,401.6c0-3.2,0-6.3,0-9.5h0.1c1,0,2,0,2.9,0c0.1,0,0.1,0,0.1,0.1c0,0.4,0,0.8,0,1.2 c0.1-0.1,0.2-0.3,0.3-0.4c0.5-0.7,1.2-1,2.1-1.1c0.8-0.1,1.5,0,2.2,0.3c0.7,0.4,1.2,0.8,1.5,1.4c0.4,0.8,0.6,1.7,0.6,2.5 c0,1.8,0,3.6,0,5.4v0.1c-1.1,0-2.1,0-3.2,0c0-0.1,0-0.1,0-0.2c0-1.6,0-3.2,0-4.8c0-0.4,0-0.8-0.2-1.2c-0.2-0.7-0.8-1-1.6-1 c-0.8,0.1-1.3,0.5-1.6,1.2c-0.1,0.2-0.1,0.5-0.1,0.8c0,1.7,0,3.4,0,5.1c0,0.2,0,0.2-0.2,0.2c-1,0-1.9,0-2.9,0 C-296.1,401.6-296.2,401.6-296.2,401.6z"/> <path id="XMLID_400_" fill="#FFFFFF" d="M-298,401.6L-298,401.6c-1.1,0-2.1,0-3,0c-0.1,0-0.1,0-0.1-0.1c0-3.1,0-6.1,0-9.2 c0-0.1,0-0.1,0.1-0.1c1,0,2,0,2.9,0h0.1C-298,395.3-298,398.5-298,401.6z"/> <path id="XMLID_401_" fill="#FFFFFF" d="M-299.6,390.9c-0.7-0.1-1.2-0.3-1.6-0.8c-0.5-0.8-0.2-2.1,1-2.4c0.6-0.2,1.2-0.1,1.8,0.2 c0.5,0.4,0.7,0.9,0.6,1.5c-0.1,0.7-0.5,1.1-1.1,1.3C-299.1,390.8-299.4,390.8-299.6,390.9L-299.6,390.9z"/> </g> </svg> </span>
						<span class="simplesocialtxt">Share</span> </button>
<div class="fb-like ssb-fb-like" aria-label="Facebook Like" data-href="https://www.techdasher.com/how-to-install-imagemagick-imagick-in-whm/" data-layout="button_count" data-action="like" data-size="small" data-show-faces="false" data-share="false"></div>
</div>
<p>The post <a href="https://www.techdasher.com/how-to-install-imagemagick-imagick-in-whm/">How to install ImageMagick (imagick) in WHM</a> appeared first on <a href="https://www.techdasher.com">TechDasher</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.techdasher.com/how-to-install-imagemagick-imagick-in-whm/feed/</wfw:commentRss>
			<slash:comments>3</slash:comments>
		
		
			</item>
	</channel>
</rss>
