SlideShare a Scribd company logo
1 of 20
How to use SOAP Component
15-12-2014
Abstract
• The main motto of this PPT is How to use
SOAP Component in our applications.
Introduction
• The Mule SOAP component is used for
publishing, consuming, and proxying of SOAP
web services within a Mule flow. Using
the SOAP component, you can also enable
Web Service Security. Apache CXF is an open
source services framework. CXF helps you
build services using frontend programming
APIs such as JAX-WS and JAX-RS.
Example
ArthematicOperations
a. Addition
b. Subtraction
c. Multiplication
1. Create .xsd (XML Schema file) file like below:
Source:
<?xml version="1.0" encoding="UTF-8"?>
<schema xmlns="http://www.w3.org/2001/XMLSchema" targetNamespace="http://www.example.org/ArthematicOperations"
xmlns:tns="http://www.example.org/ArthematicOperations" elementFormDefault="qualified">
<element name="AddRequest" type="tns:InputRequestType"></element>
<element name="AddResponse" type="tns:OutputResponseType"></element>
<element name="SubRequest" type="tns:InputRequestType"></element>
<element name="SubResponse" type="tns:OutputResponseType"></element>
<element name="MulRequest" type="tns:InputRequestType"></element>
<element name="MulResponse" type="tns:OutputResponseType"></element>
<complexType name="InputRequestType">
<sequence>
<element name="Num1" type="int"></element>
<element name="Num2" type="int"></element>
</sequence>
</complexType>
<complexType name="OutputResponseType">
<sequence>
<element name="Result" type="int"></element>
</sequence>
</complexType>
</schema>
2. Create WSDL file like below:
Source:
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<wsdl:definitions xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tns="http://www.example.org/ArthematicOperations/"
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="ArthematicOperations"
targetNamespace="http://www.example.org/ArthematicOperations/" xmlns:xsd1="http://www.example.org/ArthematicOperations">
<wsdl:types>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<xsd:import
namespace="http://www.example.org/ArthematicOperations"
schemaLocation="ArthematicOperations.xsd">
</xsd:import></xsd:schema></wsdl:types>
<wsdl:message name="AdditionRequest">
<wsdl:part element="xsd1:AddRequest" name="AddRequest"/>
</wsdl:message>
<wsdl:message name="AdditionResponse">
<wsdl:part element="xsd1:AddResponse" name="AddResponse"/>
</wsdl:message>
<wsdl:message name="SubractionRequest">
<wsdl:part name="SubRequest" element="xsd1:SubRequest"></wsdl:part>
</wsdl:message>
<wsdl:message name="SubractionResponse">
<wsdl:part name="SubResponse" element="xsd1:SubResponse"></wsdl:part>
</wsdl:message>
<wsdl:message name="MultiplacationRequest">
<wsdl:part name="MulRequest" element="xsd1:MulRequest"></wsdl:part>
</wsdl:message>
<wsdl:message name="MultiplacationResponse">
<wsdl:part name="MulResponse" element="xsd1:MulResponse"></wsdl:part>
</wsdl:message>
<wsdl:portType name="ArthematicOperations">
<wsdl:operation name="Addition">
<wsdl:input message="tns:AdditionRequest"/>
<wsdl:output message="tns:AdditionResponse"/>
</wsdl:operation>
<wsdl:operation name="Subraction">
<wsdl:input message="tns:SubractionRequest"></wsdl:input>
<wsdl:output message="tns:SubractionResponse"></wsdl:output>
</wsdl:operation>
<wsdl:operation name="Multiplacation">
<wsdl:input message="tns:MultiplacationRequest"></wsdl:input>
<wsdl:output message="tns:MultiplacationResponse"></wsdl:output>
</wsdl:operation>
</wsdl:portType>
<wsdl:binding name="ArthematicOperationsSOAP" type="tns:ArthematicOperations">
<soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
<wsdl:operation name="Addition">
<soap:operation soapAction="http://www.example.org/ArthematicOperations/Addition"/>
<wsdl:input>
<soap:body use="literal" parts="AddRequest "/>
</wsdl:input>
<wsdl:output>
<soap:body use="literal" parts="AddResponse "/>
</wsdl:output>
</wsdl:operation>
<wsdl:operation name="Subraction">
<soap:operation soapAction="http://www.example.org/ArthematicOperations/Subraction"/>
<wsdl:input>
<soap:body use="literal" parts="SubRequest "/>
</wsdl:input>
<wsdl:output>
<soap:body use="literal" parts="SubResponse "/>
</wsdl:output>
</wsdl:operation>
<wsdl:operation name="Multiplacation">
<soap:operation
soapAction="http://www.example.org/ArthematicOperations/Multiplacation"/>
<wsdl:input>
<soap:body use="literal" parts="MulRequest "/>
</wsdl:input>
<wsdl:output>
<soap:body use="literal" parts="MulResponse "/>
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
<wsdl:service name="ArthematicOperations">
<wsdl:port binding="tns:ArthematicOperationsSOAP"
name="ArthematicOperationsSOAP">
<soap:address location="http://www.example.org/"/>
</wsdl:port>
</wsdl:service>
</wsdl:definitions>
3. Convert the above .WSDL to .java files using
apache cxf
4. Mule application:
5. Copy the step-3 result into srcmainjava
folder.
6. Add the interface name (will be in step-3
result) in SOAP component.
7. Create interface implement class
package com.impl;
import javax.jws.WebMethod;
import javax.jws.WebParam;
import javax.jws.WebResult;
import org.example.arthematicoperations.ArthematicOperations;
import org.example.arthematicoperations.InputRequestType;
import org.example.arthematicoperations.OutputResponseType;
public class ArthematicOperationsImpl implements ArthematicOperations {
@Override
@WebResult(name="SubResponse", targetNamespace="http://www.example.org/ArthematicOperations", partName="SubResponse")
@WebMethod(operationName="Subraction", action="http://www.example.org/ArthematicOperations/Subraction")
public OutputResponseType subraction(@WebParam(partName="SubRequest", name="SubRequest",
targetNamespace="http://www.example.org/ArthematicOperations")
InputRequestType subRequest) {
OutputResponseType outputResponseType = new OutputResponseType();
outputResponseType.setResult(subRequest.getNum1()-subRequest.getNum2());
return outputResponseType;
}
@Override
@WebResult(name="AddResponse", targetNamespace="http://www.example.org/ArthematicOperations", partName="AddResponse")
@WebMethod(operationName="Addition", action="http://www.example.org/ArthematicOperations/Addition")
public OutputResponseType addition(@WebParam(partName="AddRequest", name="AddRequest", targetNamespace="http://www.example.org/ArthematicOperations")
InputRequestType addRequest) {
OutputResponseType outputResponseType = new OutputResponseType();
outputResponseType.setResult(addRequest.getNum1()+addRequest.getNum2());
return outputResponseType;
}
@Override
@WebResult(name="MulResponse", targetNamespace="http://www.example.org/ArthematicOperations", partName="MulResponse")
@WebMethod(operationName="Multiplacation", action="http://www.example.org/ArthematicOperations/Multiplacation")
public OutputResponseType multiplacation(@WebParam(partName="MulRequest", name="MulRequest",
targetNamespace="http://www.example.org/ArthematicOperations")
InputRequestType mulRequest) {
OutputResponseType outputResponseType = new OutputResponseType();
outputResponseType.setResult(mulRequest.getNum1()*mulRequest.getNum2());
return outputResponseType;
}
}
.mflow
<?xml version="1.0" encoding="UTF-8"?>
<mule xmlns:http="http://www.mulesoft.org/schema/mule/http"
xmlns:cxf="http://www.mulesoft.org/schema/mule/cxf" xmlns="http://www.mulesoft.org/schema/mule/core"
xmlns:doc="http://www.mulesoft.org/schema/mule/documentation"
xmlns:spring="http://www.springframework.org/schema/beans" version="EE-3.4.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-current.xsd
http://www.mulesoft.org/schema/mule/core http://www.mulesoft.org/schema/mule/core/current/mule.xsd
http://www.mulesoft.org/schema/mule/http http://www.mulesoft.org/schema/mule/http/current/mule-http.xsd
http://www.mulesoft.org/schema/mule/cxf http://www.mulesoft.org/schema/mule/cxf/current/mule-cxf.xsd">
<flow name="SOAPPOCFlow1" doc:name="SOAPPOCFlow1">
<http:inbound-endpoint exchange-pattern="request-response" host="localhost" port="8095" doc:name="HTTP"/>
<logger message="--Entered into the flow" level="INFO" doc:name="Logger"/>
<cxf:jaxws-service serviceClass="org.example.arthematicoperations.ArthematicOperations" doc:name="SOAP"/>
<component class="com.impl.ArthematicOperationsImpl" doc:name="ArthematicOperationsImpl"/>
</flow>
</mule>
8. How to test this?
a. Open SOAP UI and import the above wsdl
into it.
File->New SOAP UI Project-> Fill Project Name and Initial WSDL fields->OK
b. Trigger the methods:
1. Addition:
• Console:
INFO 2015-12-15 15:32:29,311 [main] org.mule.DefaultMuleContext:
**********************************************************************
* Application: SOAPPOC *
* OS encoding: Cp1252, Mule encoding: UTF-8 *
* *
* Agents Running: *
* Clustering Agent *
* JMX Agent *
**********************************************************************
INFO 2015-12-15 15:32:29,313 [main]
org.mule.module.launcher.MuleDeploymentService:
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+ Started app 'SOAPPOC' +
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
INFO 2015-12-15 15:32:44,490 [[SOAPPOC].connector.http.mule.default.receiver.02]
org.mule.api.processor.LoggerMessageProcessor: --Entered into the flow
References
• https://docs.mulesoft.com/mule-user-
guide/v/3.7/publishing-and-consuming-apis-
with-mule

