The WSDM specs say that a managed resource must be described by a
WS-Addressing Endpoint reference (EPR)
This is an XML document defined in the Addressing spec. Basically it
consists of a URL and some resource specific information that tells the
web service endpoint which particular managed resource you want to talk
to.

You can provide an EPR one of three ways. Use either a URL to an XML
file containing one, pass in a String containing the XML or pass in a
class that implements the EndpointReference Interface.

Now your exception came with no line numbers so I have to speculate but
it looks like the text you created or some part of it was not recognized
as an EPR.

Try the example I am including of an EPR XML file below. 

Edit its address and ResourceIdentifier fields to match your resource
but beware because ResourceIdentifier is in a specific namespace. Your
code listed  xmlns:svr="http://ws.apache.org/service/testresource"; which
can't be right because you are not talking to a testresource in this
case. This namespace will be different for your application so you are
going to have to change it as well. Below is my best guess at what your
EPR file should look like. Copy it into a file on your system and then
use a file:///C:/epr.xml url to create the manageableresource class.

epr.xml
--------------------------------------------
<?xml version="1.0"?>
<EndpointReference
xmlns="http://schemas.xmlsoap.org/ws/2004/08/addressing";>
   <Address>http://localhost:8080/muse/services/filesystem</Address>
   <ReferenceProperties>
      <svr:ResourceIdentifier
xmlns:svr="http://ws.apache.org/resource/example/filesystem";>/dev/vg00/l
vol1</svr:ResourceIdentifier>
   </ReferenceProperties>
</EndpointReference>

--------------------------------------------

Try this out and send me a full stack trace if it fails again.

-Bill

-----Original Message-----
From: Fernando Costa [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, October 19, 2005 1:06 PM
To: Reichardt, William
Subject: Question regarding WSDM/Muse client API

Hello,

I've been trying to use your WSDM client API from Apache svn tree. I'm
having a problem using it that you may be able to help me. As far as I
could find out I need to have a XML file which describes my resources.
I tried to create one, and also, use the eprFromAddessandId method I've
found in one of your java files. Here is what I'm trying to do:

                managedResource =
ManageableResource.Factory.create(null,
eprFromAddessandId("http://10.17.174.24:8080/muse/services/filesystem";,
"/dev/vg00/lvol1"));
                
Using the filesystem example, I've been trying to create this
managedResource. I'm not sure if this is the correct way, but I get a
java.lang.ClassCastException:
org.apache.xmlbeans.impl.values.XmlAnyTypeImpl. I've also tried to
create this XML file instead of using the method above, but still I see
the same problem.

Could you give me some help with this problem?

Here is the method to create the EPR:

        protected String eprFromAddessandId(String address, String id) {
                return "<?xml version=\"1.0\"?>\n<EndpointReference
xmlns=\"http://schemas.xmlsoap.org/ws/2004/08/addressing\";>\n<Address>"
                                + address
                                + ""
                                +
"</Address>\n<ReferenceProperties>\n<svr:ResourceIdentifier
xmlns:svr=\"http://ws.apache.org/service/testresource\";>"
                                + id
                                +
"</svr:ResourceIdentifier>\n</ReferenceProperties>\n</EndpointReference>
";
        }

Thanks in Advance

Fernando Costa

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to