You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Peter Ross <pr...@missioncriticalit.com> on 2003/07/02 18:05:22 UTC

webservice proxy question

I am trying to use the webservice proxy to access a webservice that I
have made available using Apache Axis.

Here is the section of the sitemap that I have defined, does this look
correct to everyone?

<map:pipeline>
  <map:match pattern="forms.html">
    <map:generate type="proxy"
        src="http://localhost:8080/axis/services/IntelligentForm?method=getForms"
        />
    <map:transform src="transforms/forms.xslt"/>
    <map:serialize type="html"/>
  </map:match>
</map:pipeline>

However I get the following error when attempting to run it:
Original Exception: java.lang.IllegalArgumentException: host parameter is null
    at org.apache.commons.httpclient.HttpConnection.<init>(HttpConnection.java:227)
    at org.apache.commons.httpclient.SimpleHttpConnectionManager.getConnection(SimpleHttpConnectionManager.java:115)
    at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:548)
    at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:476)


When I access the webservice through a web-browser I get

<soapenv:Envelope>
<soapenv:Body>
<getFormsResponse soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<GetFormsReturn xsi:type="xsd:string"><Forms><Form>FormA</Form><Form></GetFormsReturn>
</getFormsResponse>
</soapenv:Body>
</soapenv:Envelope>

I access through a proxy server, but I have set JAVA_OPTS to be
-Dhttp.proxyHost=hellman -Dhttp.proxyPort=8080 -Dhttp.nonProxyHosts=localhost
before starting up Tomcat.

Can anyone thing of what the problem may be?

Thanks in advance,
Pete

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Re: "host is null" bugfix for WebServiceProxyGenerator

Posted by Geoff Howard <co...@leverageweb.com>.
Peter Ross wrote:

>On Thu, Jul 03, 2003 at 11:39:15AM -0500, Tony Collen wrote:
>  
>
>>Pete, would you mind submitting this as a patch?  Perhaps we can slip this 
>>in before 2.1 goes final.
>>
>>    
>>
>How do I submit it as a patch?
>
Follow the link to bugzilla from the cocoon.apache.org site and file it 
as a "bug" with the summary
starting with [PATCH].

Thanks,
Geoff


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Re: "host is null" bugfix for WebServiceProxyGenerator

Posted by Peter Ross <pr...@missioncriticalit.com>.
On Thu, Jul 03, 2003 at 11:39:15AM -0500, Tony Collen wrote:
> Pete, would you mind submitting this as a patch?  Perhaps we can slip this 
> in before 2.1 goes final.
> 
How do I submit it as a patch?

I am also working on handling http.nonProxyHosts at least semi-correctly
as I need to access web-services both inside and outside the firewall at
my work.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Re: "host is null" bugfix for WebServiceProxyGenerator

Posted by Tony Collen <co...@umn.edu>.
Peter Ross wrote:
> On Wed, Jul 02, 2003 at 11:36:25AM -0500, Tony Collen wrote:
> 
>>See this thread in the message archive, it is a known problem and I'm 
>>working on tracking down the problem.
>>
>>http://marc.theaimsgroup.com/?t=105707418000006&r=1&w=2
>>
> 
> The following patch works for me, but note that there is still an
> unresolved problem with the fact that we don't parse http.nonProxyHosts
> to ensure that proxying is only enabled for connections which need it.


Well, looks like you're ahead of me.. this look good.. can anyone else confirm this works (like 
anyone else who was posting to the list about the WSPG) ?

Pete, would you mind submitting this as a patch?  Perhaps we can slip this in before 2.1 goes final.


Tony


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


"host is null" bugfix for WebServiceProxyGenerator

Posted by Peter Ross <pr...@missioncriticalit.com>.
On Wed, Jul 02, 2003 at 11:36:25AM -0500, Tony Collen wrote:
> See this thread in the message archive, it is a known problem and I'm 
> working on tracking down the problem.
> 
> http://marc.theaimsgroup.com/?t=105707418000006&r=1&w=2
> 
The following patch works for me, but note that there is still an
unresolved problem with the fact that we don't parse http.nonProxyHosts
to ensure that proxying is only enabled for connections which need it.

Index: src/java/org/apache/cocoon/generation/WebServiceProxyGenerator.java
===================================================================
RCS file: /home/cvspublic/cocoon-2.1/src/java/org/apache/cocoon/generation/WebServiceProxyGenerator.java,v
retrieving revision 1.3
diff -u -r1.3 WebServiceProxyGenerator.java
--- src/java/org/apache/cocoon/generation/WebServiceProxyGenerator.java	16 Mar 2003 17:49:15 -0000	1.3
+++ src/java/org/apache/cocoon/generation/WebServiceProxyGenerator.java	3 Jul 2003 14:42:31 -0000
@@ -286,7 +286,7 @@
  * consequetively return an HttpMultiClient
  *
  */
-protected HttpClient getHttpClient()
+protected HttpClient getHttpClient() throws ProcessingException
 {
   Request request = ObjectModelHelper.getRequest( objectModel );
   Session session = request.getSession( true );
@@ -298,18 +298,30 @@
   if (httpClient == null)
   {
     httpClient = new HttpClient();
-    
+
+    HostConfiguration config = httpClient.getHostConfiguration();
+    if (config == null) {
+      config = new HostConfiguration();
+    }
+
+    try {
+    	config.setHost(new org.apache.commons.httpclient.URI(this.source));
+    }
+    catch (Exception ex) {
+    	throw new ProcessingException("URI format error: " + ex, ex);
+    }
+
+    // XXX we don't check http.nonProxyHosts to see whether or not the proxy
+    // server should be used, this functionallity really should be part of 
+    // httpClient.
     if (System.getProperty("http.proxyHost") != null)
     {
       String proxyHost = System.getProperty("http.proxyHost");
       int proxyPort = Integer.parseInt(System.getProperty("http.proxyPort"));
-      HostConfiguration config = httpClient.getHostConfiguration();
-      if (config == null) {
-        config = new HostConfiguration();
-      }
       config.setProxy(proxyHost, proxyPort);
-      httpClient.setHostConfiguration(config);
     }
+
+    httpClient.setHostConfiguration(config);
     
     session.setAttribute( HTTP_CLIENT, httpClient );
   }

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Re: webservice proxy question

Posted by Tony Collen <co...@umn.edu>.
Peter Ross wrote:
> I am trying to use the webservice proxy to access a webservice that I
> have made available using Apache Axis.
> 


<snip>

> 
> Can anyone thing of what the problem may be?


Pete,

See this thread in the message archive, it is a known problem and I'm working on tracking down the 
problem.

http://marc.theaimsgroup.com/?t=105707418000006&r=1&w=2




> 
> Thanks in advance,
> Pete


Tony


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org