<!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;">&#160;</p><p>Up to know, i think thats the way:</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</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;">&#160;</p><pre class="jive_text_macro jive_macro_code">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;actions mep="OneWay"&gt;<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;action name="request-mapper" class="org.jboss.soa.esb.test_SOAPClient.testMyRequestAction"&gt;<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;/action&gt;<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;action name="soap-wise-client-action" class="org.jboss.soa.esb.actions.soap.wise.SOAPClient"&gt;<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;property name="wsdl" value="http://172.18.112.81:8080/tst?WSDL" /&gt;<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;property name="SOAPAction" value="retrieveCdrs"/&gt;<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;property name="EndPointName" value="CdrManagerWSImplPort"/&gt;<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;property name="SmooksRequestMapper" value="smooks-request-config.xml"/&gt;<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;property name="SmooksResponseMapper" value="smooks-response-config.xml"/&gt;<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;/action&gt;<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;action name="response-mapper" class="org.jboss.soa.esb.test_SOAPClient.testResponseAction"&gt;<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;/action&gt;<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;/actions&gt;</pre><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>2. define SmooksRequestMapper and SmooksResponseMapper XMLs</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><pre class="jive_text_macro jive_macro_code">&#160;&#160;&#160; &lt;resource-config selector="org.jboss.soa.esb.SOAPClient.ExternalObject"&gt;<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;resource&gt;org.milyn.javabean.BeanPopulator&lt;/resource&gt;<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;param name="beanId"&gt;complexObject&lt;/param&gt;<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;param name="beanClass"&gt;org.jboss.soa.esb.testSOAPClient.generated.ComplexObject&lt;/param&gt;<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;param name="bindings"&gt;<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;binding property="stringField" selector="internal text" /&gt;<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;binding property="stringField" selector="internal text" /&gt;<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;binding property="stringField" selector="internal text" /&gt;<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;binding property="stringField" selector="internal text" /&gt;<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;binding property="stringField" selector="internal text" /&gt;<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;binding property="integerField" type="Integer" selector="internal number" /&gt;<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;/param&gt;<br/>&#160;&#160;&#160; &lt;/resource-config&gt;</pre><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>3. define InternalObject.class and ExternalObject.class</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><span>public class InternalObject implements Serializable { &#160;&#160;&#160;&#160;&#160;&#160;&#160; &#160;&#160;&#160;&#160;&#160;&#160;&#160; /** &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; * &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; */ &#160;&#160;&#160;&#160;&#160;&#160;&#160; private static final long serialVersionUID = -8341272228911883415L; &#160;&#160;&#160;&#160;&#160;&#160;&#160; &#160;&#160;&#160;&#160;&#160;&#160;&#160; private String text; &#160;&#160;&#160;&#160;&#160;&#160;&#160; private Integer number; &#160;&#160;&#160;&#160;&#160;&#160;&#160; public String getText() {return text;} &#160;&#160;&#160;&#160;&#160;&#160;&#160; public void setText(String text) {this.text = text;} &#160;&#160;&#160;&#160;&#160;&#160;&#160; public Integer getNumber() {return number;} &#160;&#160;&#160;&#160;&#160;&#160;&#160; public void setNumber(Integer number) {this.number = number;} &#160;&#160;&#160; }</span><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</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;">&#160;</p><p>SmooksRequestMapper and SmooksResponseMapper XMLs must have bindings like the request/response parameters ...</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>What's up with the ComplexObject?</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>4. Write a test client with the void sendMessage</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><span>&#160;&#160;&#160;&#160; ServiceInvoker deliveryAdapter = new ServiceInvoker( &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; "TESTServiceCategory", "TEST_SOAPClient"); &#160;&#160;&#160;&#160;&#160;&#160;&#160; // Create and populate the request message... &#160;&#160;&#160;&#160;&#160;&#160;&#160; Message requestMessage = MessageFactory.getInstance().getMessage( &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; MessageType.JBOSS_XML); &#160;&#160;&#160;&#160;&#160;&#160;&#160; ExternalObject external = new ExternalObject(); &#160;&#160;&#160;&#160;&#160;&#160;&#160; InternalObject internal = new InternalObject(); &#160;&#160;&#160;&#160;&#160;&#160;&#160; internal.setNumber(new Integer(1)); &#160;&#160;&#160;&#160;&#160;&#160;&#160; internal.setText(message); &#160;&#160;&#160;&#160;&#160;&#160;&#160; external.setInternal(internal); &#160;&#160;&#160;&#160;&#160;&#160;&#160; String dateString = "2007-03-07T04:27:00"; &#160;&#160;&#160;&#160;&#160;&#160;&#160; Date date = (new SimpleDateFormat(DEFAULT_DATE_FORMAT)) &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; .parse(dateString); &#160;&#160;&#160;&#160;&#160;&#160;&#160; external.setDate(date); &#160;&#160;&#160;&#160;&#160;&#160;&#160; requestMessage.getBody().add(external); &#160;&#160;&#160;&#160;&#160;&#160;&#160; // Deliver the request message synchronously - timeout after 20 &#160;&#160;&#160;&#160;&#160;&#160;&#160; // seconds... &#160;&#160;&#160;&#160;&#160;&#160;&#160; deliveryAdapter.deliverAsync(requestMessage);</span><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>I</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</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;">&#160;</p><p>Can somebody explain</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>Thanks in advance!</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</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>