builder.append("<wsdl:definitions xmlns:wsdl=\"http://schemas.xmlsoap.org/wsdl/\" xmlns:ns1=\"http://org.apache.axis2/xsd\" xmlns:ns=\"http://www.wso2.org/types\" xmlns:wsaw=\"http://www.w3.org/2006/05/addressing/wsdl\" xmlns:http=\"http://schemas.xmlsoap.org/wsdl/http/\" xmlns:xs=\"http://www.w3.org/2001/XMLSchema\" xmlns:soap=\"http://schemas.xmlsoap.org/wsdl/soap/\" xmlns:mime=\"http://schemas.xmlsoap.org/wsdl/mime/\" xmlns:soap12=\"http://schemas.xmlsoap.org/wsdl/soap12/\" targetNamespace=\"http://www.wso2.org/types\">"); builder.append("<wsdl:documentation>"); builder.append(service.getType().getName()); builder.append("</wsdl:documentation>"); builder.append("<wsdl:types>"); builder.append("<xs:schema attributeFormDefault=\"qualified\" elementFormDefault=\"unqualified\" targetNamespace=\"http://www.wso2.org/types\">"); boolean isInputParametersPresent = service.getType().getInputParametersArray() != null && service.getType().getInputParametersArray().length > 0; if (isInputParametersPresent) { builder.append("<xs:element name=\"invoke\">"); for (int i = 0; i < p.getInputParametersArray().length; i++) { generateElementFromInputType(p.getInputParametersArray(i), builder); boolean isOutputParametersPresent = service.getType().getOutputParametersArray() != null && service.getType().getOutputParametersArray().length > 0; if (isOutputParametersPresent) { builder.append("<xs:element name=\"invokeResponse\">"); for (int i = 0; i < p.getOutputParametersArray().length; i++) { generateElementFromOutputType(p.getOutputParametersArray(i), builder); builder.append(service.getType().getName()); builder.append("\">"); builder.append("<wsdl:operation name=\"invoke\">");
InputParameterType[] inputParams = serviceDesc.getInputParametersArray(); Vector inParamNames = new Vector(); Vector inParamDesc = new Vector(); OutputParameterType[] outputParams = serviceDesc.getOutputParametersArray(); Vector outParamNames = new Vector(); Vector outParamDesc = new Vector(); String methodName = serviceDesc.getPortType().getMethod().getMethodName(); WSDLMessageBean wsdlMsgBean = new WSDLMessageBean(); wsdlMsgBean.setNamespace(typens); || dataType.equals("DoubleEnum")) { String paramName = (String) inParamNames.get(j); String[] paramValues = serviceDesc.getInputParametersArray(j).getParameterValueArray(); if (paramValues == null) continue; WSDLGenerator.createMetadata(serviceDesc.getOutputParametersArray(j), doc, annotation); documentation = doc.createElement(DOCUMENTATION); documentation.appendChild(doc.createTextNode((String) outParamDesc.get(j)));
public static String getWSDL(ServiceDescription service) throws Exception{ try { ServiceType type = service.getType().addNewService(); ServiceType.ServiceName name = type.addNewServiceName(); name.setStringValue(service.getType().getName()); name.setTargetNamespace("http://airavata.apache.org/schemas/gfac/2012/12"); if(service.getType().getPortType() == null){ PortTypeType portType = service.getType().addNewPortType(); MethodType methodType = portType.addNewMethod(); methodType.setMethodName("invoke"); }else{ MethodType method = service.getType().getPortType().getMethod(); if (method == null) { MethodType methodType = service.getType().getPortType().addNewMethod(); methodType.setMethodName("invoke"); } else { service.getType().getPortType().getMethod().setMethodName("invoke"); } } WSDLGenerator generator = new WSDLGenerator(); Hashtable table = generator.generateWSDL(null, null, null, service.getType(), true); return (String) table.get(WSDLConstants.AWSDL); } catch (Exception e) { throw new RuntimeException(e); } }
public String getWSDL(ServiceDescription service) { try { ServiceType type = service.getType().addNewService(); ServiceName name = type.addNewServiceName(); name.setStringValue(service.getType().getName()); name.setTargetNamespace("http://schemas.airavata.apache.org/gfac/type"); PortTypeType portType = service.getType().addNewPortType(); MethodType methodType = portType.addNewMethod(); methodType.setMethodName("invoke"); WSDLGenerator generator = new WSDLGenerator(); Hashtable table = generator.generateWSDL(null, null, null, service.getType(), true); return (String) table.get(WSDLConstants.AWSDL); } catch (Exception e) { throw new RuntimeException(e); } }
public static ServiceDescriptor createServiceDescriptor(ServiceDescription serviceDescription){ ServiceDescriptor serviceDescriptor = new ServiceDescriptor(); serviceDescriptor.setServiceName(serviceDescription.getType().getName()); serviceDescriptor.setDescription(serviceDescription.getType().getDescription()); InputParameterType[] inputParametersArray = serviceDescription.getType().getInputParametersArray(); OutputParameterType[] outputParametersArray = serviceDescription.getType().getOutputParametersArray(); List<ServiceParameters> inputParams = new ArrayList<ServiceParameters>(); List<ServiceParameters> outputParams = new ArrayList<ServiceParameters>();
QName wsdlQName = null; String wsdlString = null; String serviceName = serviceDesc.getService().getServiceName().getStringValue(); String nameSpaceURI = serviceDesc.getService().getServiceName().getTargetNamespace(); QName serviceQName = new QName(nameSpaceURI, serviceName); PortTypeType portType = serviceDesc.getPortType(); MethodType method = portType.getMethod(); QName portTypeName = serviceQName; Document doc = dImpl.createDocument(namespace, "factoryServices", null); String description = serviceDesc.getService().getServiceDescription(); if (description != null) { Element documentation = doc.createElementNS("http://schemas.xmlsoap.org/wsdl/", "wsdl:documentation"); Binding binding = addBinding(def, nameSpaceURI, wsdlPortType, serviceLevelPolicRef, dImpl); String methodDesc = serviceDesc.getPortType().getMethod().getMethodDescription(); String methodName = serviceDesc.getPortType().getMethod().getMethodName(); OutputParameterType[] outputParams = serviceDesc.getOutputParametersArray();
ServiceDescriptionType serviceDescriptionType = serviceDescription.getType(); for (Parameter parameter : serviceDescriptionType.getInputParametersArray()) { OMElement element = input.getFirstChildWithName(new QName(null,parameter.getParameterName())); if (element == null) { for (OutputParameterType parameter : serviceDescriptionType.getOutputParametersArray()) { ActualParameter actualParameter = new ActualParameter(); if("String".equals(parameter.getParameterType().getName())){
getServiceDescription().getType().getOutputParametersArray(); for(OutputParameterType outparamType : outputParametersArray){ String paramName = outparamType.getParameterName();
for (Parameter parameter : serviceDescriptionType.getInputParametersArray()) { OMElement element = input.getFirstChildWithName(new QName(null,parameter.getParameterName().replaceAll(WSDLConstants.HYPHEN, WSDLConstants.HYPHEN_REPLACEMENT))); if(element == null){
public static MethodType findOperationFromServiceDesc(String methodName, ServiceDescriptionType serviceDescType) throws GFacWSDLException { PortTypeType portType = serviceDescType.getPortType(); if (serviceDescType.getPortType().getMethod().getMethodName().equals(methodName)) { serviceDescType.getPortType().getMethod(); } if (isInbuiltOperation(methodName)) { MethodType builtInOperationType = portType.addNewMethod(); builtInOperationType.setMethodName(methodName); return builtInOperationType; } throw new GFacWSDLException("Method name " + methodName + " not found"); }
public String saveServiceDescription(ServiceDescription service) { Session session = null; String result = null; try { session = getSession(); Node serviceNode = getServiceNode(session); Node node = getOrAddNode(serviceNode, service.getType().getName()); node.setProperty(XML_PROPERTY_NAME, service.toXML()); session.save(); result = node.getIdentifier(); triggerObservers(this); } catch (Exception e) { System.out.println(e); e.printStackTrace(); // TODO propagate } finally { closeSession(session); } return result; }
QName wsdlQName = null; String wsdlString = null; String serviceName = serviceDesc.getService().getServiceName().getStringValue(); String nameSpaceURI = serviceDesc.getService().getServiceName().getTargetNamespace(); QName serviceQName = new QName(nameSpaceURI, serviceName); PortTypeType portType = serviceDesc.getPortType(); MethodType method = portType.getMethod(); QName portTypeName = serviceQName; Document doc = dImpl.createDocument(namespace, "factoryServices", null); String description = serviceDesc.getService().getServiceDescription(); if (description != null) { Element documentation = doc.createElementNS("http://schemas.xmlsoap.org/wsdl/", "wsdl:documentation"); Binding binding = addBinding(def, nameSpaceURI, wsdlPortType, serviceLevelPolicRef, dImpl); String methodDesc = serviceDesc.getPortType().getMethod().getMethodDescription(); String methodName = serviceDesc.getPortType().getMethod().getMethodName(); OutputParameterType[] outputParams = serviceDesc.getOutputParametersArray();
public static MethodType findOperationFromServiceDesc(String methodName, ServiceDescriptionType serviceDescType) throws GFacWSDLException { PortTypeType portType = serviceDescType.getPortType(); if (serviceDescType.getPortType().getMethod().getMethodName().equals(methodName)) { serviceDescType.getPortType().getMethod(); } if (isInbuiltOperation(methodName)) { MethodType builtInOperationType = portType.addNewMethod(); builtInOperationType.setMethodName(methodName); return builtInOperationType; } throw new GFacWSDLException("Method name " + methodName + " not found"); }
builder.append("<wsdl:definitions xmlns:wsdl=\"http://schemas.xmlsoap.org/wsdl/\" xmlns:ns1=\"http://org.apache.axis2/xsd\" xmlns:ns=\"http://www.wso2.org/types\" xmlns:wsaw=\"http://www.w3.org/2006/05/addressing/wsdl\" xmlns:http=\"http://schemas.xmlsoap.org/wsdl/http/\" xmlns:xs=\"http://www.w3.org/2001/XMLSchema\" xmlns:soap=\"http://schemas.xmlsoap.org/wsdl/soap/\" xmlns:mime=\"http://schemas.xmlsoap.org/wsdl/mime/\" xmlns:soap12=\"http://schemas.xmlsoap.org/wsdl/soap12/\" targetNamespace=\"http://www.wso2.org/types\">"); builder.append("<wsdl:documentation>"); builder.append(service.getType().getName()); builder.append("</wsdl:documentation>"); builder.append("<wsdl:types>"); builder.append("<xs:schema attributeFormDefault=\"qualified\" elementFormDefault=\"unqualified\" targetNamespace=\"http://www.wso2.org/types\">"); boolean isInputParametersPresent = service.getType().getInputParametersArray() != null && service.getType().getInputParametersArray().length > 0; if (isInputParametersPresent) { builder.append("<xs:element name=\"invoke\">"); for (int i = 0; i < p.getInputParametersArray().length; i++) { generateElementFromInputType(p.getInputParametersArray(i), builder); boolean isOutputParametersPresent = service.getType().getOutputParametersArray() != null && service.getType().getOutputParametersArray().length > 0; if (isOutputParametersPresent) { builder.append("<xs:element name=\"invokeResponse\">"); for (int i = 0; i < p.getOutputParametersArray().length; i++) { generateElementFromOutputType(p.getOutputParametersArray(i), builder); builder.append(service.getType().getName()); builder.append("\">"); builder.append("<wsdl:operation name=\"invoke\">");
InputParameterType[] inputParams = serviceDesc.getInputParametersArray(); Vector inParamNames = new Vector(); Vector inParamDesc = new Vector(); OutputParameterType[] outputParams = serviceDesc.getOutputParametersArray(); Vector outParamNames = new Vector(); Vector outParamDesc = new Vector(); String methodName = serviceDesc.getPortType().getMethod().getMethodName(); WSDLMessageBean wsdlMsgBean = new WSDLMessageBean(); wsdlMsgBean.setNamespace(typens); || dataType.equals("DoubleEnum")) { String paramName = (String) inParamNames.get(j); String[] paramValues = serviceDesc.getInputParametersArray(j).getParameterValueArray(); if (paramValues == null) continue; WSDLGenerator.createMetadata(serviceDesc.getOutputParametersArray(j), doc, annotation); documentation = doc.createElement(DOCUMENTATION); documentation.appendChild(doc.createTextNode((String) outParamDesc.get(j)));