private static ServiceInfo findServiceByName(
     org.apache.cxf.service.Service cxfService, QName serviceName) {
   for (ServiceInfo si : cxfService.getServiceInfos()) {
     if (si.getName().equals(serviceName)) {
       return si;
     }
   }
   return null;
 }
  public void loadJavascriptForService(ServiceInfo serviceInfo) {
    Collection<SchemaInfo> schemata = serviceInfo.getSchemas();
    BasicNameManager nameManager = BasicNameManager.newNameManager(serviceInfo);
    NamespacePrefixAccumulator prefixManager =
        new NamespacePrefixAccumulator(serviceInfo.getXmlSchemaCollection());
    for (SchemaInfo schema : schemata) {
      SchemaJavascriptBuilder builder =
          new SchemaJavascriptBuilder(
              serviceInfo.getXmlSchemaCollection(), prefixManager, nameManager);
      String allThatJavascript = builder.generateCodeForSchema(schema.getSchema());
      readStringIntoRhino(allThatJavascript, schema.toString() + ".js");
    }

    ServiceJavascriptBuilder serviceBuilder =
        new ServiceJavascriptBuilder(serviceInfo, null, prefixManager, nameManager);
    serviceBuilder.walk();
    String serviceJavascript = serviceBuilder.getCode();
    readStringIntoRhino(serviceJavascript, serviceInfo.getName() + ".js");
  }