<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<body link="#355491" alink="#4262a1" vlink="#355491" style="background: #e2e2e2; margin: 0; padding: 20px;">
<div>
        <table cellpadding="0" bgcolor="#FFFFFF" border="0" cellspacing="0" style="border: 1px solid #dadada; margin-bottom: 30px; width: 100%; -moz-border-radius: 6px; -webkit-border-radius: 6px;">
                <tbody>
                        <tr>
                                <td>
                                        <table border="0" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF" style="border: solid 2px #ccc; background: #dadada; width: 100%; -moz-border-radius: 6px; -webkit-border-radius: 6px;">
                                                <tbody>
                                                        <tr>
                                                                <td bgcolor="#000000" valign="middle" height="58px" style="border-bottom: 1px solid #ccc; padding: 20px; -moz-border-radius-topleft: 3px; -moz-border-radius-topright: 3px; -webkit-border-top-right-radius: 5px; -webkit-border-top-left-radius: 5px;">
                                                                        <h1 style="color: #333333; font: bold 22px Arial, Helvetica, sans-serif; margin: 0; display: block !important;">
                                                                        <!-- To have a header image/logo replace the name below with your img tag -->
                                                                        <!-- Email clients will render the images when the message is read so any image -->
                                                                        <!-- must be made available on a public server, so that all recipients can load the image. -->
                                                                        <a href="http://community.jboss.org/index.jspa" style="text-decoration: none; color: #E1E1E1">JBoss Community</a></h1>
                                                                </td>
                                                        </tr>
                                                        <tr>
                                                                <td bgcolor="#FFFFFF" style="font: normal 12px Arial, Helvetica, sans-serif; color:#333333; padding: 20px; -moz-border-radius-bottomleft: 4px; -moz-border-radius-bottomright: 4px; -webkit-border-bottom-right-radius: 5px; -webkit-border-bottom-left-radius: 5px;"><h3 style="margin: 10px 0 5px; font-size: 17px; font-weight: normal;">
Is this the way to make a SOAP client, extract params and response ?
</h3>
<span style="margin-bottom: 10px;">
created by <a href="http://community.jboss.org/people/izgur">Igor JStarter</a> in <i>JBoss ESB Development</i> - <a href="http://community.jboss.org/message/562139#562139">View the full discussion</a>
</span>
<hr style="margin: 20px 0; border: none; background-color: #dadada; height: 1px;">
<div class="jive-rendered-content"><p>I'm just trying to understand how to write a SOAP client. If you can: PLEASE REPLY</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>Up to know, i think thats the way:</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>1. jboss-esb.xml with actions:request-mapper, response-mapper and a soap-wise-client-action</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><pre class="jive_text_macro jive_macro_code">            <actions mep="OneWay"><br/>                <action name="request-mapper" class="org.jboss.soa.esb.test_SOAPClient.testMyRequestAction"><br/>                </action><br/>                <action name="soap-wise-client-action" class="org.jboss.soa.esb.actions.soap.wise.SOAPClient"><br/>                    <property name="wsdl" value="http://172.18.112.81:8080/tst?WSDL" /><br/>                    <property name="SOAPAction" value="retrieveCdrs"/><br/>                    <property name="EndPointName" value="CdrManagerWSImplPort"/><br/>                    <property name="SmooksRequestMapper" value="smooks-request-config.xml"/><br/>                    <property name="SmooksResponseMapper" value="smooks-response-config.xml"/><br/>                </action><br/>                <action name="response-mapper" class="org.jboss.soa.esb.test_SOAPClient.testResponseAction"><br/>                </action><br/>            </actions></pre><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>2. define SmooksRequestMapper and SmooksResponseMapper XMLs</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><pre class="jive_text_macro jive_macro_code">    <resource-config selector="org.jboss.soa.esb.SOAPClient.ExternalObject"><br/>        <resource>org.milyn.javabean.BeanPopulator</resource><br/>        <param name="beanId">complexObject</param><br/>        <param name="beanClass">org.jboss.soa.esb.testSOAPClient.generated.ComplexObject</param><br/>        <param name="bindings"><br/>            <binding property="stringField" selector="internal text" /><br/>            <binding property="stringField" selector="internal text" /><br/>            <binding property="stringField" selector="internal text" /><br/>            <binding property="stringField" selector="internal text" /><br/>            <binding property="stringField" selector="internal text" /><br/>            <binding property="integerField" type="Integer" selector="internal number" /><br/>        </param><br/>    </resource-config></pre><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>3. define InternalObject.class and ExternalObject.class</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><span>public class InternalObject implements Serializable {                 /**          *          */         private static final long serialVersionUID = -8341272228911883415L;                 private String text;         private Integer number;         public String getText() {return text;}         public void setText(String text) {this.text = text;}         public Integer getNumber() {return number;}         public void setNumber(Integer number) {this.number = number;}     }</span><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>InternalObject should have the same parameters as the ws request.</p><p>ExternalObject should have the same parameters as the ws response.</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>SmooksRequestMapper and SmooksResponseMapper XMLs must have bindings like the request/response parameters ...</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>What's up with the ComplexObject?</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>4. Write a test client with the void sendMessage</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><span>     ServiceInvoker deliveryAdapter = new ServiceInvoker(                 "TESTServiceCategory", "TEST_SOAPClient");         // Create and populate the request message...         Message requestMessage = MessageFactory.getInstance().getMessage(                 MessageType.JBOSS_XML);         ExternalObject external = new ExternalObject();         InternalObject internal = new InternalObject();         internal.setNumber(new Integer(1));         internal.setText(message);         external.setInternal(internal);         String dateString = "2007-03-07T04:27:00";         Date date = (new SimpleDateFormat(DEFAULT_DATE_FORMAT))                 .parse(dateString);         external.setDate(date);         requestMessage.getBody().add(external);         // Deliver the request message synchronously - timeout after 20         // seconds...         deliveryAdapter.deliverAsync(requestMessage);</span><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>I</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>s this everythink what i need to do to call an external ws ?</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>Can somebody explain</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>Thanks in advance!</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>BR, Igor!</p></div>
<div style="background-color: #f4f4f4; padding: 10px; margin-top: 20px;">
<p style="margin: 0;">Reply to this message by <a href="http://community.jboss.org/message/562139#562139">going to Community</a></p>
        <p style="margin: 0;">Start a new discussion in JBoss ESB Development at <a href="http://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2032">Community</a></p>
</div></td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</div>
</body>
</html>