You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by Steve Cohen <sc...@javactivity.org> on 2008/12/10 20:01:49 UTC

cxf file syntax for multiple port access?

Is it possible to have a cxf.xml file which has two sets of 
authentication parameters, each one selectable on the basis of which 
instance of the Web Service is being communicated with?

My goal here is to have one application, deployable on both our test and 
production tiers that determines the service url and authentication 
parameters based on the environment it runs in (say by properties files).

If so, what would such cxf.xml file look like?

Re: cxf file syntax for multiple port access?

Posted by Steve Cohen <sc...@javactivity.org>.
Steve Cohen wrote:

Actually, does -Dcxf.config.file work at all?

The Spring library version I'm using is 2.0.8 and I find that placing 
this definition on the command line (of Tomcat in my case) doesn't work 
at all.  Although the property is seen among the system properties, my 
cxf file is blissfully ignored.

The ONLY way I can get it to work is to place it on the classpath within 
the war file. 

I can't find any way to make selection of a cxf configuration file 
programatically determined.

HELP!

Steve
> Steve Cohen wrote:
>> Is it possible to have a cxf.xml file which has two sets of 
>> authentication parameters, each one selectable on the basis of which 
>> instance of the Web Service is being communicated with?
>>
>> My goal here is to have one application, deployable on both our test 
>> and production tiers that determines the service url and 
>> authentication parameters based on the environment it runs in (say by 
>> properties files).
>>
>> If so, what would such cxf.xml file look like?
>>
>>
> After having done some of my own investigation I find the following 
> here : http://cwiki.apache.org/CXF20DOC/configuration.html
>
> "CXF can discover XML configuration files which you have written. For 
> both web service clients and servers, the default location that CXF 
> will look for a configuration for is "/cxf.xml" on the class path. If 
> you wish to override this location, you can specify a command line 
> property: -Dcxf.config.file=some_other_config.xml. To use a url as the 
> configuration location, specify as follows: 
> -Dcxf.config.file.url=config_file_url."
>
> I want to have TWO CXF configuration files on my classpath, neither 
> called cxf.xml, that is, both will be in the WAR file.   Is there a 
> way, using the syntax above to describe classpath resources, as 
> opposed to files or URLs.  I guess another way of asking this is: is 
> it possible to describe classpath resources with URL syntax?  But in 
> any case, how can I do this?
>
>


Re: cxf file syntax for multiple port access?

Posted by Steve Cohen <sc...@javactivity.org>.
Steve Cohen wrote:
> Is it possible to have a cxf.xml file which has two sets of 
> authentication parameters, each one selectable on the basis of which 
> instance of the Web Service is being communicated with?
>
> My goal here is to have one application, deployable on both our test 
> and production tiers that determines the service url and 
> authentication parameters based on the environment it runs in (say by 
> properties files).
>
> If so, what would such cxf.xml file look like?
>
>
After having done some of my own investigation I find the following here 
: http://cwiki.apache.org/CXF20DOC/configuration.html

"CXF can discover XML configuration files which you have written. For 
both web service clients and servers, the default location that CXF will 
look for a configuration for is "/cxf.xml" on the class path. If you 
wish to override this location, you can specify a command line property: 
-Dcxf.config.file=some_other_config.xml. To use a url as the 
configuration location, specify as follows: 
-Dcxf.config.file.url=config_file_url."

I want to have TWO CXF configuration files on my classpath, neither 
called cxf.xml, that is, both will be in the WAR file.   Is there a way, 
using the syntax above to describe classpath resources, as opposed to 
files or URLs.  I guess another way of asking this is: is it possible to 
describe classpath resources with URL syntax?  But in any case, how can 
I do this?

Re: cxf file syntax for multiple port access?

Posted by Daniel Kulp <dk...@apache.org>.
On Wednesday 10 December 2008 2:01:49 pm Steve Cohen wrote:
> Is it possible to have a cxf.xml file which has two sets of
> authentication parameters, each one selectable on the basis of which
> instance of the Web Service is being communicated with?
>
> My goal here is to have one application, deployable on both our test and
> production tiers that determines the service url and authentication
> parameters based on the environment it runs in (say by properties files).
>
> If so, what would such cxf.xml file look like?

There is a PropertyPlaceholderConfigurer thing in spring that can be used for 
this.   That said, you may need the latest 2.1.x snapshots depending on what 
you need to configure.   I just fixed the TLSClientParameters in the 
http:conduit yesterday.  :-(

That said, I haven't actually tried using the PropertyPlaceholderConfigurer 
thing.  I've just seen bugs related to it.   That would be something to 
google though.  :-)


-- 
Daniel Kulp
dkulp@apache.org
http://dankulp.com/blog