Examples of XmlResponseParser


Examples of com.twilio.sdk.parser.XmlResponseParser

   */
  public ResponseParser getParser() {
    if (this.isJson()) {
      return new JsonResponseParser();
    } else if (this.isXml()) {
      return new XmlResponseParser();
    }

    throw new UnsupportedOperationException(this.contentType
        + " not a supported content type");
  }
View Full Code Here

Examples of isbndb.XmlResponseParser

        fIsbn.getValue());
   
    RestRequestor restRequestor = new RestRequestor();
    restRequestor.request(request);
   
    XmlResponseParser xmlResponseParser = new XmlResponseParser();
   
    lookup.setAccessKey(getIsbnkey());
    lookup.setRequestor(restRequestor);
    lookup.setResponseParser(xmlResponseParser);
   
View Full Code Here

Examples of org.apache.solr.client.solrj.impl.XMLResponseParser

      else
        localClient.getCredentialsProvider().setCredentials(AuthScope.ANY, credentials);
    }

    String httpSolrServerUrl = protocol + "://" + server + ":" + port + location;
    HttpSolrServer httpSolrServer = new ModifiedHttpSolrServer(httpSolrServerUrl, localClient, new XMLResponseParser());
    // Set the solrj instance we want to use
    solrServer = httpSolrServer;
  }
View Full Code Here

Examples of org.apache.solr.client.solrj.impl.XMLResponseParser

      else
        localClient.getCredentialsProvider().setCredentials(AuthScope.ANY, credentials);
    }

    String httpSolrServerUrl = protocol + "://" + server + ":" + port + location;
    HttpSolrServer httpSolrServer = new ModifiedHttpSolrServer(httpSolrServerUrl, localClient, new XMLResponseParser());
    // Set the solrj instance we want to use
    solrServer = httpSolrServer;
  }
View Full Code Here

Examples of org.apache.solr.client.solrj.impl.XMLResponseParser

        /*System.setProperty("solr.solr.home", "/home/shalinsmangar/work/oss/branch-1.3/example/solr");
        CoreContainer.Initializer initializer = new CoreContainer.Initializer();
        CoreContainer coreContainer = initializer.initialize();
        EmbeddedSolrServer server = new EmbeddedSolrServer(coreContainer, "");*/
     
      httpServer.setParser(new XMLResponseParser());
      this.solrServer = (SolrServer) httpServer;
     
    } catch (MalformedURLException e) {
      // TODO Auto-generated catch block
      e.printStackTrace();
View Full Code Here

Examples of org.apache.solr.client.solrj.impl.XMLResponseParser

      else
        localClient.getCredentialsProvider().setCredentials(AuthScope.ANY, credentials);
    }

    String httpSolrServerUrl = protocol + "://" + server + ":" + port + location;
    HttpSolrServer httpSolrServer = new ModifiedHttpSolrServer(httpSolrServerUrl, localClient, new XMLResponseParser());
    // Set the solrj instance we want to use
    solrServer = httpSolrServer;
  }
View Full Code Here

Examples of org.apache.solr.client.solrj.impl.XMLResponseParser

    start = System.currentTimeMillis();
    writerName = writerName.intern();
    for (int i=0; i<decIter; i++) {
      ResponseParser rp = null;
      if (writerName == "xml") {
        rp = new XMLResponseParser();
      } else if (writerName == "javabin") {
        rp = new BinaryResponseParser();
      } else {
        break;
      }
View Full Code Here

Examples of org.apache.solr.client.solrj.impl.XMLResponseParser

        // choose format
        if (server instanceof CommonsHttpSolrServer) {
          if (random.nextBoolean()) {
            ((CommonsHttpSolrServer) server).setParser(new BinaryResponseParser());
          } else {
            ((CommonsHttpSolrServer) server).setParser(new XMLResponseParser());
          }
        }

        int numDocs = _TestUtil.nextInt(random, 1, 100);
       
View Full Code Here

Examples of org.apache.solr.client.solrj.impl.XMLResponseParser

* @since solr 1.3
*/
public class QueryResponseTest extends LuceneTestCase {
  @Test
  public void testDateFacets() throws Exception   {
    XMLResponseParser parser = new XMLResponseParser();
    InputStream is = new SolrResourceLoader(null, null).openResource("sampleDateFacetResponse.xml");
    assertNotNull(is);
    Reader in = new InputStreamReader(is, "UTF-8");
    NamedList<Object> response = parser.processResponse(in);
    in.close();
   
    QueryResponse qr = new QueryResponse(response, null);
    Assert.assertNotNull(qr);
   
View Full Code Here

Examples of org.apache.solr.client.solrj.impl.XMLResponseParser

public class TestDocumentObjectBinder extends LuceneTestCase
{
  public void testSimple() throws Exception {
    DocumentObjectBinder binder = new DocumentObjectBinder();
    XMLResponseParser parser = new XMLResponseParser();
    NamedList<Object> nl = null;
    nl = parser.processResponse(new StringReader(xml));
    QueryResponse res = new QueryResponse(nl, null);
    SolrDocumentList solDocList = res.getResults();
    List<Item> l = binder.getBeans(Item.class,res.getResults());
    Assert.assertEquals(solDocList.size(), l.size());
    Assert.assertEquals(solDocList.get(0).getFieldValue("features"), l.get(0).features);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.