Package org.apache.muse.ws.resource.remote

Examples of org.apache.muse.ws.resource.remote.WsResourceClient


   
    // 4) Creates a proxy handler for service invocation.
    ProxyHandler metadataProxyHandler = createProxyHandler();
   
    // 5) ..and invokes the GetMetadata on the first member.
    WsResourceClient wsResourceClient = resources[0];
    wsResourceClient.setTrace(true);
   
    // Dialect is RDM for this example
    String dialect = "http://docs.oasis-open.org/wsrf/rmd-1";
    Object [] inputParameters = {dialect};
   
    // RDM is the first element of the returned array.
    // The first element is a wsx:Metadata containing all resource properties.
    Element [] metadata = (Element[]) wsResourceClient.invoke(metadataProxyHandler, inputParameters);
    Element resourceMetadataDescriptor   = metadata[0];
   
    // 6) using XPath navigates xml in order to get the list of all properties.
    Element [] properties = XmlUtils.findInSubTree(
        resourceMetadataDescriptor,
        new QName("http://docs.oasis-open.org/wsrf/rmd-1","Property","wsrmd"));
    List<QName> names = new ArrayList<QName>();
   
    for (Element property : properties)
    {
     
      String attributeName = property.getAttribute("name"); // = qman:<Attribute Name>
     
      // For this example we are only interested on qman namespace related properties...
      if (attributeName.startsWith("qman"))
      {
        String attributeNameWithoutPrefix = attributeName.replaceFirst("qman:", ""); //  = <Attribute Name>
     
        names.add(new QName(
                "http://amqp.apache.org/qpid/management/qman",
                attributeNameWithoutPrefix,
                "qman"))
      }
    }
   
    QName [] qnames = names.toArray(new QName[names.size()]);
   
    // 7) Send a GetMultipleResourcePropertiesRequest.
    // We do nothing with the returned value(s) because it / they
    // has / have already printed out (wsResourceClient.setTrace(true))
    @SuppressWarnings("unused")
    Element [] values = wsResourceClient.getMultipleResourceProperties(qnames);
  }
View Full Code Here


   
    // 4) Creates a proxy handler for service invocation.
    ProxyHandler metadataProxyHandler = createProxyHandler();
   
    // 5) ..and invokes the GetMetadata on the first member.
    WsResourceClient firstMember = resources[0];
    firstMember.setTrace(true);
   
    // Dialect is WSDL for this example
    String dialect = "http://schemas.xmlsoap.org/wsdl/";
    Object [] inputParameters = {dialect};
   
    // WSDL is the first element of the returned array. We don't need to print out it here
    // because at this point it should have been already printed out (line 96 : firstMember.setTrace(true))
    @SuppressWarnings("unused")
    Element [] metadata = (Element[]) firstMember.invoke(metadataProxyHandler, inputParameters);
  }
View Full Code Here

            //
            // convert ws-sg entry XML -> EPRs -> clients
            //
            Element eprXML = XmlUtils.getElement(entries[n], WssgConstants.MEMBER_SERVICE_EPR_QNAME);
            dest = new EndpointReference(eprXML);
            clients[n] = new WsResourceClient(dest, src);           
        }
       
        return clients;       
    }
View Full Code Here

    {
        if (epr == null)
            throw new NullPointerException(_MESSAGES.get("NullResource"));
       
        EndpointReference sgEPR = getServiceGroupEPR();       
        WsResourceClient resource = new WsResourceClient(epr, sgEPR);
        QName[] content = getContentElements();
       
        try
        {
            //
            // all we have to do is try and read all the properties
            // in the list - if any of them is undefined, this will
            // fault, and we don't have a match. there is no fault if
            // the property is defined but has zero instances
            //
            // note that we only do the test if there are some property
            // names - an empty array means "any resource is allowed"
            //
            if (content.length > 0)
                resource.getMultipleResourceProperties(content);
        }
       
        //
        // in this case, there is no error - this just means that
        // the resource does not match the membership rule
View Full Code Here

TOP

Related Classes of org.apache.muse.ws.resource.remote.WsResourceClient

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.