DZone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
Refcards Trend Reports
Events Video Library
Refcards
Trend Reports

Events

View Events Video Library

Zones

Culture and Methodologies Agile Career Development Methodologies Team Management
Data Engineering AI/ML Big Data Data Databases IoT
Software Design and Architecture Cloud Architecture Containers Integration Microservices Performance Security
Coding Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Culture and Methodologies
Agile Career Development Methodologies Team Management
Data Engineering
AI/ML Big Data Data Databases IoT
Software Design and Architecture
Cloud Architecture Containers Integration Microservices Performance Security
Coding
Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance
Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks

The software you build is only as secure as the code that powers it. Learn how malicious code creeps into your software supply chain.

Apache Cassandra combines the benefits of major NoSQL databases to support data management needs not covered by traditional RDBMS vendors.

Generative AI has transformed nearly every industry. How can you leverage GenAI to improve your productivity and efficiency?

Modernize your data layer. Learn how to design cloud-native database architectures to meet the evolving demands of AI and GenAI workloads.

Related

  • Consuming SOAP Service With Apache CXF and Spring
  • Web Service Testing Using Neoload
  • MuleSoft Integrate With ServiceNow
  • Deploy MuleSoft App to CloudHub2 Using GitHub Actions CI/CD Pipeline

Trending

  • Exploring Intercooler.js: Simplify AJAX With HTML Attributes
  • Cloud Security and Privacy: Best Practices to Mitigate the Risks
  • How To Introduce a New API Quickly Using Quarkus and ChatGPT
  • Docker Base Images Demystified: A Practical Guide
  1. DZone
  2. Software Design and Architecture
  3. Integration
  4. Turn WSDL Into Connector With Mulesoft SOAP Connect

Turn WSDL Into Connector With Mulesoft SOAP Connect

One of Mule's powerful features is SOAP Connect, which turns your WSDL into the connector and install in the Mule design palette within less than a few minutes.

By 
Jitendra Bafna user avatar
Jitendra Bafna
DZone Core CORE ·
Mar. 21, 17 · Tutorial
Likes (2)
Comment
Save
Tweet
Share
8.1K Views

Join the DZone community and get the full member experience.

Join For Free

SOAP Connect is a feature of DevKit that enables users to turn multiple WSDL files or fetch them dynamically into a reusable connector. This is one of the best innovative features provided by Mulesoft and is one of fastest and easiest ways of converting WSDLs into connectors. This makes life easier for developers and allows them to come up with reusable components just a few minutes.

There are certain scenarios where we need to call the same web service again and again in various integrations. Instead of consuming the web service every time, it is better to have some reusable components. Mule provides SOAP Connect to achieve reusability. Apart from reusability, it turns WSDLs into connectors within few minutes without writing any code. 

SOAP Connect vs. Web Service Consumer

This is one of the questions that arises in the mind of each developer. If there is already a pre-installed Web Service Consumer connector, then what is the need for SOAP Connect?

  • Web Service Consumer is a preinstalled connector with Anypoint Studio. It is an existing connector that you can configure to point to a WSDL location for consuming a SOAP web service.

  • SOAP Connect is a DevKit wizard that creates an Anypoint connector that connects to a specific service that can expose multiple WSDLs of the service. It provides re-usability.

For more details on Web Service Consumer, please refer one of my articles on how to consume SOAP-based web services with Mulesoft Anypoint Studio. 

Let walk through how to turn WSDL into a connector.

Installing Maven and DevKit

Download and unpack Apache Maven and set the path variable M2_Home to unpack the folder.

To use DevKit, Apache Maven must be installed on your local drive.

To confirm if Maven is properly installed on your computer, click Window > Preferences and navigate to Anypoint Studio > Maven > Test Maven Configuration.

Image title

To install DevKit, click Help > Install New Software....

Image title

Now, it will navigate you to a new screen. Click Add. Provide the Name and Location from where you have to download and install DevKit.

