2009/1/16 <[email protected]>: > Hi, > > I am wanting to publish 2 versions of all of my services, an external > version with limitied data and methods, and and internal version which > provides access to all data. > > Is it possible in Apache CXF to have 2 different urls in the same webapp > and then publish the different versions accordingly? For example, can I > have /services/external - for external services and /services/internal > for internal web services.
Yeah, each wsdl:service entry in the WSDL is a different subdirectory in the services virtual directory of the war file. So for example we have: http://cathdb.info:8080/BioMiner-war/ -- root of war file -- give a 404 http://cathdb.info:8080/BioMiner-war/services/ -- lists services available with links to their WSDLs, this is auto-generated by CXF http://cathdb.info:8080/BioMiner-war/services/CodaCathService http://cathdb.info:8080/BioMiner-war/services/CodaPfamService etc. These are the actual service endpoints. These URLs are live so feel free to have a look at the services and the WSDLs. You need to define the endpoint in your cxf-servlet.xml individually: <jaxws:endpoint id="CodaCathService" implementor="info.cathdb.funcnet.impl.CodaCathProvider" endpointName="funcnet:CodaCathPort" serviceName="funcnet:CodaCathService" address="/CodaCathService" wsdlLocation="WEB-INF/wsdl/Services.wsdl"> </jaxws:endpoint> etc. Or most of this can go in annotations. One potential snag in your case is that the WSDL links in the /war-file/services/ page actually all lead to the same WSDL which contains all the wsdl:service entries. So your external customers would be able to see all the internal service definitions too. I don't know much about servlet containers but presumably you can set up a rule in most of them, blocking access to those URLs from external IPs -- but they'd still see them. I was going to work on a patch to remove extraneous entries from the WSDL before it's served for each service, but I haven't had time yet. Andrew. -- New site launched: http://biotext.org.uk/ I am retiring my old email addresses. Please use [email protected] where firstname = andrew.
