+ All Categories
Home > Education > Mule soap client demo

Mule soap client demo

Date post: 27-May-2015
Category:
Upload: kaj-bromose
View: 1,077 times
Download: 1 times
Share this document with a friend
Description:
Using Mule to access a WebService can be a little complicated. This slide show shows how to embed a SOAP component in a HTTP component and get the WebService response back as Mule payload properties
Popular Tags:
24
Mule SOAP Client Demo
Transcript
Page 1: Mule soap client demo

Mule SOAP Client

Demo

Page 2: Mule soap client demo

THE SERVICEA WCF service

Page 3: Mule soap client demo

Service interface

Vigtig !!!!

Page 4: Mule soap client demo

Service implementation

Page 5: Mule soap client demo

Response datatype

Page 7: Mule soap client demo

MULE CLIENT

Page 8: Mule soap client demo

The Mule Demo

• Pickup the ”Name” in a text file• Call the webservice with the ”Name”• Write the response in a text file i JSON format

Page 9: Mule soap client demo

The Flow

• Set up the flow

Page 10: Mule soap client demo

Input File

Page 11: Mule soap client demo

File to String

• The ”File-toString” is needed due to the fact that the File endpoint passes a stream – not the content of the file.

• The ”File to String” read the content from the stream into a string payload.

Page 12: Mule soap client demo

SOAP I

• The tricky part !• First you need to build the needed Java classes– Select ”JAX-WS service” as operation

Page 13: Mule soap client demo

SOAP II

• Select ”Generate from WSDL” and fill in WSDL URL and Package Name

Page 14: Mule soap client demo

SOAP III

• The trick part one– Select ”JAX-WS client” as operation and fill in info

Page 15: Mule soap client demo

SOAP IV

• Add http endpoint

Page 16: Mule soap client demo

SOAP V

• Fill in HTTP settings

Page 17: Mule soap client demo

Problems I

• HTTP returns a stream • Lets try out the File to String trick to get a

result.

Page 18: Mule soap client demo

Problems II

• Seems to work

• Lets have a look of the payload

Page 19: Mule soap client demo

Problems III

• Hmm. That is the SOAP responce – not the properties from the GreetingResponse class

Page 20: Mule soap client demo

The ”magic trick”

• You need to embed the SOAP in the HTML endpoint – has to done in XML

• Bonus – You do not need File to String anymore

Page 21: Mule soap client demo

The ”Magic” flow

Page 22: Mule soap client demo

Test I

• Voila – the GreeatingResponse object properties are now payload properties

Page 23: Mule soap client demo

Test II

• The Object to JSON result:

Page 24: Mule soap client demo

Test III

• Written to the file


Recommended