Example #1
0
 /** GetBindingFromInterfaceName Method. */
 public TBinding getBindingFromInterfaceName(TDefinitions descriptionType, String interfaceName) {
   for (TDocumented nextElement : descriptionType.getAnyTopLevelOptionalElement()) {
     // Create the service type
     if (nextElement instanceof TBinding) {
       QName qname = ((TBinding) nextElement).getType();
       if (interfaceName.equalsIgnoreCase(qname.getLocalPart())) return (TBinding) nextElement;
     }
   }
   return null;
 }
Example #2
0
 /** Search through the messages for this one and return the element name. */
 public String getElementNameFromMessageName(TDefinitions descriptionType, TParam message) {
   QName qName = message.getMessage();
   String name = qName.getLocalPart();
   for (TDocumented nextElement : descriptionType.getAnyTopLevelOptionalElement()) {
     // Create the service type
     if (nextElement instanceof TMessage) {
       String msgName = ((TMessage) nextElement).getName();
       for (TPart part : ((TMessage) nextElement).getPart()) {
         if (name.equals(part.getName())) {
           return part.getElement().getLocalPart();
         }
       }
     }
   }
   return null;
 }
Example #3
0
  /** ProcessInterfaceTypes Method. */
  public String processInterfaceTypes(TDefinitions descriptionType, boolean addAddress) {
    String allAddress = DBConstants.BLANK;

    for (TDocumented nextElement : descriptionType.getAnyTopLevelOptionalElement()) {
      // Create the service type
      if (nextElement instanceof TPortType) {
        String address = this.processPortType(descriptionType, (TPortType) nextElement, addAddress);
        if (allAddress != null) {
          if (allAddress == DBConstants.BLANK) allAddress = address;
          else if (!allAddress.equalsIgnoreCase(address))
            allAddress = null; // null = not all address are the same
        }
      }
    }

    return allAddress;
  }
Example #4
0
 /** GetServiceEndpointFromInterfaceNBinding Method. */
 public String getServiceEndpointFromInterfaceNBinding(
     TDefinitions descriptionType, String interfaceName, TBinding binding) {
   for (TBindingOperation nextElement : binding.getOperation()) {
     String name = nextElement.getName();
     if (interfaceName.equalsIgnoreCase(name)) {
       for (Object op : nextElement.getAny()) {
         if (op instanceof org.w3c.dom.Element) {
           String strName = ((org.w3c.dom.Element) op).getLocalName();
           if ("operation".equalsIgnoreCase(strName)) {
             String ops = ((org.w3c.dom.Element) op).getAttribute("soapAction");
             if (ops != null) return ops;
           }
         }
       }
     }
   }
   // Not found in there, return the default address
   for (TDocumented nextElement : descriptionType.getAnyTopLevelOptionalElement()) {
     // Create the service type
     if (nextElement instanceof TService) {
       for (TPort port : ((TService) nextElement).getPort()) {
         String portBindingName = port.getBinding().getLocalPart();
         String bindingName = binding.getName();
         if (bindingName.equals(portBindingName)) {
           for (Object op : port.getAny()) {
             if (op instanceof org.w3c.dom.Element) {
               String strName = ((org.w3c.dom.Element) op).getLocalName();
               if ("address".equalsIgnoreCase(strName)) {
                 String ops = ((org.w3c.dom.Element) op).getAttribute("location");
                 if (ops != null) return ops;
               }
             }
           }
         }
       }
     }
   }
   return null;
 }