More Related Content

What's hot

LvivPy - Flask in details
LvivPy - Flask in detailsLvivPy - Flask in details
LvivPy - Flask in detailsMax Klymyshyn
 
REST APIs in Laravel 101
REST APIs in Laravel 101REST APIs in Laravel 101
REST APIs in Laravel 101Samantha Geitz
 
Service Oriented Integration with ServiceMix
Service Oriented Integration with ServiceMixService Oriented Integration with ServiceMix
Service Oriented Integration with ServiceMixghessler
 
Stateful SOAP Webservices
Stateful SOAP WebservicesStateful SOAP Webservices
Stateful SOAP WebservicesMayflower GmbH
 
Multi Client Development with Spring
Multi Client Development with SpringMulti Client Development with Spring
Multi Client Development with SpringJoshua Long
 
Spring boot for buidling microservices
Spring boot for buidling microservicesSpring boot for buidling microservices
Spring boot for buidling microservicesNilanjan Roy
 
API Development with Laravel
API Development with LaravelAPI Development with Laravel
API Development with LaravelMichael Peacock
 
Python Flask Tutorial For Beginners | Flask Web Development Tutorial | Python...
Python Flask Tutorial For Beginners | Flask Web Development Tutorial | Python...Python Flask Tutorial For Beginners | Flask Web Development Tutorial | Python...
Python Flask Tutorial For Beginners | Flask Web Development Tutorial | Python...Edureka!
 
