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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to