login button

Service cannot get through corporate proxy server - how to setup?

Forums :

Dear all experts,

I tried to configure the server 1.0.2 to work in corporate proxy server.

I followed the documentation but there is no success. Could you pls help on this?

Here is the configure axis2.xml and the sample exchangeRate service error. Don't know why the server cannot use the proxy settings given?

axis2.xml

    <transportSender name="http"
                     class="org.apache.axis2.transport.http.CommonsHTTPTransportSender">
        <parameter name="PROTOCOL">HTTP/1.1</parameter>
      <parameter name="PROXY" proxy_host="10.150.112.254" proxy_port="8080" locked="true">anonymous:anonymous:anonymous"</parameter>     
        <parameter name="Transfer-Encoding">chunked</parameter>
        <!-- Do not set the optional action part of the Content-Type to the SOAP 1.2 messages. IE fails on this. See MASHUP-177-->
        <parameter name="OmitSOAP12Action">true</parameter>
    </transportSender>
    <transportSender name="https"
                     class="org.apache.axis2.transport.http.CommonsHTTPTransportSender">
        <parameter name="PROTOCOL">HTTP/1.1</parameter>
      <parameter name="PROXY" proxy_host="10.150.112.254" proxy_port="8080" locked="true">anonymous:anonymous:anonymous"</parameter>
      <parameter name="Transfer-Encoding">chunked</parameter>
        <!-- Do not set the optional action part of the Content-Type to the SOAP 1.2 messages. IE fails on this. See MASHUP-177-->
        <parameter name="OmitSOAP12Action">true</parameter>
    </transportSender>

Log file error

INFO [2008-03-04 12:16:03,773]  I/O exception (java.net.ConnectException) caught when processing request: Connection timed out: connect
 INFO [2008-03-04 12:16:03,773]  I/O exception (java.net.ConnectException) caught when processing request: Connection timed out: connect
 INFO [2008-03-04 12:16:03,773]  Retrying request
 INFO [2008-03-04 12:16:03,773]  Retrying request
 INFO [2008-03-04 12:16:24,733]  I/O exception (java.net.ConnectException) caught when processing request: Connection timed out: connect
 INFO [2008-03-04 12:16:24,733]  I/O exception (java.net.ConnectException) caught when processing request: Connection timed out: connect
 INFO [2008-03-04 12:16:24,733]  Retrying request
 INFO [2008-03-04 12:16:24,733]  Retrying request
 INFO [2008-03-04 12:16:45,802]  I/O exception (java.net.ConnectException) caught when processing request: Connection timed out: connect
 INFO [2008-03-04 12:16:45,802]  I/O exception (java.net.ConnectException) caught when processing request: Connection timed out: connect
 INFO [2008-03-04 12:16:45,802]  Retrying request
 INFO [2008-03-04 12:16:45,802]  Retrying request
 INFO [2008-03-04 12:17:06,761]  Unable to sendViaPost to url[http://www.webserviceX.net/CurrencyConvertor.asmx]
java.net.ConnectException: Connection timed out: connect
 at java.net.PlainSocketImpl.socketConnect(Native Method)
 at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:333)
 at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:195)
 at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:182)
 at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:366)
 at java.net.Socket.connect(Socket.java:520)
 at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
 at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
 at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
 at java.lang.reflect.Method.invoke(Method.java:585)
 at org.apache.commons.httpclient.protocol.ReflectionSocketFactory.createSocket(ReflectionSocketFactory.java:139)
 at org.apache.commons.httpclient.protocol.DefaultProtocolSocketFactory.createSocket(DefaultProtocolSocketFactory.java:124)
 at org.apache.commons.httpclient.HttpConnection.open(HttpConnection.java:706)
 at org.apache.commons.httpclient.MultiThreadedHttpConnectionManager$HttpConnectionAdapter.open(MultiThreadedHttpConnectionManager.java:1321)
 at org.apache.commons.httpclient.HttpMethodDirector.executeWithRetry(HttpMethodDirector.java:386)
 at org.apache.commons.httpclient.HttpMethodDirector.executeMethod(HttpMethodDirector.java:170)
 at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:396)
 at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:346)
 at org.apache.axis2.transport.http.AbstractHTTPSender.executeMethod(AbstractHTTPSender.java:524)
 at org.apache.axis2.transport.http.HTTPSender.sendViaPost(HTTPSender.java:191)
 at org.apache.axis2.transport.http.HTTPSender.send(HTTPSender.java:77)
 at org.apache.axis2.transport.http.CommonsHTTPTransportSender.writeMessageWithCommons(CommonsHTTPTransportSender.java:328)
 at org.apache.axis2.transport.http.CommonsHTTPTransportSender.invoke(CommonsHTTPTransportSender.java:206)
 at org.apache.axis2.engine.AxisEngine.send(AxisEngine.java:419)
 at org.apache.axis2.description.OutInAxisOperationClient.send(OutInAxisOperation.java:382)
 at org.apache.axis2.description.OutInAxisOperationClient.executeImpl(OutInAxisOperation.java:214)
 at org.apache.axis2.client.OperationClient.execute(OperationClient.java:163)
 at org.apache.axis2.client.ServiceClient.sendReceive(ServiceClient.java:533)
 at org.apache.axis2.client.ServiceClient.sendReceive(ServiceClient.java:513)
 at org.wso2.mashup.hostobjects.wsrequest.WSRequestHostImpl.jsFunction_send(WSRequestHostImpl.java:355)
 at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
 at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
 at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
 at java.lang.reflect.Method.invoke(Method.java:585)
 at org.mozilla.javascript.MemberBox.invoke(MemberBox.java:155)
 at org.mozilla.javascript.FunctionObject.call(FunctionObject.java:474)
 at org.mozilla.javascript.optimizer.OptRuntime.call1(OptRuntime.java:66)
 at org.mozilla.javascript.gen.c39._c1(samples-exchangeRate:62)
 at org.mozilla.javascript.gen.c39.call(samples-exchangeRate)
 at org.mozilla.javascript.ContextFactory.doTopCall(ContextFactory.java:393)
 at org.mozilla.javascript.ScriptRuntime.doTopCall(ScriptRuntime.java:2834)
 at org.mozilla.javascript.gen.c39.call(samples-exchangeRate)
 at org.wso2.javascript.rhino.JavaScriptEngine.call(JavaScriptEngine.java:180)
 at org.wso2.javascript.rhino.JavaScriptEngine.call(JavaScriptEngine.java:210)
 at org.wso2.javascript.rhino.JavaScriptReceiver.invokeBusinessLogic(JavaScriptReceiver.java:193)
 at org.apache.axis2.receivers.AbstractInOutMessageReceiver.invokeBusinessLogic(AbstractInOutMessageReceiver.java:40)
 at org.apache.axis2.receivers.AbstractMessageReceiver.receive(AbstractMessageReceiver.java:96)
 at org.apache.axis2.engine.AxisEngine.receive(AxisEngine.java:148)
 at org.apache.axis2.transport.http.HTTPTransportUtils.processHTTPPostRequest(HTTPTransportUtils.java:275)
 at org.apache.axis2.transport.http.AxisServlet.doPost(AxisServlet.java:121)
 at javax.servlet.http.HttpServlet.service(HttpServlet.java:709)
 at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
 at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
 at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
 at org.wso2.mashup.transport.ServiceUIFilter.doFilter(ServiceUIFilter.java:197)
 at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
 at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
 at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
 at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
 at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
 at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
 at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
 at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
 at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
 at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:667)
 at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
 at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80)
 at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
 at java.lang.Thread.run(Thread.java:595)

 

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