RESTful API development in Laravel 4 - Christopher Pecoraro
RESTful API development in Laravel 4 - Christopher PecoraroRESTful API development in Laravel 4 - Christopher Pecoraro
RESTful API development in Laravel 4 - Christopher PecoraroChristopher Pecoraro
 
Power Shell and Sharepoint 2013
Power Shell and Sharepoint 2013Power Shell and Sharepoint 2013
Power Shell and Sharepoint 2013Mohan Arumugam
 
Ruby On Rails Seminar Basis Softexpo Feb2010
Ruby On Rails Seminar Basis Softexpo Feb2010Ruby On Rails Seminar Basis Softexpo Feb2010
Ruby On Rails Seminar Basis Softexpo Feb2010arif44
 
Flask patterns
Flask patternsFlask patterns
Flask patternsit-people
 
Learn flask in 90mins
Learn flask in 90minsLearn flask in 90mins
Learn flask in 90minsLarry Cai
 
Interoperable Web Services with JAX-WS and WSIT
Interoperable Web Services with JAX-WS and WSITInteroperable Web Services with JAX-WS and WSIT
Interoperable Web Services with JAX-WS and WSITCarol McDonald
 

What's hot (20)

Symfony3 w duecie z Vue.js
Symfony3 w duecie z Vue.jsSymfony3 w duecie z Vue.js
Symfony3 w duecie z Vue.js
 
LvivPy - Flask in details
LvivPy - Flask in detailsLvivPy - Flask in details
LvivPy - Flask in details
 
Kyiv.py #17 Flask talk
Kyiv.py #17 Flask talkKyiv.py #17 Flask talk
Kyiv.py #17 Flask talk
 
REST APIs in Laravel 101
REST APIs in Laravel 101REST APIs in Laravel 101
REST APIs in Laravel 101
 
Presentation laravel 5 4
Presentation laravel 5 4Presentation laravel 5 4
Presentation laravel 5 4
 
Spring data jpa simple example_스프링학원/자바학원추천/구로IT학원/자바학원
Spring data jpa simple example_스프링학원/자바학원추천/구로IT학원/자바학원Spring data jpa simple example_스프링학원/자바학원추천/구로IT학원/자바학원
Spring data jpa simple example_스프링학원/자바학원추천/구로IT학원/자바학원
 
Service Oriented Integration with ServiceMix
Service Oriented Integration with ServiceMixService Oriented Integration with ServiceMix
Service Oriented Integration with ServiceMix
 
Apache servicemix1
Apache servicemix1Apache servicemix1
Apache servicemix1
 
Stateful SOAP Webservices
Stateful SOAP WebservicesStateful SOAP Webservices
Stateful SOAP Webservices
 
Multi Client Development with Spring
Multi Client Development with SpringMulti Client Development with Spring
Multi Client Development with Spring
 
Spring boot for buidling microservices
Spring boot for buidling microservicesSpring boot for buidling microservices
Spring boot for buidling microservices
 
API Development with Laravel
API Development with LaravelAPI Development with Laravel
API Development with Laravel
 
Python Flask Tutorial For Beginners | Flask Web Development Tutorial | Python...
Python Flask Tutorial For Beginners | Flask Web Development Tutorial | Python...Python Flask Tutorial For Beginners | Flask Web Development Tutorial | Python...
Python Flask Tutorial For Beginners | Flask Web Development Tutorial | Python...
 
RESTful API development in Laravel 4 - Christopher Pecoraro
RESTful API development in Laravel 4 - Christopher PecoraroRESTful API development in Laravel 4 - Christopher Pecoraro
RESTful API development in Laravel 4 - Christopher Pecoraro
 
Power Shell and Sharepoint 2013
Power Shell and Sharepoint 2013Power Shell and Sharepoint 2013
Power Shell and Sharepoint 2013
 
URLProtocol
URLProtocolURLProtocol
URLProtocol
 
Ruby On Rails Seminar Basis Softexpo Feb2010
Ruby On Rails Seminar Basis Softexpo Feb2010Ruby On Rails Seminar Basis Softexpo Feb2010
Ruby On Rails Seminar Basis Softexpo Feb2010
 
Flask patterns
Flask patternsFlask patterns
Flask patterns
 
Learn flask in 90mins
Learn flask in 90minsLearn flask in 90mins
Learn flask in 90mins
 
Interoperable Web Services with JAX-WS and WSIT
Interoperable Web Services with JAX-WS and WSITInteroperable Web Services with JAX-WS and WSIT
Interoperable Web Services with JAX-WS and WSIT
 

Viewers also liked

2015年度秋学期 統計学 第2回 統計資料の収集と読み方 (2015. 10. 7)
2015年度秋学期 統計学 第2回 統計資料の収集と読み方 (2015. 10. 7) 2015年度秋学期 統計学 第2回 統計資料の収集と読み方 (2015. 10. 7)
2015年度秋学期 統計学 第2回 統計資料の収集と読み方 (2015. 10. 7) Akira Asano
 
2015年度秋学期 統計学 第1回 イントロダクション (2015. 9. 30)
2015年度秋学期 統計学 第1回 イントロダクション (2015. 9. 30) 2015年度秋学期 統計学 第1回 イントロダクション (2015. 9. 30)
2015年度秋学期 統計学 第1回 イントロダクション (2015. 9. 30) Akira Asano
 
