Re: proxy server information
Hello Ralf: If I switch to Axis2 later, will this approach work for Axis2. Thanks, Ravi Ravi Krishnamurthy wrote: Thanks. I have one more question: There are 2 steps involved in my project: a. configuring the webservice means looking up the wsdl, and mapping the input and output parameters b. invoking the webservice When I invoke the webservice, the proxy information works great as per your suggestion. Interestingly when I invoke the webservice, I introspect the wsdl using the org.apache.axis.wsdl.gen.Parser.run(wsdluri). Observed that the Parser API has username and password but they are not for the proxy. Wondering how to use the proxy information using the Parser class. Thanks, Ravi Ralf Bust wrote: Yes, works for axis used as client consuming a webservice. rb Ravi Krishnamurthy schrieb: Ralf: May be a dumb question. The following code does it execute on the client side or on the server side. In my case, I'm using Axis to talk to any webservice ( may not be using axis). Hope your valuable suggestion is executed on the client side. Regards, Ravi Ralf Bust wrote: Hi, Easy-Way-Solution: (probably not the best, but working) Write a Class implementing DefaultHTTPTransportClientProperties. Overwrite the getters() with your code. Everytime a SOAP Call will be made is will look into your Class to get the apropriate Proxy settings. Load class with(VM Arguments): -Dorg.apache.axis.components.net.TransportClientProperties=name.of.your.classWhatever or change within your application with: System.getProperties().setProperty(org.apache.axis.components.net.TransportClientProperties,name.of.your.classWhatever); /* * Axis is directed to use this class instead of * org.apache.axis.components.net.TransportClientProperties by * setting the System property * * This reads proxy settings from the MessageContext to give per-request proxysupport */ public class AxisTransportClientProperties extends DefaultHTTPTransportClientProperties { public String getProxyHost() { // Retrieve proxy info from Message context every time String ret = null; MessageContext context = MessageContext.getCurrentContext(); if (context != null) { ret = (String) context.getProperty(whatever.you.want); } if (ret == null) { // use System property if set ret = super.getProxyHost(); } return ret; } } or analye the Endpoint: String targetService; targetService = context.getTargetService(); if (targetService.startsWith(http://www.apache.org;)){ // do what y want } Hope this helps. Ralf Bust Merten Schumann schrieb: Per webservice .. how could you do that??? Merten -Original Message- From: Somendra Paul [mailto:[EMAIL PROTECTED] Sent: Thursday, November 03, 2005 7:03 AM To: axis-user@ws.apache.org Subject: Re: proxy server information It should ge set per jvm.But if you want to use different proxy servers for different calls,then it should be set per webservice. Regards, Somendra --- Ravi Krishnamurthy [EMAIL PROTECTED] wrote: Hello: Can the proxy server settings like http.proxyHost be set per webservice call or it should be set per jvm. Thanks, Ravi
Re: proxy server information
Yes, works for axis used as client consuming a webservice. rb Ravi Krishnamurthy schrieb: Ralf: May be a dumb question. The following code does it execute on the client side or on the server side. In my case, I'm using Axis to talk to any webservice ( may not be using axis). Hope your valuable suggestion is executed on the client side. Regards, Ravi Ralf Bust wrote: Hi, Easy-Way-Solution: (probably not the best, but working) Write a Class implementing DefaultHTTPTransportClientProperties. Overwrite the getters() with your code. Everytime a SOAP Call will be made is will look into your Class to get the apropriate Proxy settings. Load class with(VM Arguments): -Dorg.apache.axis.components.net.TransportClientProperties=name.of.your.classWhatever or change within your application with: System.getProperties().setProperty(org.apache.axis.components.net.TransportClientProperties,name.of.your.classWhatever); /* * Axis is directed to use this class instead of * org.apache.axis.components.net.TransportClientProperties by * setting the System property * * This reads proxy settings from the MessageContext to give per-request proxysupport */ public class AxisTransportClientProperties extends DefaultHTTPTransportClientProperties { public String getProxyHost() { // Retrieve proxy info from Message context every time String ret = null; MessageContext context = MessageContext.getCurrentContext(); if (context != null) { ret = (String) context.getProperty(whatever.you.want); } if (ret == null) { // use System property if set ret = super.getProxyHost(); } return ret; } } or analye the Endpoint: String targetService; targetService = context.getTargetService(); if (targetService.startsWith(http://www.apache.org;)){ // do what y want } Hope this helps. Ralf Bust Merten Schumann schrieb: Per webservice .. how could you do that??? Merten -Original Message- From: Somendra Paul [mailto:[EMAIL PROTECTED] Sent: Thursday, November 03, 2005 7:03 AM To: axis-user@ws.apache.org Subject: Re: proxy server information It should ge set per jvm.But if you want to use different proxy servers for different calls,then it should be set per webservice. Regards, Somendra --- Ravi Krishnamurthy [EMAIL PROTECTED] wrote: Hello: Can the proxy server settings like http.proxyHost be set per webservice call or it should be set per jvm. Thanks, Ravi
Re: proxy server information
Thanks. I have one more question: There are 2 steps involved in my project: a. configuring the webservice means looking up the wsdl, and mapping the input and output parameters b. invoking the webservice When I invoke the webservice, the proxy information works great as per your suggestion. Interestingly when I invoke the webservice, I introspect the wsdl using the org.apache.axis.wsdl.gen.Parser.run(wsdluri). Observed that the Parser API has username and password but they are not for the proxy. Wondering how to use the proxy information using the Parser class. Thanks, Ravi Ralf Bust wrote: Yes, works for axis used as client consuming a webservice. rb Ravi Krishnamurthy schrieb: Ralf: May be a dumb question. The following code does it execute on the client side or on the server side. In my case, I'm using Axis to talk to any webservice ( may not be using axis). Hope your valuable suggestion is executed on the client side. Regards, Ravi Ralf Bust wrote: Hi, Easy-Way-Solution: (probably not the best, but working) Write a Class implementing DefaultHTTPTransportClientProperties. Overwrite the getters() with your code. Everytime a SOAP Call will be made is will look into your Class to get the apropriate Proxy settings. Load class with(VM Arguments): -Dorg.apache.axis.components.net.TransportClientProperties=name.of.your.classWhatever or change within your application with: System.getProperties().setProperty(org.apache.axis.components.net.TransportClientProperties,name.of.your.classWhatever); /* * Axis is directed to use this class instead of * org.apache.axis.components.net.TransportClientProperties by * setting the System property * * This reads proxy settings from the MessageContext to give per-request proxysupport */ public class AxisTransportClientProperties extends DefaultHTTPTransportClientProperties { public String getProxyHost() { // Retrieve proxy info from Message context every time String ret = null; MessageContext context = MessageContext.getCurrentContext(); if (context != null) { ret = (String) context.getProperty(whatever.you.want); } if (ret == null) { // use System property if set ret = super.getProxyHost(); } return ret; } } or analye the Endpoint: String targetService; targetService = context.getTargetService(); if (targetService.startsWith(http://www.apache.org;)){ // do what y want } Hope this helps. Ralf Bust Merten Schumann schrieb: Per webservice .. how could you do that??? Merten -Original Message- From: Somendra Paul [mailto:[EMAIL PROTECTED] Sent: Thursday, November 03, 2005 7:03 AM To: axis-user@ws.apache.org Subject: Re: proxy server information It should ge set per jvm.But if you want to use different proxy servers for different calls,then it should be set per webservice. Regards, Somendra --- Ravi Krishnamurthy [EMAIL PROTECTED] wrote: Hello: Can the proxy server settings like http.proxyHost be set per webservice call or it should be set per jvm. Thanks, Ravi
Re: proxy server information
Hi, Easy-Way-Solution: (probably not the best, but working) Write a Class implementing DefaultHTTPTransportClientProperties. Overwrite the getters() with your code. Everytime a SOAP Call will be made is will look into your Class to get the apropriate Proxy settings. Load class with(VM Arguments): -Dorg.apache.axis.components.net.TransportClientProperties=name.of.your.classWhatever or change within your application with: System.getProperties().setProperty(org.apache.axis.components.net.TransportClientProperties,name.of.your.classWhatever); /* * Axis is directed to use this class instead of * org.apache.axis.components.net.TransportClientProperties by * setting the System property * * This reads proxy settings from the MessageContext to give per-request proxysupport */ public class AxisTransportClientProperties extends DefaultHTTPTransportClientProperties { public String getProxyHost() { // Retrieve proxy info from Message context every time String ret = null; MessageContext context = MessageContext.getCurrentContext(); if (context != null) { ret = (String) context.getProperty(whatever.you.want); } if (ret == null) { // use System property if set ret = super.getProxyHost(); } return ret; } } or analye the Endpoint: String targetService; targetService = context.getTargetService(); if (targetService.startsWith(http://www.apache.org;)){ // do what y want } Hope this helps. Ralf Bust Merten Schumann schrieb: Per webservice .. how could you do that??? Merten -Original Message- From: Somendra Paul [mailto:[EMAIL PROTECTED] Sent: Thursday, November 03, 2005 7:03 AM To: axis-user@ws.apache.org Subject: Re: proxy server information It should ge set per jvm.But if you want to use different proxy servers for different calls,then it should be set per webservice. Regards, Somendra --- Ravi Krishnamurthy [EMAIL PROTECTED] wrote: Hello: Can the proxy server settings like http.proxyHost be set per webservice call or it should be set per jvm. Thanks, Ravi
Re: proxy server information
Thanks. I will try it out. Regards, Ravi Ralf Bust wrote: Hi, Easy-Way-Solution: (probably not the best, but working) Write a Class implementing DefaultHTTPTransportClientProperties. Overwrite the getters() with your code. Everytime a SOAP Call will be made is will look into your Class to get the apropriate Proxy settings. Load class with(VM Arguments): -Dorg.apache.axis.components.net.TransportClientProperties=name.of.your.classWhatever or change within your application with: System.getProperties().setProperty(org.apache.axis.components.net.TransportClientProperties,name.of.your.classWhatever); /* * Axis is directed to use this class instead of * org.apache.axis.components.net.TransportClientProperties by * setting the System property * * This reads proxy settings from the MessageContext to give per-request proxysupport */ public class AxisTransportClientProperties extends DefaultHTTPTransportClientProperties { public String getProxyHost() { // Retrieve proxy info from Message context every time String ret = null; MessageContext context = MessageContext.getCurrentContext(); if (context != null) { ret = (String) context.getProperty(whatever.you.want); } if (ret == null) { // use System property if set ret = super.getProxyHost(); } return ret; } } or analye the Endpoint: String targetService; targetService = context.getTargetService(); if (targetService.startsWith(http://www.apache.org;)){ // do what y want } Hope this helps. Ralf Bust Merten Schumann schrieb: Per webservice .. how could you do that??? Merten -Original Message- From: Somendra Paul [mailto:[EMAIL PROTECTED] Sent: Thursday, November 03, 2005 7:03 AM To: axis-user@ws.apache.org Subject: Re: proxy server information It should ge set per jvm.But if you want to use different proxy servers for different calls,then it should be set per webservice. Regards, Somendra --- Ravi Krishnamurthy [EMAIL PROTECTED] wrote: Hello: Can the proxy server settings like http.proxyHost be set per webservice call or it should be set per jvm. Thanks, Ravi
Re: proxy server information
Ralf: May be a dumb question. The following code does it execute on the client side or on the server side. In my case, I'm using Axis to talk to any webservice ( may not be using axis). Hope your valuable suggestion is executed on the client side. Regards, Ravi Ralf Bust wrote: Hi, Easy-Way-Solution: (probably not the best, but working) Write a Class implementing DefaultHTTPTransportClientProperties. Overwrite the getters() with your code. Everytime a SOAP Call will be made is will look into your Class to get the apropriate Proxy settings. Load class with(VM Arguments): -Dorg.apache.axis.components.net.TransportClientProperties=name.of.your.classWhatever or change within your application with: System.getProperties().setProperty(org.apache.axis.components.net.TransportClientProperties,name.of.your.classWhatever); /* * Axis is directed to use this class instead of * org.apache.axis.components.net.TransportClientProperties by * setting the System property * * This reads proxy settings from the MessageContext to give per-request proxysupport */ public class AxisTransportClientProperties extends DefaultHTTPTransportClientProperties { public String getProxyHost() { // Retrieve proxy info from Message context every time String ret = null; MessageContext context = MessageContext.getCurrentContext(); if (context != null) { ret = (String) context.getProperty(whatever.you.want); } if (ret == null) { // use System property if set ret = super.getProxyHost(); } return ret; } } or analye the Endpoint: String targetService; targetService = context.getTargetService(); if (targetService.startsWith(http://www.apache.org;)){ // do what y want } Hope this helps. Ralf Bust Merten Schumann schrieb: Per webservice .. how could you do that??? Merten -Original Message- From: Somendra Paul [mailto:[EMAIL PROTECTED] Sent: Thursday, November 03, 2005 7:03 AM To: axis-user@ws.apache.org Subject: Re: proxy server information It should ge set per jvm.But if you want to use different proxy servers for different calls,then it should be set per webservice. Regards, Somendra --- Ravi Krishnamurthy [EMAIL PROTECTED] wrote: Hello: Can the proxy server settings like http.proxyHost be set per webservice call or it should be set per jvm. Thanks, Ravi
Re: proxy server information
Thanks Ralf. It worked great, Regards, Ravi Ralf Bust wrote: Hi, Easy-Way-Solution: (probably not the best, but working) Write a Class implementing DefaultHTTPTransportClientProperties. Overwrite the getters() with your code. Everytime a SOAP Call will be made is will look into your Class to get the apropriate Proxy settings. Load class with(VM Arguments): -Dorg.apache.axis.components.net.TransportClientProperties=name.of.your.classWhatever or change within your application with: System.getProperties().setProperty(org.apache.axis.components.net.TransportClientProperties,name.of.your.classWhatever); /* * Axis is directed to use this class instead of * org.apache.axis.components.net.TransportClientProperties by * setting the System property * * This reads proxy settings from the MessageContext to give per-request proxysupport */ public class AxisTransportClientProperties extends DefaultHTTPTransportClientProperties { public String getProxyHost() { // Retrieve proxy info from Message context every time String ret = null; MessageContext context = MessageContext.getCurrentContext(); if (context != null) { ret = (String) context.getProperty(whatever.you.want); } if (ret == null) { // use System property if set ret = super.getProxyHost(); } return ret; } } or analye the Endpoint: String targetService; targetService = context.getTargetService(); if (targetService.startsWith(http://www.apache.org;)){ // do what y want } Hope this helps. Ralf Bust Merten Schumann schrieb: Per webservice .. how could you do that??? Merten -Original Message- From: Somendra Paul [mailto:[EMAIL PROTECTED] Sent: Thursday, November 03, 2005 7:03 AM To: axis-user@ws.apache.org Subject: Re: proxy server information It should ge set per jvm.But if you want to use different proxy servers for different calls,then it should be set per webservice. Regards, Somendra --- Ravi Krishnamurthy [EMAIL PROTECTED] wrote: Hello: Can the proxy server settings like http.proxyHost be set per webservice call or it should be set per jvm. Thanks, Ravi
RE: proxy server information
Per webservice .. how could you do that??? Merten -Original Message- From: Somendra Paul [mailto:[EMAIL PROTECTED] Sent: Thursday, November 03, 2005 7:03 AM To: axis-user@ws.apache.org Subject: Re: proxy server information It should ge set per jvm.But if you want to use different proxy servers for different calls,then it should be set per webservice. Regards, Somendra --- Ravi Krishnamurthy [EMAIL PROTECTED] wrote: Hello: Can the proxy server settings like http.proxyHost be set per webservice call or it should be set per jvm. Thanks, Ravi