<!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="https://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;">
    Re: [org.apache.cxf.ws.rm.RMInInterceptor] (default task-57) WS-ReliableMessaging is required by this endpoint.
</h3>
<span style="margin-bottom: 10px;">
    created by <a href="https://community.jboss.org/people/aupres">Joseph Hwang</a> in <i>JBoss Web Services</i> - <a href="https://community.jboss.org/message/833521#833521">View the full discussion</a>
</span>
<hr style="margin: 20px 0; border: none; background-color: #dadada; height: 1px;">

<div class="jive-rendered-content"><p>First I make Service Endpoint Interface like below,</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>package com.aaa.ws;</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>import javax.jws.WebMethod;<br/>import javax.jws.WebParam;<br/>import javax.jws.WebResult;<br/>import javax.jws.WebService;<br/>//import javax.xml.ws.soap.Addressing;</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>import org.jboss.ws.api.annotation.PolicySets;</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>@WebService<br/><a class="jive-link-anchor-small" rel="nofollow">//@Addressing(enabled=true</a>, required=false)<br/>@PolicySets({"WS-RM_Policy_spec_example", "WS-SP-EX223_WSS11_Anonymous_X509_Sign_Encrypt", "WS-Addressing"})<br/>public interface IHelloWorld {</p><p> @WebMethod<br/> @WebResult<br/> public String sayHello(@WebParam String name);<br/>}</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>,and deploy it on eclipse IDE</p><p><a href="https://community.jboss.org/servlet/JiveServlet/showImage/2-833521-21326/policy_1.jpg"><span> https://community.jboss.org/servlet/JiveServlet/downloadImage/2-833521-21326/450-428/policy_1.jpg </span></a></p><div class="mcePaste" id="_mcePaste" style="position: absolute; top: 0px; left: 0px;"></div><p><a href="https://community.jboss.org/servlet/JiveServlet/showImage/2-833521-21327/policy_2.jpg"><span> https://community.jboss.org/servlet/JiveServlet/downloadImage/2-833521-21327/450-557/policy_2.jpg </span></a></p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>Deployment is successful. The wsdl is generated successfully. The console shows the messages :</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>19:49:11,763 INFO&#160; [org.jboss.as.server.deployment] (MSC service thread 1-2) JBAS015876: Starting deployment of "WSHelloWorldEAR.ear" (runtime-name: "WSHelloWorldEAR.ear")<br/>19:49:11,904 INFO&#160; [org.jboss.as.server.deployment] (MSC service thread 1-7) JBAS015876: Starting deployment of "null" (runtime-name: "WSHelloWorld.war")<br/>19:49:13,635 INFO&#160; [org.jboss.ws.cxf.metadata] (MSC service thread 1-1) JBWS024061: Adding service endpoint metadata: id=HelloWorld<br/><span> address=</span><a class="jive-link-external-small" href="http://localhost:8080/WSHelloWorld/HelloWorld" rel="nofollow" target="_blank">http://localhost:8080/WSHelloWorld/HelloWorld</a><br/> implementor=com.aaa.ws.HelloWorld<br/><span> serviceName={</span><a class="jive-link-external-small" href="http://ws.aaa.com/" rel="nofollow" target="_blank">http://ws.aaa.com/</a><span>}HelloWorldService</span><br/><span> portName={</span><a class="jive-link-external-small" href="http://ws.aaa.com/" rel="nofollow" target="_blank">http://ws.aaa.com/</a><span>}HelloWorldPort</span><br/> annotationWsdlLocation=null<br/> wsdlLocationOverride=null<br/> mtomEnabled=false<br/><span>19:49:13,886 INFO&#160; [org.apache.cxf.service.factory.ReflectionServiceFactoryBean] (MSC service thread 1-1) Creating Service {</span><a class="jive-link-external-small" href="http://ws.aaa.com/" rel="nofollow" target="_blank">http://ws.aaa.com/</a><span>}HelloWorldService from class com.aaa.ws.IHelloWorld</span><br/>19:49:14,369 INFO&#160; [org.jboss.ws.cxf] (MSC service thread 1-1) JBWS024092: Adding BINDING policy attachment with id='WS-RM_Policy_spec_example_binding_policy' to honor requirement from interface com.aaa.ws.IHelloWorld.<br/>19:49:14,369 INFO&#160; [org.jboss.ws.cxf] (MSC service thread 1-1) JBWS024092: Adding BINDING policy attachment with id='WS-SP-EX223_binding_policy' to honor requirement from interface com.aaa.ws.IHelloWorld.<br/>19:49:14,369 INFO&#160; [org.jboss.ws.cxf] (MSC service thread 1-1) JBWS024092: Adding BINDING policy attachment with id='WS-Addressing_binding_policy' to honor requirement from interface com.aaa.ws.IHelloWorld.<br/>19:49:14,369 INFO&#160; [org.jboss.ws.cxf] (MSC service thread 1-1) JBWS024092: Adding BINDING_OPERATION_INPUT policy attachment with id='WS-SP-EX223_Binding_Operation_Input_Policy' to honor requirement from interface com.aaa.ws.IHelloWorld.<br/>19:49:14,369 INFO&#160; [org.jboss.ws.cxf] (MSC service thread 1-1) JBWS024092: Adding BINDING_OPERATION_OUTPUT policy attachment with id='WS-SP-EX223_Binding_Operation_Output_Policy' to honor requirement from interface com.aaa.ws.IHelloWorld.<br/>19:49:14,697 INFO&#160; [org.apache.cxf.endpoint.ServerImpl] (MSC service thread 1-1) Setting the server's publish address to be <a class="jive-link-external-small" href="http://localhost:8080/WSHelloWorld/HelloWorld" rel="nofollow">http://localhost:8080/WSHelloWorld/HelloWorld</a><br/>19:49:14,823 INFO&#160; [org.jboss.ws.cxf.deployment] (MSC service thread 1-1) JBWS024074: WSDL published to: file:/C:/wildfly-8.0.0.Alpha4/standalone/data/wsdl/WSHelloWorldEAR.ear/WSHelloWorld.war/HelloWorldService.wsdl<br/>19:49:14,870 INFO&#160; [org.jboss.as.webservices] (MSC service thread 1-3) JBAS015539: Starting service jboss.ws.endpoint."WSHelloWorldEAR.ear"."WSHelloWorld.war".HelloWorld<br/>19:49:15,197 INFO&#160; [org.wildfly.extension.undertow] (MSC service thread 1-8) JBAS018210: Register web context: /WSHelloWorld<br/>19:49:15,291 INFO&#160; [org.jboss.as.server] (DeploymentScanner-threads - 1) JBAS018559: Deployed "WSHelloWorldEAR.ear" (runtime-name : "WSHelloWorldEAR.ear")</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>But the problem is generating web service client codes from the wsdl which contains WS-Policy. I try to generate the client codes with Web Service Client Wizard of eclipse ide.</p><p><a href="https://community.jboss.org/servlet/JiveServlet/showImage/2-833521-21328/policy_3.jpg"><span> https://community.jboss.org/servlet/JiveServlet/downloadImage/2-833521-21328/450-428/policy_3.jpg </span></a></p><p><a href="https://community.jboss.org/servlet/JiveServlet/showImage/2-833521-21329/policy_4.jpg"><span> https://community.jboss.org/servlet/JiveServlet/downloadImage/2-833521-21329/450-409/policy_4.jpg </span></a></p><p><a href="https://community.jboss.org/servlet/JiveServlet/showImage/2-833521-21330/policy_5.jpg"><span> https://community.jboss.org/servlet/JiveServlet/downloadImage/2-833521-21330/450-473/policy_5.jpg </span></a></p><p>The client codes from the Web Service Client Wizard seems not to be applied by WS-Policy annotation.</p><p>The below client code throws many types of exceptions.</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p> HelloWorldService service = new HelloWorldService();<br/> IHelloWorld port = service.getHelloWorldPort();<br/> out.println(port.sayHello("Joseph"));</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>Is there any option which make the WS client wizard generate correct client codes with WS-Policy?</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>I need your help! </p></div>

<div style="background-color: #f4f4f4; padding: 10px; margin-top: 20px;">
    <p style="margin: 0;">Reply to this message by <a href="https://community.jboss.org/message/833521#833521">going to Community</a></p>
        <p style="margin: 0;">Start a new discussion in JBoss Web Services at <a href="https://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2044">Community</a></p>
</div></td>
                        </tr>
                    </tbody>
                </table>


                </td>
            </tr>
        </tbody>
    </table>

</div>

</body>
</html>