Kata pengantar
Kata pengantarKata pengantar
Kata pengantarRion Putra
 
2015年度秋学期 統計学 第7回 データの関係を知る(2) ― 回帰と決定係数 (2015. 11. 18)
2015年度秋学期 統計学 第7回 データの関係を知る(2) ― 回帰と決定係数 (2015. 11. 18) 2015年度秋学期 統計学 第7回 データの関係を知る(2) ― 回帰と決定係数 (2015. 11. 18)
2015年度秋学期 統計学 第7回 データの関係を知る(2) ― 回帰と決定係数 (2015. 11. 18) Akira Asano
 
Soap guidelines
Soap guidelinesSoap guidelines
Soap guidelinesBLschum
 
The History of Soap
The History of SoapThe History of Soap
The History of SoapDeirdreShuel
 
Haemopilus,Staphylococous & Streptococcus
Haemopilus,Staphylococous & StreptococcusHaemopilus,Staphylococous & Streptococcus
Haemopilus,Staphylococous & StreptococcusAlia Najiha
 

Viewers also liked (10)

Dario andres rua tovar
Dario andres rua tovarDario andres rua tovar
Dario andres rua tovar
 
2015年度秋学期 統計学 第2回 統計資料の収集と読み方 (2015. 10. 7)
2015年度秋学期 統計学 第2回 統計資料の収集と読み方 (2015. 10. 7) 2015年度秋学期 統計学 第2回 統計資料の収集と読み方 (2015. 10. 7)
2015年度秋学期 統計学 第2回 統計資料の収集と読み方 (2015. 10. 7)
 
How to use wildcard filter
How to use wildcard filterHow to use wildcard filter
How to use wildcard filter
 
2015年度秋学期 統計学 第1回 イントロダクション (2015. 9. 30)
2015年度秋学期 統計学 第1回 イントロダクション (2015. 9. 30) 2015年度秋学期 統計学 第1回 イントロダクション (2015. 9. 30)
2015年度秋学期 統計学 第1回 イントロダクション (2015. 9. 30)
 
Kata pengantar
Kata pengantarKata pengantar
Kata pengantar
 
Team Talk Football 2
Team Talk Football 2Team Talk Football 2
Team Talk Football 2
 
2015年度秋学期 統計学 第7回 データの関係を知る(2) ― 回帰と決定係数 (2015. 11. 18)
2015年度秋学期 統計学 第7回 データの関係を知る(2) ― 回帰と決定係数 (2015. 11. 18) 2015年度秋学期 統計学 第7回 データの関係を知る(2) ― 回帰と決定係数 (2015. 11. 18)
2015年度秋学期 統計学 第7回 データの関係を知る(2) ― 回帰と決定係数 (2015. 11. 18)
 
Soap guidelines
Soap guidelinesSoap guidelines
Soap guidelines
 
The History of Soap
The History of SoapThe History of Soap
The History of Soap
 
Haemopilus,Staphylococous & Streptococcus
Haemopilus,Staphylococous & StreptococcusHaemopilus,Staphylococous & Streptococcus
Haemopilus,Staphylococous & Streptococcus
 

Similar to How to use soap component

ApacheCon NA 2010 - Building Apps with Apache Tuscany
ApacheCon NA 2010 - Building Apps with Apache TuscanyApacheCon NA 2010 - Building Apps with Apache Tuscany
ApacheCon NA 2010 - Building Apps with Apache TuscanyJean-Sebastien Delfino
 
vJUG - The JavaFX Ecosystem
vJUG - The JavaFX EcosystemvJUG - The JavaFX Ecosystem
vJUG - The JavaFX EcosystemAndres Almiray
 
[스프링/Spring교육학원,자바교육,근로자교육,실업자교육추천학원_탑크리에듀]#6.스프링프레임워크 & 마이바티스 (Spring Framew...
[스프링/Spring교육학원,자바교육,근로자교육,실업자교육추천학원_탑크리에듀]#6.스프링프레임워크 & 마이바티스 (Spring Framew...[스프링/Spring교육학원,자바교육,근로자교육,실업자교육추천학원_탑크리에듀]#6.스프링프레임워크 & 마이바티스 (Spring Framew...
[스프링/Spring교육학원,자바교육,근로자교육,실업자교육추천학원_탑크리에듀]#6.스프링프레임워크 & 마이바티스 (Spring Framew...탑크리에듀(구로디지털단지역3번출구 2분거리)
 
Laurens Van Den Oever Xopus Presentation
Laurens Van Den Oever Xopus PresentationLaurens Van Den Oever Xopus Presentation
Laurens Van Den Oever Xopus PresentationAjax Experience 2009
 
Developing RESTful WebServices using Jersey
Developing RESTful WebServices using JerseyDeveloping RESTful WebServices using Jersey
Developing RESTful WebServices using Jerseyb_kathir
 
자바 웹 개발 시작하기 (1주차 : 웹 어플리케이션 체험 실습)
자바 웹 개발 시작하기 (1주차 : 웹 어플리케이션 체험 실습)자바 웹 개발 시작하기 (1주차 : 웹 어플리케이션 체험 실습)
자바 웹 개발 시작하기 (1주차 : 웹 어플리케이션 체험 실습)DK Lee
 