the same problem...

Exactly I have the same problem. Anyone can give any suggestions ?

Cheers,

Víctor

 

Change in Proxy Configuration

***Posting reply provided on Dev list by Saminda***

Hi Victor,

The proxy configuration you have used being changed after Axis2 1.2 distribution as follows,

<parameter name="Proxy">
             <Configuration>
                      <ProxyHost>example.org</ProxyHost>
                      <ProxyPort>5678</ProxyPort>
                      <ProxyUser>EXAMPLE\saminda</ProxyUser>
                      <ProxyPassword>ppp</ProxyPassword>
              </Configuration>
</parameter>

if it's an open proxy

<parameter name="Proxy">
             <Configuration>
                      <ProxyHost>10.150.112.254</ProxyHost>
                      <ProxyPort>8080</ProxyPort>
             </Configuration>
</parameter>

All you have to do is add the above parameter as a TOP level parameter in your Axis2.xml and remove

<parameter name="PROXY" proxy_host="10.150.112.254"
>> proxy_port="8080" locked="true">anonymous:anonymous:anonymous"</parameter>

the parameter from <transportSender/> elements. We have removed this, due it's not user friendly.

In addition to this, if you don't want to go through writing the above parameter you could use Java Networking Properties for open proxies,

-Dhttp.proxyHost=10.150.112.254 -Dhttp.proxyPort=8080

Please buzz us if you need further assistance.

Thank you

Saminda

 

Hi, Saminda. It works. Many

Hi, Saminda.

It works. Many thanks. The configuration should be the top level under <axisconfig>

<axisconfig name="AxisJava2.0">

...

  <parameter name="Proxy">
    <Configuration>
      <ProxyHost>10.150.112.254</ProxyHost>
      <ProxyPort>8080</ProxyPort>
    </Configuration>
  </parameter>

...

Best Regards,

Kenny

wsdl2java.sh

Sorry for continuing this thread, but is there a setting for the wsdl2java for a proxy.

I had to edit the axis2.sh to include our proxy settings, but figured there is probably a config for these else where.

I've tried adding them as above to axis2.xml but it doesnt pick them up.

 

Thanks

Dave

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.