3 Replies Latest reply on Aug 22, 2011 3:05 PM by ron_sigal

    How to use a HTTP(S) proxy without system properties?

    rspielmann

      Hello world,

       

      I'm facing the following situation: I have a webservice client generated by CXF which completely uses JAXWS APIs. A webservice call is supposed to be made through a HTTP/HTTPS proxy server. I rely on JBoss remoting for the call - there is no CXF or Axis implementation involved. Because the affected JBoss is used to run a bunch of applications which sometimes have individual proxy settings, I can NOT use the usual system properties for the proxy configuration.

       

      Now my question is: is there any programmatic way to set proxy options? I read in the remoting guide that you can do things like passing a metadata map into the client call (Remoting Guide, 5.4.11, response = client.invoke(payload, metadata);) - but how would I be able to hook into that invocation?

       

      Any hints would be greatly appreciated!

       

      Regards,

      Robert

        • 1. Re: How to use a HTTP(S) proxy without system properties?
          ron_sigal

          Hi Robert,

           

          re: "but how would I be able to hook into that invocation?"

           

          What is the nature of your client?  I don't know much about web services, so I don't know what you mean by "webservice client generated by CXF".  But I can say that if you don't have direct access to the actual Remoting call Client.invoke(), I don't see how will be able to set the value of the metadata map.

           

          -Ron

          1 of 1 people found this helpful
          • 2. Re: How to use a HTTP(S) proxy without system properties?
            rspielmann

            Hi Ron,

             

            "webservice client generated by CXF" means that I used a tool from the Apache CXF framework in order to generate required Java classes, including some client code, from the given WSDL. I then rely on the JBoss webservice stack to send the request. You are absolutely right: I was able to step through the entire stack in the debugger and found out that no matter which properties I set in the metadata map while I still have access to the request being prepared (there are some properties for proxy options), they are discarded shortly before the request is sent out to the target endpoint. Thus, I could not programmatically influence the proxy to be used. JBoss even ignored system properties, so I was pretty lost. In the end, the case was solved because I could use a transparent proxy by changing the host name part of the endpoint, so I didn't have to fiddle around with proxy settings any more. Thanks a lot for your reply though, it does point in the right direction

             

            Regards,

            Robert

            • 3. Re: How to use a HTTP(S) proxy without system properties?
              ron_sigal

              Hey Robert,

               

              "webservice client generated by CXF" means that I used a tool from the Apache CXF framework in order to generate required Java classes, including some client code, from the given WSDL.

               

              Ah, yeah, should have guessed that. Thanks.

               

              Anyway, I'm glad you got things working.

               

              -Ron