JavaDo#09 Spring boot入門ハンズオン
JavaDo#09 Spring boot入門ハンズオンJavaDo#09 Spring boot入門ハンズオン
JavaDo#09 Spring boot入門ハンズオンharuki ueno
 
How to Build a Java client for SugarCRM
How to Build a Java client for SugarCRMHow to Build a Java client for SugarCRM
How to Build a Java client for SugarCRMAntonio Musarra
 
Xopus Application Framework
Xopus Application FrameworkXopus Application Framework
Xopus Application FrameworkJady Yang
 
Basic example using for each component
Basic example using for each componentBasic example using for each component
Basic example using for each componentprudhvivreddy
 
Let's play with adf 3.0
Let's play with adf 3.0Let's play with adf 3.0
Let's play with adf 3.0Eugenio Romano
 
Build Your Own CMS with Apache Sling
Build Your Own CMS with Apache SlingBuild Your Own CMS with Apache Sling
Build Your Own CMS with Apache SlingBob Paulin
 
Developing Java Web Applications
Developing Java Web ApplicationsDeveloping Java Web Applications
Developing Java Web Applicationshchen1
 
Felix HTTP - Paving the road to the future
Felix HTTP - Paving the road to the futureFelix HTTP - Paving the road to the future
Felix HTTP - Paving the road to the futureMarcel Offermans
 
Basic example using message properties component
Basic example using message properties componentBasic example using message properties component
Basic example using message properties componentprudhvivreddy
 
Red Hat Agile integration Workshop Labs
Red Hat Agile integration Workshop LabsRed Hat Agile integration Workshop Labs
Red Hat Agile integration Workshop LabsJudy Breedlove
 

Similar to How to use soap component (20)

Soap Component
Soap ComponentSoap Component
Soap Component
 
Tomcat + other things
Tomcat + other thingsTomcat + other things
Tomcat + other things
 
ApacheCon NA 2010 - Building Apps with Apache Tuscany
ApacheCon NA 2010 - Building Apps with Apache TuscanyApacheCon NA 2010 - Building Apps with Apache Tuscany
ApacheCon NA 2010 - Building Apps with Apache Tuscany
 
vJUG - The JavaFX Ecosystem
vJUG - The JavaFX EcosystemvJUG - The JavaFX Ecosystem
vJUG - The JavaFX Ecosystem
 
[스프링/Spring교육학원,자바교육,근로자교육,실업자교육추천학원_탑크리에듀]#6.스프링프레임워크 & 마이바티스 (Spring Framew...
[스프링/Spring교육학원,자바교육,근로자교육,실업자교육추천학원_탑크리에듀]#6.스프링프레임워크 & 마이바티스 (Spring Framew...[스프링/Spring교육학원,자바교육,근로자교육,실업자교육추천학원_탑크리에듀]#6.스프링프레임워크 & 마이바티스 (Spring Framew...
[스프링/Spring교육학원,자바교육,근로자교육,실업자교육추천학원_탑크리에듀]#6.스프링프레임워크 & 마이바티스 (Spring Framew...
 
Laurens Van Den Oever Xopus Presentation
Laurens Van Den Oever Xopus PresentationLaurens Van Den Oever Xopus Presentation
Laurens Van Den Oever Xopus Presentation
 
Developing RESTful WebServices using Jersey
Developing RESTful WebServices using JerseyDeveloping RESTful WebServices using Jersey
Developing RESTful WebServices using Jersey
 
자바 웹 개발 시작하기 (1주차 : 웹 어플리케이션 체험 실습)
자바 웹 개발 시작하기 (1주차 : 웹 어플리케이션 체험 실습)자바 웹 개발 시작하기 (1주차 : 웹 어플리케이션 체험 실습)
자바 웹 개발 시작하기 (1주차 : 웹 어플리케이션 체험 실습)
 
JavaEE6 my way
JavaEE6 my wayJavaEE6 my way
JavaEE6 my way
 
JavaDo#09 Spring boot入門ハンズオン
JavaDo#09 Spring boot入門ハンズオンJavaDo#09 Spring boot入門ハンズオン
JavaDo#09 Spring boot入門ハンズオン
 
How to Build a Java client for SugarCRM
How to Build a Java client for SugarCRMHow to Build a Java client for SugarCRM
How to Build a Java client for SugarCRM
 
Xopus Application Framework
Xopus Application FrameworkXopus Application Framework
Xopus Application Framework
 
Basic example using for each component
Basic example using for each componentBasic example using for each component
Basic example using for each component
 
Let's play with adf 3.0
Let's play with adf 3.0Let's play with adf 3.0
Let's play with adf 3.0
 
Build Your Own CMS with Apache Sling
Build Your Own CMS with Apache SlingBuild Your Own CMS with Apache Sling
Build Your Own CMS with Apache Sling
 
Developing Java Web Applications
Developing Java Web ApplicationsDeveloping Java Web Applications
Developing Java Web Applications
 
Felix HTTP - Paving the road to the future
Felix HTTP - Paving the road to the futureFelix HTTP - Paving the road to the future
Felix HTTP - Paving the road to the future
 
Struts 1
Struts 1Struts 1
Struts 1
 
Basic example using message properties component
Basic example using message properties componentBasic example using message properties component
Basic example using message properties component
 
Red Hat Agile integration Workshop Labs
Red Hat Agile integration Workshop LabsRed Hat Agile integration Workshop Labs
Red Hat Agile integration Workshop Labs
 

More from RaviRajuRamaKrishna (13)

Mock component in munit
Mock component in munitMock component in munit
Mock component in munit
 
Jms selector
Jms selectorJms selector
Jms selector
 
