Refine search
public static AxisService createSimpleService(QName serviceName, MessageReceiver messageReceiver, String className, QName opName) throws AxisFault { AxisService service = new AxisService(serviceName.getLocalPart()); service.setClassLoader(getContextClassLoader_DoPriv()); service.addParameter(new Parameter(Constants.SERVICE_CLASS, className)); AxisOperation axisOp = new InOutAxisOperation(opName); axisOp.setMessageReceiver(messageReceiver); axisOp.setStyle(WSDLConstants.STYLE_RPC); service.addOperation(axisOp); service.mapActionToOperation(Constants.AXIS2_NAMESPACE_URI + "/" + opName.getLocalPart(), axisOp); return service; }
private static Definition getWSDLDefinitionFromAxisService(final AxisService service) { Definition wsdlDefinition = (Definition) service .getParameter(BPELConstants.WSDL_4_J_DEFINITION).getValue(); QName serviceName = new QName(service.getTargetNamespace(), service.getName()); if (wsdlDefinition == null) { throw new NullPointerException("No WSDL Definition was found for service " + serviceName.getLocalPart() + "."); } checkWhetherServiceDefinitionIsAvailable(wsdlDefinition, serviceName); return wsdlDefinition; }
private AxisOperation getAxisOperation(AxisService axisService, String opName) { AxisOperation axisOperation = new OutInAxisOperation();//Default if(axisService != null) { for (Iterator<?> i = axisService.getOperations(); i.hasNext();) { AxisOperation axisOp = (AxisOperation) i.next(); if(axisOp.getName().getLocalPart().equals(opName)) { axisOperation = axisOp; break; } } } return axisOperation; }
public void buildService(AxisConfiguration axisCfg) throws AxisFault { AxisService eventSourceService = new AxisService(); eventSourceService.setName(this.name); // Add wse operations addOperations(eventSourceService); axisCfg.addService(eventSourceService); //Set the service parameters eventSourceService .addParameter(EventingConstants.SUBSCRIPTION_MANAGER, subscriptionManager); eventSourceService.addParameter(SynapseEventingConstants.SERVICE_TYPE, SynapseEventingConstants.EVENTING_ST); }
/** * Set an Axis service as a SOAP over JMS service. * * @param axisService * @throws AxisFault */ private static void setTransportJmsToAxisService(final AxisService axisService, final SuConfigurationParameters extensions, final Logger logger) throws AxisFault { if (SUPropertiesHelper.isJmsTransportEnabled(extensions)) { axisService.addParameter(JMSConstants.PARAM_DESTINATION, axisService.getName()); axisService.addExposedTransport(Constants.TRANSPORT_JMS); logger.log(Level.INFO, "The Axis2 service '" + axisService.getName() + "' has been registered and is available through JMS."); } }
public void setServiceParameterElement(String serviceName, Parameter parameter) throws AxisFault { AxisService axisService = axisConfig.getService(serviceName); if (axisService == null) { throw new AxisFault("Invalid service name '" + serviceName + "'"); } Parameter p = axisService.getParameter(parameter.getName()); if (p != null) { if (!p.isLocked()) { axisService.addParameter(parameter); } } else { axisService.addParameter(parameter); } }
private void populateAxisService() { this._service = new org.apache.axis2.description.AxisService("NFeDistribuicaoDFe" + NFeDistribuicaoDFeSoapStub.getUniqueSuffix()); this.addAnonymousOperations(); // creating the operations org.apache.axis2.description.AxisOperation __operation; this._operations = new org.apache.axis2.description.AxisOperation[1]; __operation = new org.apache.axis2.description.OutInAxisOperation(); __operation.setName(new javax.xml.namespace.QName("http://www.portalfiscal.inf.br/nfe/wsdl/NFeDistribuicaoDFe", "nfeDistDFeInteresse")); this._service.addOperation(__operation); this._operations[0] = __operation; }
private String getRequestElementSuffix() { String requestElementSuffix = null; Parameter param = service.getParameter(Java2WSDLConstants.REQUEST_ELEMENT_SUFFIX_OPTION_LONG); if (param != null) { requestElementSuffix = (String) param.getValue(); } return requestElementSuffix; }
private void setMessageReceivers(Wire wire, AxisService axisService) throws Exception { Map<String, InvocationChain> interceptors = new HashMap<String, InvocationChain>(); for (InvocationChain chain : wire.getInvocationChains()) { interceptors.put(chain.getPhysicalOperation().getName(), chain); } Utils.fillAxisService(axisService, configurationContext.getAxisConfiguration(), null, null); for (Iterator<?> i = axisService.getOperations(); i.hasNext();) { AxisOperation axisOp = (AxisOperation) i.next(); InvocationChain invocationChain = interceptors.get(axisOp.getName().getLocalPart()); MessageReceiver messageReceiver = null; if (WSDL2Constants.MEP_URI_IN_ONLY.equals(axisOp.getMessageExchangePattern()) || WSDL2Constants.MEP_URI_ROBUST_IN_ONLY.equals(axisOp.getMessageExchangePattern())) { messageReceiver = new InOnlyServiceProxyHandler(invocationChain); } else {//Default MEP is IN-OUT for backward compatibility messageReceiver = new InOutServiceProxyHandler(invocationChain); } axisOp.setMessageReceiver(messageReceiver); } }
private void applyPolicies(Axis2WireSourceDefinition pwsd, AxisService axisService) throws WiringException, AxisFault { for (Iterator<?> i = axisService.getOperations(); i.hasNext();) { AxisOperation axisOperation = (AxisOperation) i.next(); String operation = axisOperation.getName().getLocalPart(); Set<AxisPolicy> policies = pwsd.getPolicies(operation); if (policies == null || policies.size() == 0) { continue; } AxisDescription axisDescription = axisOperation; for (AxisPolicy axisPolicy : policies) { String message = axisPolicy.getMessage(); String module = axisPolicy.getModule(); Element opaquePolicy = axisPolicy.getOpaquePolicy(); AxisModule axisModule = f3Configurator.getModule(module); axisOperation.addModule(axisModule.getName()); axisOperation.engageModule(axisModule); if (message != null) { axisDescription = axisOperation.getMessage(message); } policyApplier.applyPolicy(axisDescription, opaquePolicy); } } }
private void addToServiceURIMap(AxisService service) { Parameter param = service.getParameter(NhttpConstants.SERVICE_URI_LOCATION); if (param != null) { String uriLocation = param.getValue().toString(); if (uriLocation.startsWith("/")) { uriLocation = uriLocation.substring(1); } serviceNameToEPRMap.put(service.getName(), uriLocation); eprToServiceNameMap.put(uriLocation, service.getName()); } }
/** * Gets an element representing the operation names * * @param doc * @return Returns Element. */ protected Element getOpNames(Document doc) { Element root = doc.createElement("opnames"); Element elt; for (Iterator operationsIterator = axisService.getOperations(); operationsIterator.hasNext();) { AxisOperation axisOperation = (AxisOperation) operationsIterator.next(); elt = doc.createElement("name"); String localPart = axisOperation.getName().getLocalPart(); elt.appendChild(doc.createTextNode(JavaUtils.xmlNameToJava(localPart))); //what needs to be put here as the opertation namespace is actually the //traget namespace of the service addAttribute(doc, "opnsuri", axisService.getTargetNamespace(), elt); root.appendChild(elt); } return root; }
private void addToAxisService() { // Add a reference to this EndpointDescription object to the AxisService if (axisService != null) { Parameter parameter = new Parameter(); parameter.setName(EndpointDescription.AXIS_SERVICE_PARAMETER); parameter.setValue(this); try { axisService.addParameter(parameter); } catch (AxisFault e) { throw ExceptionFactory.makeWebServiceException(Messages.getMessage("endpointDescriptionErr5", EndpointDescription.AXIS_SERVICE_PARAMETER), e); } } }
private AxisOperation processOperationValidation(AxisService proxyService) throws AxisFault { AxisOperation mediateOperation = new InOutAxisOperation( SynapseConstants.SYNAPSE_OPERATION_NAME); // Set the names of the two messages so that Axis2 is able to produce a WSDL (see SYNAPSE-366): mediateOperation.getMessage(WSDLConstants.MESSAGE_LABEL_IN_VALUE).setName("in"); mediateOperation.getMessage(WSDLConstants.MESSAGE_LABEL_OUT_VALUE).setName("out"); // create a custom message receiver for this proxy service ProxyServiceMessageReceiver msgRcvr = new ProxyServiceMessageReceiver(); msgRcvr.setName(name); msgRcvr.setProxy(this); mediateOperation.setMessageReceiver(msgRcvr); mediateOperation.setParent(proxyService); proxyService.addParameter("_default_mediate_operation_", mediateOperation); return mediateOperation; }
@Override protected void setUp() throws Exception { service = new AxisService(); outputStream = new ByteArrayOutputStream(); schemas = new ArrayList<XmlSchema>(); loadSampleSchemaFile(schemas); service.addSchema(schemas); AxisConfiguration axisConfiguration = new AxisConfiguration(); service.setName("test_service"); axisConfiguration.addChild(service); axisConfiguration.addService(service); configurationContext = new ConfigurationContext(axisConfiguration); configurationContext.setServicePath("test_service"); configurationContext.setContextRoot("test/context"); messageContext.setConfigurationContext(configurationContext); }
/** * Get the name of the service to which messages received by this endpoint are pre-dispatched. * * @return the name of the service, or <code>null</code> if message are not pre-dispatched */ public final String getServiceName() { return service == null ? null : service.getName(); }
private AxisServiceGroup createServiceGroupForService(AxisService svc) throws AxisFault { AxisServiceGroup svcGroup = new AxisServiceGroup(); svcGroup.setServiceGroupName(svc.getName()); svcGroup.addService(svc); // Checking configured using files param is not a good solution. We must figure out a way to handle this // at Carbon persistence manager layer. if (svc.getParameter(CarbonConstants.PRESERVE_SERVICE_HISTORY_PARAM) != null && svc.getParameter(BusinessProcessConstants.CONFIGURED_USING_BPEL_PKG_CONFIG_FILES) == null) { svcGroup.addParameter(new Parameter(CarbonConstants.PRESERVE_SERVICE_HISTORY_PARAM, "true")); } return svcGroup; }
public int getServiceRequestCount(AxisService axisService) throws AxisFault { int count = 0; for (Iterator opIter = axisService.getOperations(); opIter.hasNext();) { AxisOperation axisOp = (AxisOperation) opIter.next(); Parameter parameter = axisOp.getParameter(StatisticsConstants.IN_OPERATION_COUNTER); if (parameter != null) { count += ((AtomicInteger) parameter.getValue()).get(); } } return count; }
public static void createAxisServiceProviders(AxisService axisService, RuntimeEndpoint endpoint, WebServiceBinding wsBinding, ExtensionPointRegistry extensionPoints) { for (Iterator<?> i = axisService.getOperations(); i.hasNext();) { AxisOperation axisOp = (AxisOperation)i.next(); Operation op = getOperation(axisOp, wsBinding); if (op != null) { if (op.isNonBlocking()) { axisOp.setMessageExchangePattern(WSDL2Constants.MEP_URI_IN_ONLY); } else { axisOp.setMessageExchangePattern(WSDL2Constants.MEP_URI_IN_OUT); } MessageReceiver msgrec = null; TuscanyServiceProvider serviceProvider = new TuscanyServiceProvider(extensionPoints, endpoint, wsBinding, op); if (op.isNonBlocking()) { msgrec = new Axis2ServiceInMessageReceiver(serviceProvider); } else { msgrec = new Axis2ServiceInOutSyncMessageReceiver(serviceProvider); } axisOp.setMessageReceiver(msgrec); } } }
private DataService getDataServiceByServicePath(String servicePath) throws Exception { Parameter tmpParam; DataService tmpDS; String canonicalServicePath = new File(servicePath).getCanonicalPath(); for (AxisService axisService : this.axisConfig.getServices().values()) { tmpParam = axisService.getParameter(DBConstants.DATA_SERVICE_OBJECT); if (tmpParam != null) { tmpDS = (DataService) tmpParam.getValue(); if (new File(tmpDS.getDsLocation()).getCanonicalPath().equals( canonicalServicePath)) { return tmpDS; } } } //throw new DataServiceFault("Data service at '" + servicePath + "' cannot be found"); return null; }