<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
		>
<channel>
	<title>Comments for Alexandre Saudate Blog</title>
	<atom:link href="http://alesaudate.com/comments/feed/" rel="self" type="application/rss+xml" />
	<link>http://alesaudate.com</link>
	<description>A web services and SOA specialized blog.</description>
	<lastBuildDate>Fri, 17 Feb 2012 20:52:59 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
	<item>
		<title>Comment on How to dynamically select a certificate alias when invoking web services by Bill Korb</title>
		<link>http://alesaudate.com/2010/08/09/how-to-dynamically-select-a-certificate-alias-when-invoking-web-services/#comment-117</link>
		<dc:creator><![CDATA[Bill Korb]]></dc:creator>
		<pubDate>Fri, 17 Feb 2012 20:52:59 +0000</pubDate>
		<guid isPermaLink="false">http://alesaudate.com/?p=96#comment-117</guid>
		<description><![CDATA[Alexandre,

I was looking to do exactly what you describe, and your information was very valuable, thanks. One difference is that I didn&#039;t need to use the Dispatch stuff you described - it was enough for me to get the JAX-WS request context and set the factory as my customize factory like so:

( (BindingProvider) port ).getRequestContext().put(
  &quot;com.sun.xml.internal.ws.transport.https.client.SSLSocketFactory&quot;, factory);

Thanks,
Bill]]></description>
		<content:encoded><![CDATA[<p>Alexandre,</p>
<p>I was looking to do exactly what you describe, and your information was very valuable, thanks. One difference is that I didn&#8217;t need to use the Dispatch stuff you described &#8211; it was enough for me to get the JAX-WS request context and set the factory as my customize factory like so:</p>
<p>( (BindingProvider) port ).getRequestContext().put(<br />
  &#8220;com.sun.xml.internal.ws.transport.https.client.SSLSocketFactory&#8221;, factory);</p>
<p>Thanks,<br />
Bill</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on How to develop a standalone SSL web service by alesaudate</title>
		<link>http://alesaudate.com/2010/12/08/how-to-develop-a-standalone-ssl-web-service/#comment-92</link>
		<dc:creator><![CDATA[alesaudate]]></dc:creator>
		<pubDate>Tue, 20 Sep 2011 10:49:07 +0000</pubDate>
		<guid isPermaLink="false">http://alesaudate.com/?p=133#comment-92</guid>
		<description><![CDATA[Hi, tom!

Sorry to disappoint you, but I don&#039;t know anything about this problem... it sounds like a really serious bug on the API, but anyway, I strongly recommend you to use this version only to do testing, not in the real environment. So, you really should try putting this on an application server or anything like that if you want to move this to production, OK?

Once again, sorry.]]></description>
		<content:encoded><![CDATA[<p>Hi, tom!</p>
<p>Sorry to disappoint you, but I don&#8217;t know anything about this problem&#8230; it sounds like a really serious bug on the API, but anyway, I strongly recommend you to use this version only to do testing, not in the real environment. So, you really should try putting this on an application server or anything like that if you want to move this to production, OK?</p>
<p>Once again, sorry.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on How to develop a standalone SSL web service by tom</title>
		<link>http://alesaudate.com/2010/12/08/how-to-develop-a-standalone-ssl-web-service/#comment-91</link>
		<dc:creator><![CDATA[tom]]></dc:creator>
		<pubDate>Mon, 19 Sep 2011 18:22:11 +0000</pubDate>
		<guid isPermaLink="false">http://alesaudate.com/?p=133#comment-91</guid>
		<description><![CDATA[Hi, Alexandre,

Thank you for following up on this.  I was able to resolve the problem last week.  You are absolutely right.  It was because the path for the trust store was not correct.  After that was fixed, I was able to get the SSL handshake to work.

I did run into another problem, however.  It seems like after soap operation calls from the client are returned from my web service server, the socket is kept open.  For some existing client programs, they expect to have the socket closed in order to return from their read operation.

The web service is published using Sun&#039;s built-in HttpServer package, and the Endpoint class.  Is there a way to force the server to close the socket connection after it returns a soap call?  I tried setting the system property http.keepAlive to false to no avail.

Currently I have a way around this problem, but it&#039;s not very elegant.  Essentially I get the HttpHandler object from the HttpContext after it&#039;s been created by the Endpoint.publish operation.  And I call its handle() method from another HttpHandler class I wrote, which follows it up by sending a HttpHeader with &quot;Connection&quot; set to &quot;close&quot;.  Something like this:

  HttpServer server = HttpServer.create(myInetSocketAddress, 5);
  HttpContext context = server.createContext(mySoapPath);
  Endpoint endpoint = Endpoint.create(mySoapImpl);
  endpoint.publish(context);
  MyHandler handler = new MyHandler(context.getHandler());
  server.removeContext(mySoapPath);
  server.createContext(mySoapPath, handler);
  server.start();

  private class MyHandler implements HttpHandler {
    private HttpHandler h;
    public MyHandler(HttpHandler in) {
      h = in;
    }
    public void handle(HttpExchange t) throws IOException {
      h.handle(t);
      Headers closing = t.getResponseHeaders();
      closing.set(&quot;Connection&quot;, &quot;close&quot;);
      t.sendResponseHeaders(200, 0);
      t.close();
    }
  }

It works for my current needs, but it just seems like there&#039;s got to be a better way...

Thanks again]]></description>
		<content:encoded><![CDATA[<p>Hi, Alexandre,</p>
<p>Thank you for following up on this.  I was able to resolve the problem last week.  You are absolutely right.  It was because the path for the trust store was not correct.  After that was fixed, I was able to get the SSL handshake to work.</p>
<p>I did run into another problem, however.  It seems like after soap operation calls from the client are returned from my web service server, the socket is kept open.  For some existing client programs, they expect to have the socket closed in order to return from their read operation.</p>
<p>The web service is published using Sun&#8217;s built-in HttpServer package, and the Endpoint class.  Is there a way to force the server to close the socket connection after it returns a soap call?  I tried setting the system property http.keepAlive to false to no avail.</p>
<p>Currently I have a way around this problem, but it&#8217;s not very elegant.  Essentially I get the HttpHandler object from the HttpContext after it&#8217;s been created by the Endpoint.publish operation.  And I call its handle() method from another HttpHandler class I wrote, which follows it up by sending a HttpHeader with &#8220;Connection&#8221; set to &#8220;close&#8221;.  Something like this:</p>
<p>  HttpServer server = HttpServer.create(myInetSocketAddress, 5);<br />
  HttpContext context = server.createContext(mySoapPath);<br />
  Endpoint endpoint = Endpoint.create(mySoapImpl);<br />
  endpoint.publish(context);<br />
  MyHandler handler = new MyHandler(context.getHandler());<br />
  server.removeContext(mySoapPath);<br />
  server.createContext(mySoapPath, handler);<br />
  server.start();</p>
<p>  private class MyHandler implements HttpHandler {<br />
    private HttpHandler h;<br />
    public MyHandler(HttpHandler in) {<br />
      h = in;<br />
    }<br />
    public void handle(HttpExchange t) throws IOException {<br />
      h.handle(t);<br />
      Headers closing = t.getResponseHeaders();<br />
      closing.set(&#8220;Connection&#8221;, &#8220;close&#8221;);<br />
      t.sendResponseHeaders(200, 0);<br />
      t.close();<br />
    }<br />
  }</p>
<p>It works for my current needs, but it just seems like there&#8217;s got to be a better way&#8230;</p>
<p>Thanks again</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on How to develop a standalone SSL web service by alesaudate</title>
		<link>http://alesaudate.com/2010/12/08/how-to-develop-a-standalone-ssl-web-service/#comment-90</link>
		<dc:creator><![CDATA[alesaudate]]></dc:creator>
		<pubDate>Mon, 19 Sep 2011 10:59:14 +0000</pubDate>
		<guid isPermaLink="false">http://alesaudate.com/?p=133#comment-90</guid>
		<description><![CDATA[Hi, Tom! Usually, this kind of exception happens when the system can&#039;t find the path for the certificate. What happens if set it with an absolute path?

Regards,
Alexandre]]></description>
		<content:encoded><![CDATA[<p>Hi, Tom! Usually, this kind of exception happens when the system can&#8217;t find the path for the certificate. What happens if set it with an absolute path?</p>
<p>Regards,<br />
Alexandre</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on How to develop a standalone SSL web service by tom</title>
		<link>http://alesaudate.com/2010/12/08/how-to-develop-a-standalone-ssl-web-service/#comment-88</link>
		<dc:creator><![CDATA[tom]]></dc:creator>
		<pubDate>Tue, 06 Sep 2011 23:43:28 +0000</pubDate>
		<guid isPermaLink="false">http://alesaudate.com/?p=133#comment-88</guid>
		<description><![CDATA[Hi there, 

I wrote a web service server using JAX-WS just like this here.  But I am having trouble with the client program that would access the soap port via HTTPS and SSL.  Here is what my client code looks like:


    System.setProperty(&quot;javax.net.ssl.trustStore&quot;, &quot;certificate.p12&quot;);
    System.setProperty(&quot;javax.net.ssl.trustStorePassword&quot;, &quot;password&quot;);
    System.setProperty(&quot;javax.net.ssl.trustStoreType&quot;, &quot;PKCS12&quot;);
    System.setProperty(&quot;javax.net.ssl.TrustManagerFactory.algorithm&quot;, &quot;SunX509&quot;);

    System.setProperty(&quot;javax.net.ssl.keyStore&quot;, &quot;certificate.p12&quot;);
    System.setProperty(&quot;javax.net.ssl.keyStorePassword&quot;, &quot;password&quot;);
    System.setProperty(&quot;javax.net.ssl.keyStoreType&quot;, &quot;PKCS12&quot;);
    System.setProperty(&quot;javax.net.ssl.KeyManagerFactory.algorithm&quot;, &quot;SunX509&quot;);

    URL theURL = new URL(&quot;https://192.28.1.1:8888/test/TestSoap?wsdl&quot;);
    QName theQName = new QName(&quot;http://TestSoap.test&quot;, &quot;TestSoapPortType&quot;);
    Service theService = Service.create(theURL, theQName);
    TestSoapPortType handle = theService.getPort(TestSoapPortType.class);

    handle.soapMethod(null);

But it&#039;s throwing an exception at the Service.create invocation: 
    javax.net.ssl.SSLHandshakeException: 
    sun.security.validator.ValidatorException: PKIX path building failed:
    sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target

Can you please help?]]></description>
		<content:encoded><![CDATA[<p>Hi there, </p>
<p>I wrote a web service server using JAX-WS just like this here.  But I am having trouble with the client program that would access the soap port via HTTPS and SSL.  Here is what my client code looks like:</p>
<p>    System.setProperty(&#8220;javax.net.ssl.trustStore&#8221;, &#8220;certificate.p12&#8243;);<br />
    System.setProperty(&#8220;javax.net.ssl.trustStorePassword&#8221;, &#8220;password&#8221;);<br />
    System.setProperty(&#8220;javax.net.ssl.trustStoreType&#8221;, &#8220;PKCS12&#8243;);<br />
    System.setProperty(&#8220;javax.net.ssl.TrustManagerFactory.algorithm&#8221;, &#8220;SunX509&#8243;);</p>
<p>    System.setProperty(&#8220;javax.net.ssl.keyStore&#8221;, &#8220;certificate.p12&#8243;);<br />
    System.setProperty(&#8220;javax.net.ssl.keyStorePassword&#8221;, &#8220;password&#8221;);<br />
    System.setProperty(&#8220;javax.net.ssl.keyStoreType&#8221;, &#8220;PKCS12&#8243;);<br />
    System.setProperty(&#8220;javax.net.ssl.KeyManagerFactory.algorithm&#8221;, &#8220;SunX509&#8243;);</p>
<p>    URL theURL = new URL(&#8220;https://192.28.1.1:8888/test/TestSoap?wsdl&#8221;);<br />
    QName theQName = new QName(&#8220;http://TestSoap.test&#8221;, &#8220;TestSoapPortType&#8221;);<br />
    Service theService = Service.create(theURL, theQName);<br />
    TestSoapPortType handle = theService.getPort(TestSoapPortType.class);</p>
<p>    handle.soapMethod(null);</p>
<p>But it&#8217;s throwing an exception at the Service.create invocation:<br />
    javax.net.ssl.SSLHandshakeException:<br />
    sun.security.validator.ValidatorException: PKIX path building failed:<br />
    sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target</p>
<p>Can you please help?</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on How to develop a standalone SSL web service by heniu</title>
		<link>http://alesaudate.com/2010/12/08/how-to-develop-a-standalone-ssl-web-service/#comment-79</link>
		<dc:creator><![CDATA[heniu]]></dc:creator>
		<pubDate>Mon, 02 May 2011 20:38:25 +0000</pubDate>
		<guid isPermaLink="false">http://alesaudate.com/?p=133#comment-79</guid>
		<description><![CDATA[This is quite easy to figure out (because of handy-dandy map interface of MessageContext), but I&#039;ll mention that the key name of HttpsExchange can also be:
com.sun.xml.ws.http.exchange]]></description>
		<content:encoded><![CDATA[<p>This is quite easy to figure out (because of handy-dandy map interface of MessageContext), but I&#8217;ll mention that the key name of HttpsExchange can also be:<br />
com.sun.xml.ws.http.exchange</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Quick Post: Integrating Spring and Jersey by alesaudate</title>
		<link>http://alesaudate.com/2011/02/02/quick-post-integrating-spring-and-jersey/#comment-76</link>
		<dc:creator><![CDATA[alesaudate]]></dc:creator>
		<pubDate>Fri, 11 Mar 2011 01:17:37 +0000</pubDate>
		<guid isPermaLink="false">http://alesaudate.com/?p=145#comment-76</guid>
		<description><![CDATA[Oi, Lázaro! Alteração publicada, obrigado pelo feedback!

[]´s]]></description>
		<content:encoded><![CDATA[<p>Oi, Lázaro! Alteração publicada, obrigado pelo feedback!</p>
<p>[]´s</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Quick Post: Integrating Spring and Jersey by lazaru.fm</title>
		<link>http://alesaudate.com/2011/02/02/quick-post-integrating-spring-and-jersey/#comment-75</link>
		<dc:creator><![CDATA[lazaru.fm]]></dc:creator>
		<pubDate>Thu, 10 Mar 2011 04:02:15 +0000</pubDate>
		<guid isPermaLink="false">http://alesaudate.com/?p=145#comment-75</guid>
		<description><![CDATA[muito legal, gostei e justamente o que estou tentando fazer, porem gostaria de ver a classe BaseEntity, será que vc poderia postar os fontes, no linke não contem nenhum arquivo.  desde já muito obrigado.]]></description>
		<content:encoded><![CDATA[<p>muito legal, gostei e justamente o que estou tentando fazer, porem gostaria de ver a classe BaseEntity, será que vc poderia postar os fontes, no linke não contem nenhum arquivo.  desde já muito obrigado.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on How to develop a standalone SSL web service by alesaudate</title>
		<link>http://alesaudate.com/2010/12/08/how-to-develop-a-standalone-ssl-web-service/#comment-66</link>
		<dc:creator><![CDATA[alesaudate]]></dc:creator>
		<pubDate>Sat, 12 Feb 2011 15:22:44 +0000</pubDate>
		<guid isPermaLink="false">http://alesaudate.com/?p=133#comment-66</guid>
		<description><![CDATA[Hi, Jason! It´s really nice that you figured it out on your own, congratulations! I just would like to reinforce the piece of code your shared, by letting readers know that there are two ways of getting the Web Services context. One of them is by injection:

[code language=&quot;language=&quot;java&quot;]

@Resource
private WebServiceContext context;

[/code]

And the other one is as shown in &lt;a href=&quot;http://alesaudate.com/2010/11/05/how-to-intercept-web-services-ingoingoutgoing-messages/&quot; rel=&quot;nofollow&quot;&gt;&quot;How to intercept web services ingoing/outgoing messages&lt;/a&gt;.

Once again, congratulations!]]></description>
		<content:encoded><![CDATA[<p>Hi, Jason! It´s really nice that you figured it out on your own, congratulations! I just would like to reinforce the piece of code your shared, by letting readers know that there are two ways of getting the Web Services context. One of them is by injection:</p>
<p>@Resource<br />
private WebServiceContext context;</p>
<p>And the other one is as shown in <a href="http://alesaudate.com/2010/11/05/how-to-intercept-web-services-ingoingoutgoing-messages/" rel="nofollow">&#8220;How to intercept web services ingoing/outgoing messages</a>.</p>
<p>Once again, congratulations!</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on How to develop a standalone SSL web service by jason</title>
		<link>http://alesaudate.com/2010/12/08/how-to-develop-a-standalone-ssl-web-service/#comment-65</link>
		<dc:creator><![CDATA[jason]]></dc:creator>
		<pubDate>Thu, 10 Feb 2011 19:29:29 +0000</pubDate>
		<guid isPermaLink="false">http://alesaudate.com/?p=133#comment-65</guid>
		<description><![CDATA[nvm, found it from 

MessageContext context = wsContext.getMessageContext();
HttpsExchange hse = (HttpsExchange)wsContext.getMessageContext().get(&quot;com.sun.xml.internal.ws.http.exchange&quot;);
hse.getSSLSession().getPeerPrincipal().getName();


Guess I was looking in the wrong place :)]]></description>
		<content:encoded><![CDATA[<p>nvm, found it from </p>
<p>MessageContext context = wsContext.getMessageContext();<br />
HttpsExchange hse = (HttpsExchange)wsContext.getMessageContext().get(&#8220;com.sun.xml.internal.ws.http.exchange&#8221;);<br />
hse.getSSLSession().getPeerPrincipal().getName();</p>
<p>Guess I was looking in the wrong place <img src='http://s0.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
</channel>
</rss>