Sftplite
SftpliteSftplite
Sftplite
 
Object store
Object storeObject store
Object store
 
How to use splitter component
How to use splitter componentHow to use splitter component
How to use splitter component
 
How to use rest component
How to use rest componentHow to use rest component
How to use rest component
 
How to use salesforce cloud connector
How to use salesforce cloud connectorHow to use salesforce cloud connector
How to use salesforce cloud connector
 
How to use expression filter
How to use expression filterHow to use expression filter
How to use expression filter
 
How to use not filter
How to use not filterHow to use not filter
How to use not filter
 
How to use or filter
How to use or filterHow to use or filter
How to use or filter
 
How to use and filter
How to use and filterHow to use and filter
How to use and filter
 
How to use data mapper transformer
How to use data mapper transformerHow to use data mapper transformer
How to use data mapper transformer
 
How to use bean as datasource in database connector
How to use bean as datasource in database connectorHow to use bean as datasource in database connector
How to use bean as datasource in database connector
 

Recently uploaded

Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdf
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdfLike-prefer-love -hate+verb+ing & silent letters & citizenship text.pdf
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdfMr Bounab Samir
 
Proudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptxProudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptxthorishapillay1
 
ACC 2024 Chronicles. Cardiology. Exam.pdf
ACC 2024 Chronicles. Cardiology. Exam.pdfACC 2024 Chronicles. Cardiology. Exam.pdf
ACC 2024 Chronicles. Cardiology. Exam.pdfSpandanaRallapalli
 
Types of Journalistic Writing Grade 8.pptx
Types of Journalistic Writing Grade 8.pptxTypes of Journalistic Writing Grade 8.pptx
Types of Journalistic Writing Grade 8.pptxEyham Joco
 
ENGLISH6-Q4-W3.pptxqurter our high choom
ENGLISH6-Q4-W3.pptxqurter our high choomENGLISH6-Q4-W3.pptxqurter our high choom
ENGLISH6-Q4-W3.pptxqurter our high choomnelietumpap1
 
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptxECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptxiammrhaywood
 
Employee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxEmployee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxNirmalaLoungPoorunde1
 
Full Stack Web Development Course for Beginners
Full Stack Web Development Course  for BeginnersFull Stack Web Development Course  for Beginners
Full Stack Web Development Course for BeginnersSabitha Banu
 
Crayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon ACrayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon AUnboundStockton
 
How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17Celine George
 
Quarter 4 Peace-education.pptx Catch Up Friday
Quarter 4 Peace-education.pptx Catch Up FridayQuarter 4 Peace-education.pptx Catch Up Friday
Quarter 4 Peace-education.pptx Catch Up FridayMakMakNepo
 
EPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptxEPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptxRaymartEstabillo3
 
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdf
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdfFraming an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdf
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdfUjwalaBharambe
 
Influencing policy (training slides from Fast Track Impact)
Influencing policy (training slides from Fast Track Impact)Influencing policy (training slides from Fast Track Impact)
Influencing policy (training slides from Fast Track Impact)Mark Reed
 
Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17Celine George
 
Keynote by Prof. Wurzer at Nordex about IP-design
Keynote by Prof. Wurzer at Nordex about IP-designKeynote by Prof. Wurzer at Nordex about IP-design
Keynote by Prof. Wurzer at Nordex about IP-designMIPLM
 
Roles & Responsibilities in Pharmacovigilance
Roles & Responsibilities in PharmacovigilanceRoles & Responsibilities in Pharmacovigilance
Roles & Responsibilities in PharmacovigilanceSamikshaHamane
 
Romantic Opera MUSIC FOR GRADE NINE pptx
Romantic Opera MUSIC FOR GRADE NINE pptxRomantic Opera MUSIC FOR GRADE NINE pptx
Romantic Opera MUSIC FOR GRADE NINE pptxsqpmdrvczh
 

Recently uploaded (20)

Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdf
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdfLike-prefer-love -hate+verb+ing & silent letters & citizenship text.pdf
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdf
 
Proudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptxProudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptx
 
ACC 2024 Chronicles. Cardiology. Exam.pdf
ACC 2024 Chronicles. Cardiology. Exam.pdfACC 2024 Chronicles. Cardiology. Exam.pdf
ACC 2024 Chronicles. Cardiology. Exam.pdf
 
Types of Journalistic Writing Grade 8.pptx
Types of Journalistic Writing Grade 8.pptxTypes of Journalistic Writing Grade 8.pptx
Types of Journalistic Writing Grade 8.pptx
 
ENGLISH6-Q4-W3.pptxqurter our high choom
ENGLISH6-Q4-W3.pptxqurter our high choomENGLISH6-Q4-W3.pptxqurter our high choom
ENGLISH6-Q4-W3.pptxqurter our high choom
 
Raw materials used in Herbal Cosmetics.pptx
Raw materials used in Herbal Cosmetics.pptxRaw materials used in Herbal Cosmetics.pptx
Raw materials used in Herbal Cosmetics.pptx
 
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptxECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
 
Employee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxEmployee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptx
 
Full Stack Web Development Course for Beginners
Full Stack Web Development Course  for BeginnersFull Stack Web Development Course  for Beginners
Full Stack Web Development Course for Beginners
 
Crayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon ACrayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon A
 
How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17
 
Quarter 4 Peace-education.pptx Catch Up Friday
Quarter 4 Peace-education.pptx Catch Up FridayQuarter 4 Peace-education.pptx Catch Up Friday
Quarter 4 Peace-education.pptx Catch Up Friday
 
EPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptxEPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptx
 
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdf
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdfFraming an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdf
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdf
 
Influencing policy (training slides from Fast Track Impact)
Influencing policy (training slides from Fast Track Impact)Influencing policy (training slides from Fast Track Impact)
Influencing policy (training slides from Fast Track Impact)
 
Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17
 
TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
TataKelola dan KamSiber Kecerdasan Buatan v022.pdfTataKelola dan KamSiber Kecerdasan Buatan v022.pdf
TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
 
Keynote by Prof. Wurzer at Nordex about IP-design
Keynote by Prof. Wurzer at Nordex about IP-designKeynote by Prof. Wurzer at Nordex about IP-design
Keynote by Prof. Wurzer at Nordex about IP-design
 
Roles & Responsibilities in Pharmacovigilance
Roles & Responsibilities in PharmacovigilanceRoles & Responsibilities in Pharmacovigilance
Roles & Responsibilities in Pharmacovigilance
 
Romantic Opera MUSIC FOR GRADE NINE pptx
Romantic Opera MUSIC FOR GRADE NINE pptxRomantic Opera MUSIC FOR GRADE NINE pptx
Romantic Opera MUSIC FOR GRADE NINE pptx
 

How to use soap component

  • 1. How to use SOAP Component 15-12-2014
  • 2. Abstract • The main motto of this PPT is How to use SOAP Component in our applications.
  • 3. Introduction • The Mule SOAP component is used for publishing, consuming, and proxying of SOAP web services within a Mule flow. Using the SOAP component, you can also enable Web Service Security. Apache CXF is an open source services framework. CXF helps you build services using frontend programming APIs such as JAX-WS and JAX-RS.
  • 4. Example ArthematicOperations a. Addition b. Subtraction c. Multiplication 1. Create .xsd (XML Schema file) file like below:
  • 5.
  • 6. Source: <?xml version="1.0" encoding="UTF-8"?> <schema xmlns="http://www.w3.org/2001/XMLSchema" targetNamespace="http://www.example.org/ArthematicOperations" xmlns:tns="http://www.example.org/ArthematicOperations" elementFormDefault="qualified"> <element name="AddRequest" type="tns:InputRequestType"></element> <element name="AddResponse" type="tns:OutputResponseType"></element> <element name="SubRequest" type="tns:InputRequestType"></element> <element name="SubResponse" type="tns:OutputResponseType"></element> <element name="MulRequest" type="tns:InputRequestType"></element> <element name="MulResponse" type="tns:OutputResponseType"></element> <complexType name="InputRequestType"> <sequence> <element name="Num1" type="int"></element> <element name="Num2" type="int"></element> </sequence> </complexType> <complexType name="OutputResponseType"> <sequence> <element name="Result" type="int"></element> </sequence> </complexType> </schema>
  • 7. 2. Create WSDL file like below:
  • 8. Source: <?xml version="1.0" encoding="UTF-8" standalone="no"?> <wsdl:definitions xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tns="http://www.example.org/ArthematicOperations/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="ArthematicOperations" targetNamespace="http://www.example.org/ArthematicOperations/" xmlns:xsd1="http://www.example.org/ArthematicOperations"> <wsdl:types> <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"> <xsd:import namespace="http://www.example.org/ArthematicOperations" schemaLocation="ArthematicOperations.xsd"> </xsd:import></xsd:schema></wsdl:types> <wsdl:message name="AdditionRequest"> <wsdl:part element="xsd1:AddRequest" name="AddRequest"/> </wsdl:message> <wsdl:message name="AdditionResponse"> <wsdl:part element="xsd1:AddResponse" name="AddResponse"/> </wsdl:message> <wsdl:message name="SubractionRequest"> <wsdl:part name="SubRequest" element="xsd1:SubRequest"></wsdl:part> </wsdl:message> <wsdl:message name="SubractionResponse"> <wsdl:part name="SubResponse" element="xsd1:SubResponse"></wsdl:part> </wsdl:message> <wsdl:message name="MultiplacationRequest"> <wsdl:part name="MulRequest" element="xsd1:MulRequest"></wsdl:part> </wsdl:message> <wsdl:message name="MultiplacationResponse"> <wsdl:part name="MulResponse" element="xsd1:MulResponse"></wsdl:part> </wsdl:message> <wsdl:portType name="ArthematicOperations"> <wsdl:operation name="Addition"> <wsdl:input message="tns:AdditionRequest"/> <wsdl:output message="tns:AdditionResponse"/> </wsdl:operation>
  • 9. <wsdl:operation name="Subraction"> <wsdl:input message="tns:SubractionRequest"></wsdl:input> <wsdl:output message="tns:SubractionResponse"></wsdl:output> </wsdl:operation> <wsdl:operation name="Multiplacation"> <wsdl:input message="tns:MultiplacationRequest"></wsdl:input> <wsdl:output message="tns:MultiplacationResponse"></wsdl:output> </wsdl:operation> </wsdl:portType> <wsdl:binding name="ArthematicOperationsSOAP" type="tns:ArthematicOperations"> <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/> <wsdl:operation name="Addition"> <soap:operation soapAction="http://www.example.org/ArthematicOperations/Addition"/> <wsdl:input> <soap:body use="literal" parts="AddRequest "/> </wsdl:input> <wsdl:output> <soap:body use="literal" parts="AddResponse "/> </wsdl:output> </wsdl:operation> <wsdl:operation name="Subraction"> <soap:operation soapAction="http://www.example.org/ArthematicOperations/Subraction"/> <wsdl:input> <soap:body use="literal" parts="SubRequest "/> </wsdl:input> <wsdl:output> <soap:body use="literal" parts="SubResponse "/> </wsdl:output> </wsdl:operation>
  • 10. <wsdl:operation name="Multiplacation"> <soap:operation soapAction="http://www.example.org/ArthematicOperations/Multiplacation"/> <wsdl:input> <soap:body use="literal" parts="MulRequest "/> </wsdl:input> <wsdl:output> <soap:body use="literal" parts="MulResponse "/> </wsdl:output> </wsdl:operation> </wsdl:binding> <wsdl:service name="ArthematicOperations"> <wsdl:port binding="tns:ArthematicOperationsSOAP" name="ArthematicOperationsSOAP"> <soap:address location="http://www.example.org/"/> </wsdl:port> </wsdl:service> </wsdl:definitions>
  • 11. 3. Convert the above .WSDL to .java files using apache cxf
  • 13. 5. Copy the step-3 result into srcmainjava folder. 6. Add the interface name (will be in step-3 result) in SOAP component.
  • 14. 7. Create interface implement class
  • 15. package com.impl; import javax.jws.WebMethod; import javax.jws.WebParam; import javax.jws.WebResult; import org.example.arthematicoperations.ArthematicOperations; import org.example.arthematicoperations.InputRequestType; import org.example.arthematicoperations.OutputResponseType; public class ArthematicOperationsImpl implements ArthematicOperations { @Override @WebResult(name="SubResponse", targetNamespace="http://www.example.org/ArthematicOperations", partName="SubResponse") @WebMethod(operationName="Subraction", action="http://www.example.org/ArthematicOperations/Subraction") public OutputResponseType subraction(@WebParam(partName="SubRequest", name="SubRequest", targetNamespace="http://www.example.org/ArthematicOperations") InputRequestType subRequest) { OutputResponseType outputResponseType = new OutputResponseType(); outputResponseType.setResult(subRequest.getNum1()-subRequest.getNum2()); return outputResponseType; } @Override @WebResult(name="AddResponse", targetNamespace="http://www.example.org/ArthematicOperations", partName="AddResponse") @WebMethod(operationName="Addition", action="http://www.example.org/ArthematicOperations/Addition") public OutputResponseType addition(@WebParam(partName="AddRequest", name="AddRequest", targetNamespace="http://www.example.org/ArthematicOperations") InputRequestType addRequest) { OutputResponseType outputResponseType = new OutputResponseType(); outputResponseType.setResult(addRequest.getNum1()+addRequest.getNum2()); return outputResponseType; } @Override @WebResult(name="MulResponse", targetNamespace="http://www.example.org/ArthematicOperations", partName="MulResponse") @WebMethod(operationName="Multiplacation", action="http://www.example.org/ArthematicOperations/Multiplacation") public OutputResponseType multiplacation(@WebParam(partName="MulRequest", name="MulRequest", targetNamespace="http://www.example.org/ArthematicOperations") InputRequestType mulRequest) { OutputResponseType outputResponseType = new OutputResponseType(); outputResponseType.setResult(mulRequest.getNum1()*mulRequest.getNum2()); return outputResponseType; } }
  • 16. .mflow <?xml version="1.0" encoding="UTF-8"?> <mule xmlns:http="http://www.mulesoft.org/schema/mule/http" xmlns:cxf="http://www.mulesoft.org/schema/mule/cxf" xmlns="http://www.mulesoft.org/schema/mule/core" xmlns:doc="http://www.mulesoft.org/schema/mule/documentation" xmlns:spring="http://www.springframework.org/schema/beans" version="EE-3.4.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-current.xsd http://www.mulesoft.org/schema/mule/core http://www.mulesoft.org/schema/mule/core/current/mule.xsd http://www.mulesoft.org/schema/mule/http http://www.mulesoft.org/schema/mule/http/current/mule-http.xsd http://www.mulesoft.org/schema/mule/cxf http://www.mulesoft.org/schema/mule/cxf/current/mule-cxf.xsd"> <flow name="SOAPPOCFlow1" doc:name="SOAPPOCFlow1"> <http:inbound-endpoint exchange-pattern="request-response" host="localhost" port="8095" doc:name="HTTP"/> <logger message="--Entered into the flow" level="INFO" doc:name="Logger"/> <cxf:jaxws-service serviceClass="org.example.arthematicoperations.ArthematicOperations" doc:name="SOAP"/> <component class="com.impl.ArthematicOperationsImpl" doc:name="ArthematicOperationsImpl"/> </flow> </mule>
  • 17. 8. How to test this? a. Open SOAP UI and import the above wsdl into it. File->New SOAP UI Project-> Fill Project Name and Initial WSDL fields->OK
  • 18. b. Trigger the methods: 1. Addition:
  • 19. • Console: INFO 2015-12-15 15:32:29,311 [main] org.mule.DefaultMuleContext: ********************************************************************** * Application: SOAPPOC * * OS encoding: Cp1252, Mule encoding: UTF-8 * * * * Agents Running: * * Clustering Agent * * JMX Agent * ********************************************************************** INFO 2015-12-15 15:32:29,313 [main] org.mule.module.launcher.MuleDeploymentService: ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + Started app 'SOAPPOC' + ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ INFO 2015-12-15 15:32:44,490 [[SOAPPOC].connector.http.mule.default.receiver.02] org.mule.api.processor.LoggerMessageProcessor: --Entered into the flow