[jira] Commented: (XMLRPC-101) Possibility to subclass XmlRpcSunHttpTransport for added functionality

2006-08-01 Thread Julio Francisco Veronelli (JIRA)
[ 
http://issues.apache.org/jira/browse/XMLRPC-101?page=comments#action_12425099 ] 

Julio Francisco Veronelli commented on XMLRPC-101:
--

Ok, thanks a lot for your time and guidance.

> Possibility to subclass XmlRpcSunHttpTransport for added functionality
> --
>
> Key: XMLRPC-101
> URL: http://issues.apache.org/jira/browse/XMLRPC-101
> Project: XML-RPC
>  Issue Type: Improvement
>  Components: Source
>Affects Versions: 3.0rc1
>Reporter: Julio Francisco Veronelli
> Assigned To: Jochen Wiedmann
>Priority: Trivial
> Attachments: ssl.patch, sunhttp.zip
>
>
> Could it be possible to make the URLConnection in class 
> org.apache.xmlrpc.client.XmlRpcSunHttpTransport protected instead of private? 
> That is:
> protected URLConnection conn;
> REASON:
> That way is much easier to subclass for added functionality. In particular, 
> i'm subclassing it to set a java.net.Proxy or a java.security.KeyStore used 
> for setting a SSL connection.
> In XML-RPC 3.0a1 it was easy to do, all that was needed was to subclass 
> method newConnection(). In 3.0RC1 that method is gone, and overwriting 
> sendRequest(XmlRpcRequest) is not possible, since conn is private.
> I tried also extending XmlRpcHttpTransport, but it is not possible, because 
> org.apache.xmlrpc.client.XmlRpcStreamTransport.RequestWriter is protected and 
> cannot be accessed.
> Thanks in advance.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



[jira] Commented: (XMLRPC-101) Possibility to subclass XmlRpcSunHttpTransport for added functionality

2006-08-01 Thread Jochen Wiedmann (JIRA)
[ 
http://issues.apache.org/jira/browse/XMLRPC-101?page=comments#action_12425005 ] 

Jochen Wiedmann commented on XMLRPC-101:


Ok, I'll apply this patch (most possibly with slight modifications) after 3.0 
is out.



> Possibility to subclass XmlRpcSunHttpTransport for added functionality
> --
>
> Key: XMLRPC-101
> URL: http://issues.apache.org/jira/browse/XMLRPC-101
> Project: XML-RPC
>  Issue Type: Improvement
>  Components: Source
>Affects Versions: 3.0rc1
>Reporter: Julio Francisco Veronelli
> Assigned To: Jochen Wiedmann
>Priority: Trivial
> Attachments: ssl.patch, sunhttp.zip
>
>
> Could it be possible to make the URLConnection in class 
> org.apache.xmlrpc.client.XmlRpcSunHttpTransport protected instead of private? 
> That is:
> protected URLConnection conn;
> REASON:
> That way is much easier to subclass for added functionality. In particular, 
> i'm subclassing it to set a java.net.Proxy or a java.security.KeyStore used 
> for setting a SSL connection.
> In XML-RPC 3.0a1 it was easy to do, all that was needed was to subclass 
> method newConnection(). In 3.0RC1 that method is gone, and overwriting 
> sendRequest(XmlRpcRequest) is not possible, since conn is private.
> I tried also extending XmlRpcHttpTransport, but it is not possible, because 
> org.apache.xmlrpc.client.XmlRpcStreamTransport.RequestWriter is protected and 
> cannot be accessed.
> Thanks in advance.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



[jira] Commented: (XMLRPC-101) Possibility to subclass XmlRpcSunHttpTransport for added functionality

2006-08-01 Thread Julio Francisco Veronelli (JIRA)
[ 
http://issues.apache.org/jira/browse/XMLRPC-101?page=comments#action_12424986 ] 

Julio Francisco Veronelli commented on XMLRPC-101:
--

Sorry, the example is wrong, should read:

XmlRpcTransportFactory t = new XmlRpcSun14HttpTransportFactory(pClient);

or,

XmlRpcTransportFactory t = XmlRpcSunHttpTransportFactory.getInstance(pClient);
if (t instanceof XmlRpcSun15HttpTransportFactory) { /* set proxy or ssl factory 
*/ }

As a sidenote, I'm not extending XmlRpcSunHttpTransportFactory from the other 
two factories, since they should be completely different factories from one 
another (and no unnecessary private fields are created). And as for features, 
methods can be added or deprecated from one version of Java SE to another, 
that's why XmlRpcSunHttp15TransportFactory does not extend from 
XmlRpcSun14HttpTransportFactory (same happens in XmlRpcSun15HttpTransport and 
XmlRpcSun14HttpTransport).

Cheers.

> Possibility to subclass XmlRpcSunHttpTransport for added functionality
> --
>
> Key: XMLRPC-101
> URL: http://issues.apache.org/jira/browse/XMLRPC-101
> Project: XML-RPC
>  Issue Type: Improvement
>  Components: Source
>Affects Versions: 3.0rc1
>Reporter: Julio Francisco Veronelli
> Assigned To: Jochen Wiedmann
>Priority: Trivial
> Attachments: ssl.patch, sunhttp.zip
>
>
> Could it be possible to make the URLConnection in class 
> org.apache.xmlrpc.client.XmlRpcSunHttpTransport protected instead of private? 
> That is:
> protected URLConnection conn;
> REASON:
> That way is much easier to subclass for added functionality. In particular, 
> i'm subclassing it to set a java.net.Proxy or a java.security.KeyStore used 
> for setting a SSL connection.
> In XML-RPC 3.0a1 it was easy to do, all that was needed was to subclass 
> method newConnection(). In 3.0RC1 that method is gone, and overwriting 
> sendRequest(XmlRpcRequest) is not possible, since conn is private.
> I tried also extending XmlRpcHttpTransport, but it is not possible, because 
> org.apache.xmlrpc.client.XmlRpcStreamTransport.RequestWriter is protected and 
> cannot be accessed.
> Thanks in advance.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



[jira] Commented: (XMLRPC-101) Possibility to subclass XmlRpcSunHttpTransport for added functionality

2006-08-01 Thread Steffen Pingel (JIRA)
[ 
http://issues.apache.org/jira/browse/XMLRPC-101?page=comments#action_12424831 ] 

Steffen Pingel commented on XMLRPC-101:
---

I need per connection SSL support and proxy support for XmlRpcCommonsTransport. 
Once XmlRpcSunHttpTransport has been modified I can provide corresponding 
patches for the XmlRpcCommonsTransport.

> Possibility to subclass XmlRpcSunHttpTransport for added functionality
> --
>
> Key: XMLRPC-101
> URL: http://issues.apache.org/jira/browse/XMLRPC-101
> Project: XML-RPC
>  Issue Type: Improvement
>  Components: Source
>Affects Versions: 3.0rc1
>Reporter: Julio Francisco Veronelli
> Assigned To: Jochen Wiedmann
>Priority: Trivial
> Attachments: ssl.patch
>
>
> Could it be possible to make the URLConnection in class 
> org.apache.xmlrpc.client.XmlRpcSunHttpTransport protected instead of private? 
> That is:
> protected URLConnection conn;
> REASON:
> That way is much easier to subclass for added functionality. In particular, 
> i'm subclassing it to set a java.net.Proxy or a java.security.KeyStore used 
> for setting a SSL connection.
> In XML-RPC 3.0a1 it was easy to do, all that was needed was to subclass 
> method newConnection(). In 3.0RC1 that method is gone, and overwriting 
> sendRequest(XmlRpcRequest) is not possible, since conn is private.
> I tried also extending XmlRpcHttpTransport, but it is not possible, because 
> org.apache.xmlrpc.client.XmlRpcStreamTransport.RequestWriter is protected and 
> cannot be accessed.
> Thanks in advance.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



[jira] Commented: (XMLRPC-101) Possibility to subclass XmlRpcSunHttpTransport for added functionality

2006-07-31 Thread Jochen Wiedmann (JIRA)
[ 
http://issues.apache.org/jira/browse/XMLRPC-101?page=comments#action_12424752 ] 

Jochen Wiedmann commented on XMLRPC-101:


There's nothing wrong with using Java 1.4 (or even 1.5 features), as long as 
the respective code is clearly separated. Take, for example, the 
CharSetXmlWriter. That's one important reason for using the factory approach: 
The factory allows you to check, which Java version you are running. Based on 
the check, the proper implementation will be returned.

In other words, please be so kind to modify your patch in the following manner:

- First of all, for now forget about the lite and commons classes. Sorry, that 
I haven't mentioned this earlier.
  It simplifies and reduces your work and may well be deferred until we agree 
on the interface.
- In the XmlRpcSunHttpTransportFactory, check whether one is running 1.4 or 
1.5. The check should be
  implemented by validating the existence of appropriate classes.
- Create 1.4 and 1.5 specific subclasses of XmlRpcSunHttpTransportFactory. 
These are the proper locations
  for your patches.


> Possibility to subclass XmlRpcSunHttpTransport for added functionality
> --
>
> Key: XMLRPC-101
> URL: http://issues.apache.org/jira/browse/XMLRPC-101
> Project: XML-RPC
>  Issue Type: Improvement
>  Components: Source
>Affects Versions: 3.0rc1
>Reporter: Julio Francisco Veronelli
>Priority: Trivial
> Attachments: ssl.patch
>
>
> Could it be possible to make the URLConnection in class 
> org.apache.xmlrpc.client.XmlRpcSunHttpTransport protected instead of private? 
> That is:
> protected URLConnection conn;
> REASON:
> That way is much easier to subclass for added functionality. In particular, 
> i'm subclassing it to set a java.net.Proxy or a java.security.KeyStore used 
> for setting a SSL connection.
> In XML-RPC 3.0a1 it was easy to do, all that was needed was to subclass 
> method newConnection(). In 3.0RC1 that method is gone, and overwriting 
> sendRequest(XmlRpcRequest) is not possible, since conn is private.
> I tried also extending XmlRpcHttpTransport, but it is not possible, because 
> org.apache.xmlrpc.client.XmlRpcStreamTransport.RequestWriter is protected and 
> cannot be accessed.
> Thanks in advance.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



[jira] Commented: (XMLRPC-101) Possibility to subclass XmlRpcSunHttpTransport for added functionality

2006-07-31 Thread Julio Francisco Veronelli (JIRA)
[ 
http://issues.apache.org/jira/browse/XMLRPC-101?page=comments#action_12424750 ] 

Julio Francisco Veronelli commented on XMLRPC-101:
--

Now, about the HTTP proxy thing, seems ok what you suggest. But I think there 
are a couple of problems with that:

1) The sample I gave, in which a java.net.Proxy is used requires Java 1.5 or 
later. Perhaps a XmlRpcSun15HttpTransport (and factory) could be used? Even if 
done that way, the Proxy class does not allow to set a user or password, so 
only the address would be given.

2) From what i saw, HttpClient provides a HostConfiguration.setProxy(String 
proxyHost,int proxyPort) that may be used. But, again, only the address can be 
set.

3) Finally, for the Lite transport, it's way beyond my skill how to talk 
directly to a HTTP Proxy using a socket. Sorry about that.

I think I can provide a patch for (1) and (2), but no more than that. Cheers.

> Possibility to subclass XmlRpcSunHttpTransport for added functionality
> --
>
> Key: XMLRPC-101
> URL: http://issues.apache.org/jira/browse/XMLRPC-101
> Project: XML-RPC
>  Issue Type: Improvement
>  Components: Source
>Affects Versions: 3.0rc1
>Reporter: Julio Francisco Veronelli
>Priority: Trivial
> Attachments: ssl.patch
>
>
> Could it be possible to make the URLConnection in class 
> org.apache.xmlrpc.client.XmlRpcSunHttpTransport protected instead of private? 
> That is:
> protected URLConnection conn;
> REASON:
> That way is much easier to subclass for added functionality. In particular, 
> i'm subclassing it to set a java.net.Proxy or a java.security.KeyStore used 
> for setting a SSL connection.
> In XML-RPC 3.0a1 it was easy to do, all that was needed was to subclass 
> method newConnection(). In 3.0RC1 that method is gone, and overwriting 
> sendRequest(XmlRpcRequest) is not possible, since conn is private.
> I tried also extending XmlRpcHttpTransport, but it is not possible, because 
> org.apache.xmlrpc.client.XmlRpcStreamTransport.RequestWriter is protected and 
> cannot be accessed.
> Thanks in advance.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



[jira] Commented: (XMLRPC-101) Possibility to subclass XmlRpcSunHttpTransport for added functionality

2006-07-31 Thread Julio Francisco Veronelli (JIRA)
[ 
http://issues.apache.org/jira/browse/XMLRPC-101?page=comments#action_12424741 ] 

Julio Francisco Veronelli commented on XMLRPC-101:
--

I'm tackling the SSL thingy first. Attached is a patch for setting a 
SSLSocketFactory that will be used in https connections.

XmlRpcSunHttpTransport has been modified, as well as it's factory.

XmlRpcLiteHttpTransport did not even allow https connections, but hopefully now 
they are allowed whether or not a SSLSocketFactory is given (factory also 
modified). (Also, perhaps sendRequest() should throw an Exception if 
url.getProtocol() does not return http or https?)

As for XmlRpcCommonsTransport, I could not easily find how to set a 
SSLSocketFactory, so I skipped that one.

Note that all changes require Java 1.4 or later (I don't know what if the 
minimum version is).

As a sidenote, if I'm right, the tutorial in 
http://ws.apache.org/xmlrpc/ssl.html works only in a XmlRpcSunHttpTransport. If 
true, maybe it should be warned within the tutorial.

Hope any of this helps.

> Possibility to subclass XmlRpcSunHttpTransport for added functionality
> --
>
> Key: XMLRPC-101
> URL: http://issues.apache.org/jira/browse/XMLRPC-101
> Project: XML-RPC
>  Issue Type: Improvement
>  Components: Source
>Affects Versions: 3.0rc1
>Reporter: Julio Francisco Veronelli
>Priority: Trivial
>
> Could it be possible to make the URLConnection in class 
> org.apache.xmlrpc.client.XmlRpcSunHttpTransport protected instead of private? 
> That is:
> protected URLConnection conn;
> REASON:
> That way is much easier to subclass for added functionality. In particular, 
> i'm subclassing it to set a java.net.Proxy or a java.security.KeyStore used 
> for setting a SSL connection.
> In XML-RPC 3.0a1 it was easy to do, all that was needed was to subclass 
> method newConnection(). In 3.0RC1 that method is gone, and overwriting 
> sendRequest(XmlRpcRequest) is not possible, since conn is private.
> I tried also extending XmlRpcHttpTransport, but it is not possible, because 
> org.apache.xmlrpc.client.XmlRpcStreamTransport.RequestWriter is protected and 
> cannot be accessed.
> Thanks in advance.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



[jira] Commented: (XMLRPC-101) Possibility to subclass XmlRpcSunHttpTransport for added functionality

2006-07-31 Thread Jochen Wiedmann (JIRA)
[ 
http://issues.apache.org/jira/browse/XMLRPC-101?page=comments#action_12424645 ] 

Jochen Wiedmann commented on XMLRPC-101:


I see two completely different topics here:

- The use of a proxy server is definitely of general interest and a common 
requirement.
   It can be easily picked up by the commons and the lite http transport as 
well. In
   other words, I suggest that we change this into a configurable property of 
the
   XmlRpcHttpClient. For example, the property might take an instance of the
   following class:

   public class HttpProxy {
   URL proxyURL;
   String user, password;
   }

  Are you ready to provide a patch for that?

- The use of an SSLSocketFactory is slightly different from

  http://ws.apache.org/xmlrpc/ssl.html

  As far as I can tell the basic difference is that you are setting the trust 
manager
  per connection, which is of course recommendable over a static setting. I am
  considering how this might be integrated, too. One more patch?


> Possibility to subclass XmlRpcSunHttpTransport for added functionality
> --
>
> Key: XMLRPC-101
> URL: http://issues.apache.org/jira/browse/XMLRPC-101
> Project: XML-RPC
>  Issue Type: Improvement
>  Components: Source
>Affects Versions: 3.0rc1
>Reporter: Julio Francisco Veronelli
>Priority: Trivial
>
> Could it be possible to make the URLConnection in class 
> org.apache.xmlrpc.client.XmlRpcSunHttpTransport protected instead of private? 
> That is:
> protected URLConnection conn;
> REASON:
> That way is much easier to subclass for added functionality. In particular, 
> i'm subclassing it to set a java.net.Proxy or a java.security.KeyStore used 
> for setting a SSL connection.
> In XML-RPC 3.0a1 it was easy to do, all that was needed was to subclass 
> method newConnection(). In 3.0RC1 that method is gone, and overwriting 
> sendRequest(XmlRpcRequest) is not possible, since conn is private.
> I tried also extending XmlRpcHttpTransport, but it is not possible, because 
> org.apache.xmlrpc.client.XmlRpcStreamTransport.RequestWriter is protected and 
> cannot be accessed.
> Thanks in advance.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



[jira] Commented: (XMLRPC-101) Possibility to subclass XmlRpcSunHttpTransport for added functionality

2006-07-31 Thread Julio Francisco Veronelli (JIRA)
[ 
http://issues.apache.org/jira/browse/XMLRPC-101?page=comments#action_12424598 ] 

Julio Francisco Veronelli commented on XMLRPC-101:
--

I copy the method i'm trying to overwrite as an example. I think it would be a 
nice improvement to be able to create a customized connection by overwriting a 
method in XmlRpcSunHttpTransport.

  public Object sendRequest(XmlRpcRequest pRequest) throws XmlRpcException {
XmlRpcHttpClientConfig config = 
(XmlRpcHttpClientConfig)pRequest.getConfig();
URLConnection result = null;
try {
  //TIP set trusted certificates
  if ((_sslFactory == null) && (_keystore != null)) {
TrustManagerFactory tmf = TrustManagerFactory.getInstance("SunX509");
tmf.init(_keystore);
SSLContext sslContext = SSLContext.getInstance("TLS");
sslContext.init(null,tmf.getTrustManagers(),null);
_sslFactory = sslContext.getSocketFactory();
  }
  //TIP create connection
  URL url = config.getServerURL();
  if (_proxy != null) result = url.openConnection(_proxy);
  else result = url.openConnection();
  if ((_sslFactory != null) && (result instanceof HttpsURLConnection))
((HttpsURLConnection)result).setSSLSocketFactory(_sslFactory);
  result.setUseCaches(false);
  result.setDoInput(true);
  result.setDoOutput(true);
}
catch (GeneralSecurityException ex) {
  throw new XmlRpcException("Failed to set certificate trust chain",ex);
}
catch (Exception ex) {
  throw new XmlRpcException("Failed to create URLConnection: " + 
ex.getMessage(),ex);
}
return super.sendRequest(pRequest);
  }

> Possibility to subclass XmlRpcSunHttpTransport for added functionality
> --
>
> Key: XMLRPC-101
> URL: http://issues.apache.org/jira/browse/XMLRPC-101
> Project: XML-RPC
>  Issue Type: Improvement
>  Components: Source
>Affects Versions: 3.0rc1
>Reporter: Julio Francisco Veronelli
>Priority: Trivial
>
> Could it be possible to make the URLConnection in class 
> org.apache.xmlrpc.client.XmlRpcSunHttpTransport protected instead of private? 
> That is:
> protected URLConnection conn;
> REASON:
> That way is much easier to subclass for added functionality. In particular, 
> i'm subclassing it to set a java.net.Proxy or a java.security.KeyStore used 
> for setting a SSL connection.
> In XML-RPC 3.0a1 it was easy to do, all that was needed was to subclass 
> method newConnection(). In 3.0RC1 that method is gone, and overwriting 
> sendRequest(XmlRpcRequest) is not possible, since conn is private.
> I tried also extending XmlRpcHttpTransport, but it is not possible, because 
> org.apache.xmlrpc.client.XmlRpcStreamTransport.RequestWriter is protected and 
> cannot be accessed.
> Thanks in advance.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]