Image title

Click OK and then Select All. Finally, click Finish, and it will install DevKit for you.

Image title

Creating Anypoint Connector Project

Once Maven and DevKit are installed, then you are all set to turn your WSDL into a connector.

Click File > New > Anypoint Connector Project.

Image title

Now, it will open a new screen. Select SOAP Connect and click Next.

Image title

Now, you will be navigated to a new screen. Provide Connector Name as per your requirements and click Add WSDL. Once you click that, it will open a pop-up window. You can see two options: From WSDL file or URL (i.e., you can dynamically fetch the WSDL) and From Folder (i.e., local folder path to WSDL). Click OK.

Image title

Finally, click Finish and it will generate all code for you depending on WSDL.

Image title

@Connector code:

package org.mule.modules.deltaflight;

import org.mule.api.annotations.Config;
import org.mule.api.annotations.Connector;
import org.mule.modules.deltaflight.config.ConnectorConfig;

@Connector(name="delta-flight", friendlyName="DeltaFlight", minMuleVersion = "3.7")
public class DeltaFlightConnector {

    @Config
    ConnectorConfig config;

    public ConnectorConfig getConfig() {
        return config;
    }

    public void setConfig(ConnectorConfig config) {
        this.config = config;
    }

}

@WsdlProvider code:

package org.mule.modules.deltaflight.config;

import org.mule.api.annotations.Configurable;
import org.mule.api.annotations.components.WsdlProvider;
import org.mule.api.annotations.ws.WsdlServiceEndpoint;
import org.mule.api.annotations.ws.WsdlServiceRetriever;
import org.mule.devkit.api.ws.definition.DefaultServiceDefinition;
import org.mule.devkit.api.ws.definition.ServiceDefinition;
import org.mule.api.annotations.param.Default;

@WsdlProvider(friendlyName = "Configuration")
public class ConnectorConfig {

    @Configurable
    @Default("http://training.cloudhub.io/essentials/delta")
    private String endpoint;

    @WsdlServiceRetriever
    public ServiceDefinition getServiceDefinition() {
           return new DefaultServiceDefinition(
                "TicketServiceService_TicketServicePort",
                "delta",
                "http://ilt.mulesoft-training.com/essentials/delta?wsdl",
                "TicketServiceService",
                "TicketServicePort");
    }

    @WsdlServiceEndpoint
    public String getServiceEndpoint(ServiceDefinition definition) {
         return endpoint;
    }


    public String getEndpoint() {
        return endpoint;
    }

    public void setEndpoint(String endpoint) {
        this.endpoint = endpoint;
    }

}

Install or Update Connector

In explorer pane, right click on the project then select Anypoint Connector > Install Or Update. This will install your connector into Mule design palette.

Image title

Now, you can use the connector into your flow. You just need to follow this simple steps to turn your WSDL into the connector. This will hardly take a few minutes.

Conclusion

Mulesoft provides various powerful features. One of the features is SOAP Connect, which turns your WSDL into the connector and install in the Mule design palette within less than a few minutes. This can be reused across many applications. It is a very easy and intuitive way of converting the WSDL into a connector.

SOAP Web Protocols Connector (mathematics) Apache Maven Web Service MuleSoft

Opinions expressed by DZone contributors are their own.

Related

  • Consuming SOAP Service With Apache CXF and Spring
  • Web Service Testing Using Neoload
  • MuleSoft Integrate With ServiceNow
  • Deploy MuleSoft App to CloudHub2 Using GitHub Actions CI/CD Pipeline

Partner Resources

×

Comments

The likes didn't load as expected. Please refresh the page and try again.

ABOUT US

  • About DZone
  • Support and feedback
  • Community research
  • Sitemap

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • Become a Contributor
  • Core Program
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 3343 Perimeter Hill Drive
  • Suite 100
  • Nashville, TN 37211
  • support@dzone.com

Let's be friends: