Exemplo n.º 1
0
 /*      */ public static String getOperationSOAPAction(BindingOperation bindingOper) /*      */ {
   /*  931 */ List elems = bindingOper.getExtensibilityElements();
   /*  932 */ Iterator it = elems.iterator();
   /*  933 */ boolean found = false;
   /*  934 */ String action = null;
   /*      */
   /*  936 */ while ((!found) && (it.hasNext())) {
     /*  937 */ ExtensibilityElement elem = (ExtensibilityElement) it.next();
     /*      */
     /*  940 */ if ((elem instanceof SOAPOperation)) {
       /*  941 */ SOAPOperation soapOp = (SOAPOperation) elem;
       /*  942 */ action = soapOp.getSoapActionURI();
       /*  943 */ found = true;
       /*  944 */ } else if ((elem instanceof UnknownExtensibilityElement))
     /*      */ {
       /*  947 */ UnknownExtensibilityElement unkElement = (UnknownExtensibilityElement) elem;
       /*      */
       /*  949 */ QName name = unkElement.getElementType();
       /*      */
       /*  952 */ if ((name.getNamespaceURI().equals("http://schemas.xmlsoap.org/wsdl/soap12/"))
           && (name.getLocalPart().equals("operation")))
       /*      */ {
         /*  955 */ action = unkElement.getElement().getAttribute("soapAction");
         /*      */
         /*  957 */ found = true;
         /*      */ }
       /*      */ }
     /*      */ }
   /*  961 */ return action;
   /*      */ }
 public static String getActionURL(
     Definition wsdlDefinition,
     String serviceName,
     String portName,
     String bindingName,
     String opName) {
   Map<?, ?> services = wsdlDefinition.getServices();
   Set<?> serviceKeys = services.keySet();
   for (Iterator<?> it = serviceKeys.iterator(); it.hasNext(); ) {
     QName serviceKey = (QName) it.next();
     if (serviceName != null && serviceKey.getLocalPart().contentEquals(serviceName)) {
       Service service = (Service) services.get(serviceKey);
       Map<?, ?> ports = service.getPorts();
       Set<?> portKeys = ports.keySet();
       for (Iterator<?> it2 = portKeys.iterator(); it2.hasNext(); ) {
         String portKey = (String) it2.next();
         if (portName != null && portKey.contentEquals(portName)) {
           Port port = (Port) ports.get(portKey);
           Binding wsdlBinding = port.getBinding();
           List<?> operations = wsdlBinding.getBindingOperations();
           for (Iterator<?> it3 = operations.iterator(); it3.hasNext(); ) {
             BindingOperation operation = (BindingOperation) it3.next();
             if (opName != null && operation.getName().contentEquals(opName)) {
               List<?> attributesList = operation.getExtensibilityElements();
               for (Iterator<?> it4 = attributesList.iterator(); it4.hasNext(); ) {
                 Object test = it4.next();
                 if (test instanceof SOAPOperation) {
                   SOAPOperation soapOp = (SOAPOperation) test;
                   return soapOp.getSoapActionURI();
                 } else if (test instanceof SOAP12Operation) {
                   SOAP12Operation soapOp = (SOAP12Operation) test;
                   return soapOp.getSoapActionURI();
                 }
               }
             }
           }
         }
       }
     }
   }
   return null;
 }