Thanks for the info!
I was able to use the following code snippet to get the server-config.wsdd
for a new AxisEngine where deployFilename is the name of a deploy.wsdd
file:
Admin admin = new Admin();
AxisEngine engine = new AxisServer();
engine.setShouldSaveConfig(true);
engine.init();
MessageContext msgContext = new MessageContext(engine);
Document doc = XMLUtils.newDocument( new FileInputStream(
deployFilename ) );
Document result = admin.process(msgContext,
doc.getDocumentElement());
Document adminDoc = Admin.listConfig(engine);
// adminDoc now contains server-config.wsdd
However, I need to point the Axis AdminClient to a specific URL that
represent an Axis servlet running on a particular Web project. I have
been using the org.apache.axis.tools.ant.axis.AdminClientTask to point to
an URL and deploy a deploy.wsdd file using the following snippet:
import org.apache.axis.tools.ant.axis.AdminClientTask;
AdminClientTask adminClient = new AdminClientTask();
adminClient.setUrl(url); // e.g. url =
"http://localhost:8080/myWebProject/services/AdminService"
adminClient.setXmlFile( deployFilename ); // e.g. deployFilename =
deploy.wsdd
adminClient.execute();
I just need to get the resulting server-config.wsdd back programmatically.
I tried looking at the defined API for AxisEngine and Admin to see if
there's a way to specify the URL of the admin service for the Axis servlet
I want to connect to but was not able to find it. What is the proper way
to get the server-config.wsdd for a specific Axis servlet that's running
on a specific Web project?
Regards,
Kathy Chan
"Davanum Srinivas" <[EMAIL PROTECTED]>
03/01/2007 06:46 PM
Please respond to
[email protected]
To
[email protected]
cc
Subject
Re: Is there a way to programmatically get the content of
server-config.wsdd?
You can use the "org.apache.axis.utils.Admin" instead of the AdminClient.
See usages here:
http://www.google.com/search?hl=en&q=org.apache.axis.utils.Admin&btnG=Google+Search
-- dims
On 3/1/07, Kathy Chan <[EMAIL PROTECTED]> wrote:
>
> Hi,
>
> I would like to find out if there is a way I could get the content of
> server-config.wsdd programmatically.
>
> I understand that server-config.wsdd is created when I call the Axis
> AdminClient with the Axis servlet URL and a deploy.wsdd file. The
> server-config.wsdd file is generated into the publish directory of the
> server. This present a problem because in Eclipse WTP, the server
publish
> the content from the Eclipse workspace but the "live" publish directory
the
> server uses may or may not be in the workspace (it could be in some
> temporary location or server specific location that the workspace
content is
> copied to). This causes a problem because the server-config.wsdd that
> contains information on what Web services are deployed could be lost
when
> the server republishes from the workspace (since that file is not in the
> workspace but is in the "live" publish directory). I need to find a
way to
> persist the server-config.wsdd in the Eclipse workspace so that the
> information would not be lost in subsequent republish.
>
> One way I was able to workaround the problem is copying the
> server-config.wsdd file from the server's live publish directory back to
the
> workspace but it requires the servers to implement an API to return the
> publish directory. However, that means we need to ask all servers we
could
> generate Axis Web service on to support it. This is not scalable or
easily
> achievable since that list of servers are growing constantly.
>
> So, I would like to find out if there's a call I could make (or a
parameter
> I could specify in AdminClient) that would return the content of
> server-config.wsdd file programmatically rather then just expect to find
it
> in the server's publish directory. If this support is not there
currently,
> could it be easily implemented in the next release?
>
> Regards,
> Kathy Chan
>
>
--
Davanum Srinivas :: http://wso2.org/ :: Oxygen for Web Services Developers
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]