You are viewing a plain text version of this content. The canonical link for it is here.
Posted to muse-dev@ws.apache.org by "Reichardt, William" <wi...@hp.com> on 2005/10/19 20:34:46 UTC

RE: Question regarding WSDM/Muse client API

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:cusquinho@gmail.com] 
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: muse-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: muse-dev-help@ws.apache.org


Re: Question regarding WSDM/Muse client API

Posted by Fernando Costa <fc...@exatas.unisinos.br>.
Hello,

First I would like to thank you Reichardt for your help regarding the  
EPR description. I've found out the problem I'm having is with my  
client API compilation. I did it manually, although it compiled just  
fine it's not working properly. I've been trying to compile it with  
Maven (lastest svn release) and here is what I get (maven dist):

java:prepare-filesystem:

---
java:compile:
     [echo] Compiling to /Users/maddog/Documents/Programming/ 
WSDMClient/client-old/target/classes
     [javac] Compiling 43 source files to /Users/maddog/Documents/ 
Programming/WSDMClient/client-old/target/classes
/Users/maddog/Documents/Programming/WSDMClient/client-old/src/java/ 
org/apache/ws/client/muse/client/impl/capabilities/metric/ 
MetricEnabledResourceImpl.java:32: cannot find symbol
symbol  : class TestResourcePropertyQNames
location: package org.apache.ws.service.testresource
import org.apache.ws.service.testresource.TestResourcePropertyQNames;

File...... /Users/maddog/.maven/cache/maven-java-plugin-1.5/plugin.jelly
Element... ant:javac
Line...... 63
Column.... 48
Compile failed; see the compiler error output for details.
Total time: 14 seconds
Finished at: Thu Oct 20 14:49:20 BRST 2005

-----

I've tried to remove .maven in my home, so I would force it to  
download all the .jars again. Still, same problem. Any idea why that  
would happen?

Thanks

Fernando Costa

Em 19/10/2005, às 16:34, Reichardt, William escreveu:

> 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:cusquinho@gmail.com]
> 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: muse-dev-unsubscribe@ws.apache.org
> For additional commands, e-mail: muse-dev-help@ws.apache.org
>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: muse-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: muse-dev-help@ws.apache.org