You are viewing a plain text version of this content. The canonical link for it is here.
Posted to muse-user@ws.apache.org by José María Fernández de Alba López de Pablo <jm...@gmail.com> on 2007/11/24 19:14:53 UTC
I think "muse-template.wsdl" file is wrong
I think the WSDL template you provide to be the start point of muse
development (this is
"http://ws.apache.org/muse/docs/2.2.0/tutorial/artifacts/muse-template.wsdl")
is wrong, because it is suppossed to contain all the available
operations from the standard capabilities but it doesn't (for example,
it doesn't contain the "GetMetric" operation). In addition, it contains
resource-specific properties, like "ServerName". But, the main reason
for which i think this is that the file is exactly the same that
"sample-wsn-producer.wsdl"
("http://ws.apache.org/muse/docs/2.2.0/tutorial/artifacts/sample-wsn-producer.wsdl"),
which actually contains the correct operations is suppossed to contain.
Maybe you make a little mistake and placed the same file in each location.
Thank you in advance. José María.
---------------------------------------------------------------------
To unsubscribe, e-mail: muse-user-unsubscribe@ws.apache.org
For additional commands, e-mail: muse-user-help@ws.apache.org
Re: I think "muse-template.wsdl" file is wrong
Posted by montoyax <jm...@gmail.com>.
Please, if you can find the right one, post it or send it to me. Thanks
--
View this message in context: http://www.nabble.com/I-think-%22muse-template.wsdl%22-file-is-wrong-tf4866907.html#a14016057
Sent from the Muse User mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: muse-user-unsubscribe@ws.apache.org
For additional commands, e-mail: muse-user-help@ws.apache.org
Re: I think "muse-template.wsdl" file is wrong
Posted by montoyax <jm...@gmail.com>.
I think the WSDL template you provide to be the start point of muse
development (this is
"http://ws.apache.org/muse/docs/2.2.0/tutorial/artifacts/muse-template.wsdl")
is wrong, because it is suppossed to contain all the available
operations from the standard capabilities but it doesn't (for example,
it doesn't contain the "GetMetric" operation). In addition, it contains
resource-specific properties, like "ServerName". But, the main reason
for which i think this is that the file is exactly the same that
"sample-wsn-producer.wsdl"
("http://ws.apache.org/muse/docs/2.2.0/tutorial/artifacts/sample-wsn-producer.wsdl"),
which actually contains the correct operations is suppossed to contain.
Maybe you make a little mistake and placed the same file in each location.
Thank you in advance. José María.
--
View this message in context: http://www.nabble.com/I-think-%22muse-template.wsdl%22-file-is-wrong-tf4866907.html#a14016051
Sent from the Muse User mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: muse-user-unsubscribe@ws.apache.org
For additional commands, e-mail: muse-user-help@ws.apache.org
RE: using public interface InitializationParameters
Posted by le...@bt.com.
Thanks Chris for the suggestion, after some trial and error I found a
way to use the built in setInitializationParameters(Map) and
getInitializationParameters()
The problem seems to be that I was using the
getInitializationParameters() directly from within the resource I
instantiated, when calling getResource().getInitializationParameters()
it worked (sample code left below, in case anyone has the same issue
later on).
/Lenni
*** the factory ***
public EndpointReference create(int matchId) throws Exception {
String ResourceType = "Watcher";
ResourceManager manager = getResource().getResourceManager();
EndpointReference epr = null;
try {
Resource next =
manager.createResource(ResourceType);
Map<String, String> InitParams =
next.getInitializationParameters();
InitParams.put("_matchId",
Integer.toString(matchId));
InitParams.put("_port", "9090");
epr = next.getEndpointReference();
next.setEndpointReference(changeResourceId(epr,
Integer.toString(matchId)));
next.setInitializationParameters(InitParams);
System.out.println("InitParams
(next.getInitParams): "+next.getInitializationParameters());
next.initialize();
manager.addResource(epr, next);
} catch (Throwable error){
error.printStackTrace();
}
return epr;
}
*** The resource being instantiated ***
public void initialize() throws SoapFault
{
super.initialize();
if(getResource().getInitializationParameter("_matchId") != null)
_matchId =
Integer.parseInt(getResource().getInitializationParameter("_matchId"));
if(getResource().getInitializationParameter("_port") != null)
_port =
Integer.parseInt(getResource().getInitializationParameter("_port"));
}
-----Original Message-----
From: Chris.Twiner@swisscom.com [mailto:Chris.Twiner@swisscom.com]
Sent: 27 November 2007 11:13
To: muse-user@ws.apache.org
Subject: RE: using public interface InitializationParameters
Hi Lenni,
I think you're only chance is to configure your own ResourceDescriptor.
I am using this approach to load the correct WSDL for my environment.
As such its pretty easy to change element values etc in DOM before any
defaults get loaded.
I've found that SimpleResourceDescriptor can be used as a base and by
overriding the getWsdlOperations (via copy and paste :-) you can
intercept the wsdl document before anything is read from it.
hth
Chris
-----Original Message-----
From: lenni.madsen@bt.com [mailto:lenni.madsen@bt.com]
Sent: Monday, November 26, 2007 7:04 PM
To: muse-user@ws.apache.org
Subject: using public interface InitializationParameters
Hi guys
To overcome a problem I need to update the parameters specified in the
WSDL of the service before I instantiate the WsResource, and I was
hoping to use the InitializationParameters interface.
But I can't seem to access the variables that I need to set (the
initialization step uses the default hardcoded ones in stead).
Have anyone utilized this interfase yet? And/or any good ideas?
Sincerely
Lenni
*** code from the factory that instantiates the WsResource ***
public EndpointReference create(int matchId) throws Exception {
String ResourceType = "Watcher";
ResourceManager manager = getResource().getResourceManager();
EndpointReference epr = null;
Map InitParams = new HashMap();
InitParams.put("_matchId", matchId);
try {
Resource next =
manager.createResource(ResourceType);
epr = next.getEndpointReference();
next.setEndpointReference(changeResourceId(epr,
Integer.toString(matchId)));
next.setInitializationParameters(InitParams);
next.initialize();
manager.addResource(epr, next);
} catch (Throwable error){
error.printStackTrace();
}
return epr;
}
// <wsa:EndpointReference>
// <wsa:Address
xmlns:wsa="http://www.w3.org/2005/08/addressing">http://hostId/Wrapper/s
ervices/Wrapper</wsa:Address>
// <wsa:ReferenceParameters
xmlns:wsa="http://www.w3.org/2005/08/addressing">
// <muse-wsa:ResourceId
xmlns:muse-wsa="http://ws.apache.org/muse/addressing">WatcherId</muse-ws
a:ResourceId>
// </wsa:ReferenceParameters>
// </wsa:EndpointReference>
private EndpointReference changeResourceId(EndpointReference epr,
String matchId) throws IOException, TransformerException
{
QName resourceIdQName = new
QName("http://ws.apache.org/muse/addressing", "ResourceId", "muse-wsa");
// System.out.println("epr:
"+XmlUtils.toString(epr.toXML(),false));
epr.getParameter(resourceIdQName).setTextContent(matchId);
// System.out.println("epr:
"+XmlUtils.toString(epr.toXML(),false));
return epr;
}
---------------------------------------------------------------------
To unsubscribe, e-mail: muse-user-unsubscribe@ws.apache.org
For additional commands, e-mail: muse-user-help@ws.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: muse-user-unsubscribe@ws.apache.org
For additional commands, e-mail: muse-user-help@ws.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: muse-user-unsubscribe@ws.apache.org
For additional commands, e-mail: muse-user-help@ws.apache.org
RE: using public interface InitializationParameters
Posted by Ch...@swisscom.com.
Hi Lenni,
I think you're only chance is to configure your own ResourceDescriptor.
I am using this approach to load the correct WSDL for my environment.
As such its pretty easy to change element values etc in DOM before any
defaults get loaded.
I've found that SimpleResourceDescriptor can be used as a base and by
overriding the getWsdlOperations (via copy and paste :-) you can
intercept the wsdl document before anything is read from it.
hth
Chris
-----Original Message-----
From: lenni.madsen@bt.com [mailto:lenni.madsen@bt.com]
Sent: Monday, November 26, 2007 7:04 PM
To: muse-user@ws.apache.org
Subject: using public interface InitializationParameters
Hi guys
To overcome a problem I need to update the parameters specified in the
WSDL of the service before I instantiate the WsResource, and I was
hoping to use the InitializationParameters interface.
But I can't seem to access the variables that I need to set (the
initialization step uses the default hardcoded ones in stead).
Have anyone utilized this interfase yet? And/or any good ideas?
Sincerely
Lenni
*** code from the factory that instantiates the WsResource ***
public EndpointReference create(int matchId) throws Exception {
String ResourceType = "Watcher";
ResourceManager manager = getResource().getResourceManager();
EndpointReference epr = null;
Map InitParams = new HashMap();
InitParams.put("_matchId", matchId);
try {
Resource next =
manager.createResource(ResourceType);
epr = next.getEndpointReference();
next.setEndpointReference(changeResourceId(epr,
Integer.toString(matchId)));
next.setInitializationParameters(InitParams);
next.initialize();
manager.addResource(epr, next);
} catch (Throwable error){
error.printStackTrace();
}
return epr;
}
// <wsa:EndpointReference>
// <wsa:Address
xmlns:wsa="http://www.w3.org/2005/08/addressing">http://hostId/Wrapper/s
ervices/Wrapper</wsa:Address>
// <wsa:ReferenceParameters
xmlns:wsa="http://www.w3.org/2005/08/addressing">
// <muse-wsa:ResourceId
xmlns:muse-wsa="http://ws.apache.org/muse/addressing">WatcherId</muse-ws
a:ResourceId>
// </wsa:ReferenceParameters>
// </wsa:EndpointReference>
private EndpointReference changeResourceId(EndpointReference epr,
String matchId) throws IOException, TransformerException
{
QName resourceIdQName = new
QName("http://ws.apache.org/muse/addressing", "ResourceId", "muse-wsa");
// System.out.println("epr:
"+XmlUtils.toString(epr.toXML(),false));
epr.getParameter(resourceIdQName).setTextContent(matchId);
// System.out.println("epr:
"+XmlUtils.toString(epr.toXML(),false));
return epr;
}
---------------------------------------------------------------------
To unsubscribe, e-mail: muse-user-unsubscribe@ws.apache.org
For additional commands, e-mail: muse-user-help@ws.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: muse-user-unsubscribe@ws.apache.org
For additional commands, e-mail: muse-user-help@ws.apache.org
using public interface InitializationParameters
Posted by le...@bt.com.
Hi guys
To overcome a problem I need to update the parameters specified in the
WSDL of the service before I instantiate the WsResource, and I was
hoping to use the InitializationParameters interface.
But I can't seem to access the variables that I need to set (the
initialization step uses the default hardcoded ones in stead).
Have anyone utilized this interfase yet? And/or any good ideas?
Sincerely
Lenni
*** code from the factory that instantiates the WsResource ***
public EndpointReference create(int matchId) throws Exception {
String ResourceType = "Watcher";
ResourceManager manager = getResource().getResourceManager();
EndpointReference epr = null;
Map InitParams = new HashMap();
InitParams.put("_matchId", matchId);
try {
Resource next =
manager.createResource(ResourceType);
epr = next.getEndpointReference();
next.setEndpointReference(changeResourceId(epr,
Integer.toString(matchId)));
next.setInitializationParameters(InitParams);
next.initialize();
manager.addResource(epr, next);
} catch (Throwable error){
error.printStackTrace();
}
return epr;
}
// <wsa:EndpointReference>
// <wsa:Address
xmlns:wsa="http://www.w3.org/2005/08/addressing">http://hostId/Wrapper/s
ervices/Wrapper</wsa:Address>
// <wsa:ReferenceParameters
xmlns:wsa="http://www.w3.org/2005/08/addressing">
// <muse-wsa:ResourceId
xmlns:muse-wsa="http://ws.apache.org/muse/addressing">WatcherId</muse-ws
a:ResourceId>
// </wsa:ReferenceParameters>
// </wsa:EndpointReference>
private EndpointReference changeResourceId(EndpointReference epr,
String matchId) throws IOException, TransformerException
{
QName resourceIdQName = new
QName("http://ws.apache.org/muse/addressing", "ResourceId", "muse-wsa");
// System.out.println("epr:
"+XmlUtils.toString(epr.toXML(),false));
epr.getParameter(resourceIdQName).setTextContent(matchId);
// System.out.println("epr:
"+XmlUtils.toString(epr.toXML(),false));
return epr;
}
---------------------------------------------------------------------
To unsubscribe, e-mail: muse-user-unsubscribe@ws.apache.org
For additional commands, e-mail: muse-user-help@ws.apache.org
Re: I think "muse-template.wsdl" file is wrong
Posted by montoyax <jm...@gmail.com>.
Of course, if you have the correct muse-template.wsdl, please put the URL or
send me. Thanks.
--
View this message in context: http://www.nabble.com/I-think-%22muse-template.wsdl%22-file-is-wrong-tf4866907.html#a13927801
Sent from the Muse User mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: muse-user-unsubscribe@ws.apache.org
For additional commands, e-mail: muse-user-help@ws.apache.org