PDF Generating Tool Support Forum

HOME   Login   Register    Search




  Subject: PD4ML.render proxy issue
   PostPosted: 31 Aug 2010, 16:13 
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


  Subject: Re: PD4ML.render proxy issue
   PostPosted: 01 Sep 2010, 16:01 
Try 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=/"


  Subject: Re: PD4ML.render proxy issue
   PostPosted: 01 Sep 2010, 16:20 
Hi,

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,


  Subject: Re: PD4ML.render proxy issue
   PostPosted: 01 Sep 2010, 16:40 
You may specify proxy server address an port with the standard way for Java applications - usin http.proxyServer and http.proxyPort environment variables.



[Reply]     [ 4 posts ] 

Copyright ©2004-10 zefer|org. All rights reserved. Bookmark and Share