⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 wsdlservice.java

📁 开发owl的API,提供了W3C规定标准接口,是目前比较少的API.
💻 JAVA
📖 第 1 页 / 共 2 页
字号:

                    if (cls.isInstance(symTabEntry)) {
                        return symTabEntry;
                    }
                }
            }
        }
        return null;
    }

    private Port selectPort(Map ports, String portName) throws Exception {
        Iterator valueIterator = ports.keySet().iterator();
        while (valueIterator.hasNext()) {
            String name = (String) valueIterator.next();

            if ((portName == null) || (portName.length() == 0)) {
                Port port = (Port) ports.get(name);
                List list = port.getExtensibilityElements();

                for (int i = 0; (list != null) && (i < list.size()); i++) {
                    Object obj = list.get(i);
                    if (obj instanceof SOAPAddress) {
                        return port;
                    }
                }
            } else if ((name != null) && name.equals(portName)) {
                return (Port) ports.get(name);
            }
        }
        return null;
    }
	
	public String getFileURI() {
		return uri;//serviceDef.getDocumentBaseURI();
	}
	
	public Vector getOperations() {
		return new Vector(operations.values());
	}
	
	public WSDLOperation getOperation(String opName) {
		return (WSDLOperation) operations.get(opName);
	}
	
	/*
	private void readOperations() {
		try {			
			//printExtensibilityElements(serviceDef.getTypes().getExtensibilityElements());
				
			Iterator services = serviceDef.getServices().entrySet().iterator();
			
			if(DEBUG)	
				Utils.printTime("get services "  + 
					serviceDef.getServices().entrySet().size());
			
			while(services.hasNext()) {
				Map.Entry e = (Map.Entry) services.next();
				Service service = (Service) e.getValue();
				
				if(DEBUG)
					Utils.printTime("Service: " + service.getQName());
					
				Iterator ports = service.getPorts().entrySet().iterator();
				while(ports.hasNext()) {
					Port port = (Port) ((Map.Entry) ports.next()).getValue();
					Binding binding = port.getBinding();
					
					SOAPAddress soapAddress = (SOAPAddress)
						findExtensibilityElement(
							port.getExtensibilityElements(), SOAPAddress.class);
																						
					SOAPBinding soapBinding = (SOAPBinding)
						findExtensibilityElement(
							binding.getExtensibilityElements(), SOAPBinding.class);

					if(DEBUG)					
						Utils.printTime("   Port   : " + port.getName());
											
					if(soapBinding == null) continue;
						
					if(DEBUG)
						Utils.printTime("   Binding: " + binding.getQName());
										
					Iterator bindingOps = binding.getBindingOperations().iterator();
					while(bindingOps.hasNext()) {
						BindingOperation bindingOp = (BindingOperation) bindingOps.next();
						Operation operation = (Operation) bindingOp.getOperation();
						
						SOAPOperation soapOperation = (SOAPOperation)
							findExtensibilityElement(
								bindingOp.getExtensibilityElements(), SOAPOperation.class);
								
						if(DEBUG) {	
							Utils.printTime("       BindingOp : " + bindingOp.getName());
							Utils.printTime("       SOAPAddr  : " + soapAddress.getLocationURI());
							Utils.printTime("       SOAPAction: " + soapOperation.getSoapActionURI());
							Utils.printTime("       Operation : " + operation.getName());
						}			
						
						SOAPBody soapBody = (SOAPBody)
							findExtensibilityElement(
								bindingOp.getBindingInput().getExtensibilityElements(), SOAPBody.class);

				  		String ns = null;
				  		
				  		if(soapBody != null && soapBody.getNamespaceURI() != null)
				  			ns = soapBody.getNamespaceURI();
				  		else if(serviceDef.getTargetNamespace() != null)
				  			ns = serviceDef.getTargetNamespace();

						if(DEBUG)
							Utils.printTime("       Namespace : " + ns);

						String soapAddr = soapAddress.getLocationURI();
						// Following line is for debugging with tcpMon tool of Axis 
						if(USE_TCPMON) {
							String host = soapAddr.substring(7, soapAddr.indexOf("/", 8));
							soapAddr = Utils.replace(soapAddr, host, "localhost");
							System.out.println(soapAddr);
						}
						
						//Utils.printTime("create service");
						//Call call = new Call(soapAddr);
						org.apache.axis.client.Service s = new org.apache.axis.client.Service();
						//Utils.printTime("create call");
						Call call = new Call(s);
						//Utils.printTime("set properties");
						call.setTargetEndpointAddress(soapAddr);
				  		call.setOperationName(new QName(ns, operation.getName()));

					    String soapAction = soapOperation.getSoapActionURI();
					    if (soapAction.length() > 0)
					    {
					      call.setUseSOAPAction(true);
					      call.setSOAPActionURI(soapAction);
					    }	
					    
					    if(DEBUG)
					    	Utils.printTime("       Create op : ");
					    
					    WSDLOperation op = new WSDLOperation(call);
					    op.setService(this);
					    
					    if(DEBUG)
					    	Utils.printTime("       Create op : " + op.getName());
					    
					    Message inputMessage = 
					    	operation.getInput().getMessage();
					    Iterator inputs = 
					    	inputMessage.getOrderedParts(null).iterator();
									    	
					    while(inputs.hasNext()) {
					    	Part p = (Part) inputs.next();
					    						    	
					    	if(p.getTypeName() != null)
					    		op.addInput(p.getName(), p.getTypeName());
					    	else 
					    		op.addInput(p.getName(), p.getElementName());
					    		
					    	if(DEBUG) {
					    		Utils.printTime("       Input    : " + p.getName() + " " +  p.getTypeName() + " " + p.getElementName());
					    		
					    		WSDLParameter wp = op.getInput(p.getName());
					    		Utils.printTime("       Input    : " + wp.getName() + " " +  wp.getType());
					    	}
					    }

						Message outputMessage =
							operation.getOutput().getMessage();					    
					    Iterator outputs = 
					       	outputMessage.getOrderedParts(null).iterator();
					    
					    while(outputs.hasNext()) {
					    	Part p = (Part) outputs.next();
					    	if(p.getTypeName() != null)
					    		op.addOutput(p.getName(), p.getTypeName());
					    	else
					    		op.addOutput(p.getName(), p.getElementName());
					    	
					    	if(DEBUG) {
					    		Utils.printTime("       Output   : " + p.getName() + " " +  p.getTypeName() + " " + p.getElementName());
					    		
					    		WSDLParameter wp = op.getOutput(p.getName());
					    		Utils.printTime("       Output   : " + wp.getName() + " " +  wp.getType());
					    	}
					    		
					    }

					    op.setInputMessageName(inputMessage.getQName().getLocalPart());
					    op.setOutputMessageName(outputMessage.getQName().getLocalPart());
					    op.setPortName(port.getName());
					    
					    Node docElement = operation.getDocumentationElement();
					    if(docElement == null)
					    	docElement = serviceDef.getDocumentationElement();
					    if(docElement != null) {		
					    	String doc = docElement.getNodeValue();
					    	
					    	docElement = docElement.getFirstChild();
					    	if(doc == null && docElement != null)
					    		doc = docElement.getNodeValue();
					    				    	
					    	if(doc != null)
					    		op.setDocumentation(doc);
					    }
					    
					    if(DEBUG) {
					    	Utils.printTime("       Inputs   : " + op.getInputs().size());
					    	Utils.printTime("       Outputs  : " + op.getOutputs().size());
					    	Utils.printTime("       Document : " + op.getDocumentation());
					 	}
					    
						operations.put(operation.getName(), op);																		
					}
				}
			}
		} catch(Exception e) {
			System.err.println(e);
			e.printStackTrace();
		}
	}
	*/
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -