<!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;">
    https web service hangs when using wssecurity
</h3>
<span style="margin-bottom: 10px;">
    created by <a href="http://community.jboss.org/people/kerryrward">Kerry Ward</a> in <i>JBoss Web Services</i> - <a href="http://community.jboss.org/message/589063#589063">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 am having a problem with JBoss-WS native and communicating with a web service using HTTPS.&#160; I actually have two services that are having the problem.&#160; I am running JBoss 5.1.0 and JDK 6 with jbossws-native-3.2.2.GA.&#160; I have consumed the WSDL and am trying to run using wsrunclient.bat.&#160; When I run wsrunclient.bat, I hang during communication. I referenced this example</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><pre class="jive-pre"><code class="jive-code jive-java">org.jboss.test.ws.interop.nov2007.wsse.UsernameTokenHTTPSTestCase
&#160;
</code></pre><p><br/>Here is my code invoking the web service:</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><pre class="jive-pre"><code class="jive-code jive-java">ExtendedStatusService proxy = <font color="navy"><b>new</b></font> ExtendedStatusService();
ExtendedStatus webService = proxy.getExtendedStatus();
System.out.println(<font color="red">"Calling getPaymentStatus"</font>);
((StubExt)webService).setConfigName(<font color="red">"Standard WSSecurity Client"</font>);
System.setProperty(<font color="red">"javax.net.ssl.trustStore"</font>, <font color="red">"C:/jdk1.6.0_24/jre/lib/security/cacerts"</font>);
System.setProperty(<font color="red">"javax.net.ssl.trustStorePassword"</font>, <font color="red">"changeit"</font>);
System.setProperty(<font color="red">"javax.net.ssl.trustStoreType"</font>, <font color="red">"jks"</font>);
System.setProperty(<font color="red">"org.jboss.security.ignoreHttpsHost"</font>, <font color="red">"true"</font>);
ExtendedStatusResponse result = webService.getPaymentStatus(statusQuery);
System.out.println(<font color="red">"Returned from Query webservice"</font>);
&#160;
</code></pre><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>Here is the debug output:</p><div class="mcePaste" id="_mcePaste" style="position: absolute; width: 1px; height: 1px; overflow: hidden; top: 0px; left: -10000px;"><p></p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p></div><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><pre class="jive-pre"><code class="jive-code">DEBUG [main] (Logger.java:228) - Configure SOAPBinding
DEBUG [main] (Logger.java:228) - initHandlerChain: PRE
DEBUG [main] (Logger.java:228) - initHandlerChain: ENDPOINT
DEBUG [main] (Logger.java:228) - initHandlerChain: POST
DEBUG [main] (Logger.java:228) - getHandlerChain: [type=PRE,info=[service={https://www.asite.gov/pay/service}ExtendedStatusService,por
t={https://www.asite.gov/pay/service}ExtendedStatus,binding=http://schemas.xmlsoap.org/wsdl/soap/http]]
DEBUG [main] (Logger.java:228) - getHandlerChain: [type=POST,info=[service={https://www.asite.gov/pay/service}ExtendedStatusService,po
rt={https://www.asite.gov/pay/service}ExtendedStatus,binding=http://schemas.xmlsoap.org/wsdl/soap/http]]
DEBUG [main] (Logger.java:228) - getHandlerChain: [type=ENDPOINT,info=[service={https://www.asite.gov/pay/service}ExtendedStatusServic
e,port={https://www.asite.gov/pay/service}ExtendedStatus,binding=http://schemas.xmlsoap.org/wsdl/soap/http]]
DEBUG [main] (Logger.java:228) - setHandlerChain: []
DEBUG [main] (Logger.java:228) - No port configuration for: {https://www.asite.gov/pay/service}ExtendedStatus
Calling pay getPaymentStatus
DEBUG [main] (Logger.java:228) - Create new config [name=Standard WSSecurity Client,file=META-INF/standard-jaxws-client-config.xml]
DEBUG [main] (Logger.java:228) - getConfig: [name=Standard WSSecurity Client,url=META-INF/standard-jaxws-client-config.xml]
DEBUG [main] (Logger.java:228) - parse: jar:file:/C:/jboss-5.1.0.GA/client/jbossws-native-client.jar!/META-INF/standard-jaxws-client-config.
xml
DEBUG [main] (Logger.java:228) - Created parser: org.apache.xerces.jaxp.SAXParserImpl@1d162212, isNamespaceAware: true, isValidating: true,
isXIncludeAware: true
DEBUG [main] (Logger.java:228) - http://xml.org/sax/features/validation set to: true
DEBUG [main] (Logger.java:228) - http://xml.org/sax/features/namespaces set to: true
DEBUG [main] (Logger.java:228) - http://apache.org/xml/features/validation/dynamic set to: true
DEBUG [main] (Logger.java:228) - http://xml.org/sax/features/validation set to: true
DEBUG [main] (Logger.java:228) - http://apache.org/xml/features/validation/schema set to: true
DEBUG [main] (Logger.java:228) - Created parser: org.apache.xerces.jaxp.SAXParserImpl@1d162212, isNamespaceAware: true, isValidating: true,
isXIncludeAware: true
DEBUG [main] (Logger.java:228) - resolveEntity: [pub=null,sysid=file:///c:/signer.ark/src/schema/jaxws-config_2_0.xsd]
DEBUG [main] (Logger.java:228) - resolveEntity: [pub=null,sysid=file:///c:/signer.ark/src/schema/javaee_web_services_1_2.xsd]
DEBUG [main] (Logger.java:228) - resolveEntity: [pub=null,sysid=file:///c:/signer.ark/src/schema/javaee_5.xsd]
DEBUG [main] (Logger.java:228) - resolveEntity: [pub=null,sysid=http://www.w3.org/2001/xml.xsd]
DEBUG [main] (Logger.java:228) - resolveEntity: [pub=null,sysid=file:///c:/signer.ark/src/schema/javaee_web_services_client_1_2.xsd]
DEBUG [main] (Logger.java:228) - Configure EndpointMetaData
DEBUG [main] (Logger.java:228) - Added 0 PRE handlers
DEBUG [main] (Logger.java:228) - Added 0 ENDPOINT handlers
DEBUG [main] (Logger.java:228) - Added 1 POST handlers
DEBUG [main] (Logger.java:228) - initHandlerChain: PRE
DEBUG [main] (Logger.java:228) - initHandlerChain: ENDPOINT
DEBUG [main] (Logger.java:228) - initHandlerChain: POST
DEBUG [main] (Logger.java:228) - addHandler:
HandlerMetaDataJAXWS:
 type=POST
 name=WSSecurityHandlerOutbound
 class=class org.jboss.ws.extensions.security.jaxws.WSSecurityHandlerClient
 params=[]
 protocols=##SOAP11_HTTP ##SOAP11_HTTP_MTOM
 services=null
 ports=null
DEBUG [main] (Logger.java:228) - getHandlerChain: [type=PRE,info=[service={https://www.asite.gov/pay/service}ExtendedStatusService,por
t={https://www.asite.gov/pay/service}ExtendedStatus,binding=http://schemas.xmlsoap.org/wsdl/soap/http]]
DEBUG [main] (Logger.java:228) - getHandlerChain: [type=POST,info=[service={https://www.asite.gov/pay/service}ExtendedStatusService,po
rt={https://www.asite.gov/pay/service}ExtendedStatus,binding=http://schemas.xmlsoap.org/wsdl/soap/http]]
DEBUG [main] (Logger.java:228) - getHandlerChain: [type=ENDPOINT,info=[service={https://www.asite.gov/pay/service}ExtendedStatusServic
e,port={https://www.asite.gov/pay/service}ExtendedStatus,binding=http://schemas.xmlsoap.org/wsdl/soap/http]]
DEBUG [main] (Logger.java:228) - setHandlerChain: []
DEBUG [main] (Logger.java:228) - pushMessageContext: org.jboss.ws.core.jaxws.handler.SOAPMessageContextJAXWS@1d6b6c55 (Thread main)
DEBUG [main] (Logger.java:228) - setRequestParamValue: [name={https://www.asite.gov/pay/service}statusQueryBean,value=com.asite.gov
pay.extendedstatus.StatusQuery]
DEBUG [main] (Logger.java:228) - bindRequestMessage: {https://www.asite.gov/pay/service}getPaymentStatus
DEBUG [main] (Logger.java:228) - getRequestParamValue: {https://www.asite.gov/pay/service}statusQueryBean
DEBUG [main] (Logger.java:228) - transformPayloadValue: com.asite.pay.extendedstatus.StatusQuery -&gt; com.asite.pay.extendedstatus
.StatusQuery
DEBUG [main] (Logger.java:228) - Create a handler executor: []
DEBUG [main] (Logger.java:228) - Create a handler executor: []
DEBUG [main] (Logger.java:228) - Create a handler executor: [WSSecurityHandlerOutbound]
DEBUG [main] (Logger.java:228) - Enter: handleOutBoundMessage
DEBUG [main] (Logger.java:228) - Exit: handleOutBoundMessage with status: true
DEBUG [main] (Logger.java:228) - Could not find keystore url.&#160; Can not find store file for url because store url is null.
DEBUG [main] (Logger.java:228) - -----------------------------------
DEBUG [main] (Logger.java:228) - Transitioning from OBJECT_VALID to XML_VALID
DEBUG [main] (Logger.java:228) - getXMLFragment from Object [xmlType={https://www.asite.gov/pay/service}StatusQuery,javaType=class com
.asite.pay.extendedstatus.StatusQuery]
DEBUG [main] (Logger.java:228) - serialize: [xmlName={https://www.asite.gov/pay/service}statusQueryBean,xmlType={https://www.asite.
gov/pay/service}StatusQuery]
DEBUG [main] (Logger.java:228) - serialized: &lt;statusQueryBean xmlns="https://www.asite.gov/pay/service"&gt;&lt;affiliateHashId xmlns:xsi="ht
tp://www.w3.org/2001/XMLSchema-instance" xsi:nil="true"/&gt;&lt;orderId xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:nil="true"/&gt;&lt;out
erUniqueId xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:nil="true"/&gt;&lt;remoteOrderId&gt;F_100_100&lt;/remoteOrderId&gt;&lt;serviceId xmlns:xs
i="http://www.w3.org/2001/XMLSchema-instance" xsi:nil="true"/&gt;&lt;vendorId xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:nil="true"
/&gt;&lt;/statusQueryBean&gt;
DEBUG [main] (Logger.java:228) - xmlFragment: [source=&lt;statusQueryBean xmlns="https://www.asite.gov/pay/service"&gt;&lt;affiliateHashId xmln
s:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:nil="true"/&gt;&lt;orderId xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:nil="tr
ue"/&gt;&lt;outerUniqueId xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:nil="true"/&gt;&lt;remoteOrderId&gt;F_100_100&lt;/remoteOrderId&gt;&lt;serviceId
 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:nil="true"/&gt;&lt;vendorId xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:n
il="true"/&gt;&lt;/statusQueryBean&gt;]
DEBUG [main] (Logger.java:228) - -----------------------------------
Terminate batch job (Y/N)? n
</code></pre><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>Now if I edit wsrunclient.bat and remove jbossws-native-client.jar, jbossws-native-core.jar, and the lib/endorsed files then the call is successful.&#160; Here is the changes I made to the wsrunclient.bat</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><pre class="jive-pre"><code class="jive-code">rem set WSRUNCLIENT_CLASSPATH=%WSRUNCLIENT_CLASSPATH%;%JBOSS_HOME%/client/jbossws-native-client.jar
rem set WSRUNCLIENT_CLASSPATH=%WSRUNCLIENT_CLASSPATH%;%JBOSS_HOME%/client/jbossws-native-core.jar
rem "%JAVA%" %JAVA_OPTS% -Djava.endorsed.dirs="%JBOSS_ENDORSED_DIRS%" -classpath "%WSRUNCLIENT_CLASSPATH%" %ARGS%
"%JAVA%" %JAVA_OPTS% -classpath "%WSRUNCLIENT_CLASSPATH%" %ARGS%
</code></pre><p><br/>I also have to comment out the following line in the code:</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><pre class="jive-pre"><code class="jive-code jive-java">((StubExt)webService).setConfigName(<font color="red">"Standard WSSecurity Client"</font>);
</code></pre><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>Here is my successful log:</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><pre class="jive-pre"><code class="jive-code">Calling pay getPaymentStatus
Returned from Query webservice
</code></pre><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>I believe I'm not getting DEBUG statements here because I'm really not going through the JBoss wsse code.&#160; But I don't believe I need any WS Security invoked - I'm not doing authentication or any other additional security features.&#160; I just need https.&#160; I have another service that I did with JBoss 4.2.3.GA and JDK 5 that uses https and is working just fine.&#160; I tried to connect to it using JBoss 5.1.0.GA and JDK 6 and it has the same problem as my new service.</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>I need to connect to this service from within the JBoss AS, so I don't want to manipulate jbossws classpaths the way I have done when running as a client.&#160; </p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>I have run this in the debugger and can give more details about where it is hanging if necessary, but I think it is more a configuration thing, and wanted to get this out since time is passing by.&#160; Any help would be appreciated.</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/589063#589063">going to Community</a></p>
        <p style="margin: 0;">Start a new discussion in JBoss Web Services at <a href="http://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>