this is the fragment of the Servlet where the URL is accesed:
.....
String XML = buf.toString();
try{
URL miurl = new
URL("http://www.whatever.es/cgi-bin/XMLprocess");
URLConnection con = miurl.openConnection();
con.setDoOutput(true);
PrintWriter escritor = new PrintWriter(con.getOutputStream());
escritor.println("XML=" + URLEncoder.encode(XML));
escritor.close();
out.println("i arrive here");
BufferedReader in = new BufferedReader(new
InputStreamReader(con.getInputStream()));
out.println("i don't arrive here");
.....
}catch (IOException ee ){
out.println("IOException: " + ee.getLocalizedMessage());
}
...
it is very simple and it works when is directly called as:
http://portet:8080/cocoon/generateItinerary
this address does not match any pipeline in the sitemap.
I try to integrate this servlet in the next way:
<map:match pattern="wh@m/exec/GenerateItinerary">
<map:act type="request">
<map:parameter name="parameters" value="true"/>
<map:generate
src="http://portet:8080/cocoon/wh@m/GenerateItinerary?Orig={Orig}&Dest={
Dest}&CodOrig=
{CodOrig}&CodDest={CodDest}&modo={modo}&criterio={criterio}&
Fecha={Fecha}&Hora={Hora}"/>
</map:act>
<map:select>
<map:when test="wap">
<map:transform src="wh@m/styles/Itinerary2wml.xsl"/>
<map:serialize type="wap"/>
</map:when>
<map:otherwise>
<map:transform src="wh@m/styles/Itinerary2html.xsl"/>
<map:serialize type="html"/>
</map:otherwise>
</map:select>
<map:serialize type="html"/>
</map:match>
The output I receive is the next:
...
IOException: http://www.whatever.es/cgi-bin/XMLprocess
...
Not very descriptive :(
I think, my problem is related to the internet conection. we have changed
the internet conection settings in the out net, so no proxy server is need
any more. Shall I rebuild Cocoon?
I also managed to change the proxy settings in the java plug-in control
panel, seting and removing the proxy parameter, but I haven't succed at all.
-----Mensaje original-----
De: Reinhard P�tz [mailto:[EMAIL PROTECTED]]
Enviado el: mi�rcoles, 02 de enero de 2002 16:27
Para: [EMAIL PROTECTED]
Asunto: AW: problem with URLConnection
Hi lucas,
Could you give me further details (your goals, pipeline, error message ...).
Regards,
Reinhard
> -----Urspr�ngliche Nachricht-----
> Von: lucas [mailto:[EMAIL PROTECTED]]
> Gesendet: Donnerstag, 02. August 2001 16:12
> An: COCOON
> Betreff: problem with URLConnection
>
>
> My code receives data from external data sources. I get this
> data with the
> URLConnection class, everything works fine in Tomcat 1.3.1. I
> can Post the
> parameters and receive the results of the external cgi. I have a servlet
> which makes it (probed).
>
> .... but (always there is a but :) ) I have problems integrating this
> servlet into the cocoon pipeline, (both cocoon and tomcat runs
> in the same
> machine, of course). it fails in the <generate ..> step, and I get a
> IOException message.
> I can connect to the Internet with or without a proxy (we are still
> migrating to dsl).
> Can any of you help me ?.
> thank in advance, and merry chrismas for all of us, cocoon bunch
>
>
> Lucas Pons Bayarri
> Etra I+D
> Valencia, Spain
> +34 96 330 40 82
>
>
> ---------------------------------------------------------------------
> Please check that your question has not already been answered in the
> FAQ before posting. <http://xml.apache.org/cocoon/faqs.html>
>
> To unsubscribe, e-mail: <[EMAIL PROTECTED]>
> For additional commands, e-mail: <[EMAIL PROTECTED]>
>
---------------------------------------------------------------------
Please check that your question has not already been answered in the
FAQ before posting. <http://xml.apache.org/cocoon/faqs.html>
To unsubscribe, e-mail: <[EMAIL PROTECTED]>
For additional commands, e-mail: <[EMAIL PROTECTED]>
---------------------------------------------------------------------
Please check that your question has not already been answered in the
FAQ before posting. <http://xml.apache.org/cocoon/faqs.html>
To unsubscribe, e-mail: <[EMAIL PROTECTED]>
For additional commands, e-mail: <[EMAIL PROTECTED]>