public static void registerParticipant()

in src/org/apache/kandula/participant/ParticipantUtility.java [42:93]


	public static void registerParticipant(
			ParticipantContext participantContext,
			MessageContext messageContext) throws AxisFault {
		try {
			ConfigurationContext axis2ConfigurationContext = KandulaConfiguration
					.getInstance().getPariticipantAxis2ConfigurationContext();
			if (axis2ConfigurationContext == null) {
				axis2ConfigurationContext = messageContext
						.getConfigurationContext();
			}
			EndpointReference participantProtocolService = EndpointReferenceFactory
					.getInstance().getParticipantEndpoint(
							participantContext.getID(),participantContext.getRegistrationProtocol());

			RegistrationServiceStub registrationCoordinator = new RegistrationServiceStub(
					axis2ConfigurationContext, null);
			registrationCoordinator._getServiceClient().setTargetEPR(
					participantContext.getCoordinationContext()
							.getRegistrationService());

			Register register = new Register();
			RegisterType registerType = new RegisterType();
			registerType.setProtocolIdentifier(new URI(participantContext
					.getRegistrationProtocol()));
			EndpointReferenceType endpointReferenceType = new EndpointReferenceType();
			AttributedURI attributedURI = new AttributedURI();
			attributedURI.setAnyURI(new URI(participantProtocolService
					.getAddress()));
			endpointReferenceType.setAddress(attributedURI);
			// setting reference parameters
			ReferenceParametersType referenceParametersType = new ReferenceParametersType();
			Map map = participantProtocolService.getAllReferenceParameters();
			OMElement element = (OMElement) map
					.get(Constants.REQUESTER_ID_PARAMETER);
			referenceParametersType.addExtraElement(element);
			endpointReferenceType
					.setReferenceParameters(referenceParametersType);
			registerType.setParticipantProtocolService(endpointReferenceType);
			register.setRegister(registerType);
			// Actual WS call for registeration
			RegisterResponse registerResponse = registrationCoordinator
					.RegisterOperation(register);
			participantContext.setCoordinationEPR(EndpointReferenceFactory
					.getEPR(registerResponse.getRegisterResponse()
							.getCoordinatorProtocolService()));

		} catch (IOException e) {
			throw AxisFault.makeFault(e);
		} catch (AbstractKandulaException e) {
			throw AxisFault.makeFault(e);
		}
	}