HTML to PDF / DOCX / RTF Java converter library › Forums › PD4ML v3 Archived Forums (Read Only) › Troubleshooting › PD4ML.render proxy issue
- This topic has 3 replies, 2 voices, and was last updated Sep 01, 2010
14:40:29 byPD4ML.
-
AuthorPosts
-
August 31, 2010 at 14:13#26446
Hi
We have an architecture with apache tomcat and tomcat have to pass through a proxy.
In developpement environnement with only tomcat everythning works fine. In validation environement with Apache and proxy it doesn’t work.
When we use P4ML.render with a array of url, we have noting displayed in the pdf.
When we use HttpClient (code below), the html works but we don’t have the images.
HttpState initialState = new HttpState();
// Initial set of cookies can be retrieved from persistent
// storage
// and re-created, using a persistence mechanism of choice,
Cookie mycookie = new Cookie(u.getHost(), “JSESSIONID”, sessionId, “/”, null, false);// and then added to your HTTP state instance
initialState.addCookie(mycookie);// Get HTTP client instance
HttpClient httpclient = new HttpClient();
//httpclient.getHostConfiguration().setProxyHost(new ProxyHost(“dmz-proxy”,8888));
httpclient.getHttpConnectionManager().getParams().setConnectionTimeout(300);
httpclient.setState(initialState);// RFC 2101 cookie management spec is used per default
// to parse, validate, format & match cookies
httpclient.getParams().setCookiePolicy(CookiePolicy.BROWSER_COMPATIBILITY);// Get HTTP GET method
GetMethod httpget = new GetMethod(strURL);
httpget.setFollowRedirects(true);// Execute HTTP GET
int result = httpclient.executeMethod(httpget);charset =httpget.getResponseCharSet();
string.append(new String(httpget.getResponseBody(), charset));Can you correct the problem and use httpclient for your connections ?
Regards
Kefah & Jean-Paul
September 1, 2010 at 14:01#28191Try to propagate session ID with PD4ML requests. There is an API call intended for that:
pd4ml.setCookie( “JSESSIONID”, cookieValue );
where cookieValue is something like that: “9034657927465;path=/”
September 1, 2010 at 14:20#28190Hi,
Thanks for your response.
But it is not a cookie problem, we have no problem with the session. The problem is for pd4ml to go through our proxy.best regards,
September 1, 2010 at 14:40#28192You may specify proxy server address an port with the standard way for Java applications – usin http.proxyServer and http.proxyPort environment variables.
-
AuthorPosts
The forum ‘Troubleshooting’ is closed to new topics and replies.
