2016-02-11 38 views
3

一旦您在碳配置文件上将HideAdminServiceWSDLs设置为false,就可以发现EventReceiverAdminService服务端点。它公开了deployEventReceiverConfiguration方法。任何人都可以提供有关如何在多租户环境中使用此服务的示例吗?我尝试拨打该服务但每次收到以下回复:如何使用管理API创建WSO2 DAS事件接收器

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"> 
    <soapenv:Body> 
     <soapenv:Fault> 
     <faultcode>soapenv:Server</faultcode> 
     <faultstring>unknown</faultstring> 
     <detail/> 
     </soapenv:Fault> 
    </soapenv:Body> 
</soapenv:Envelope> 

并且在DAS日志中没有有用的消息。

回答

1

您需要提供事件接收器的XML配置。我用SOAP UI尝试了以下方法,它可以工作。

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:adm="http://admin.receiver.event.carbon.wso2.org"> 
    <soapenv:Header/> 
    <soapenv:Body> 
     <adm:deployEventReceiverConfiguration> 
     <!--Optional:--> 
     <adm:eventReceiverConfigXml><![CDATA[<eventReceiver xmlns="http://wso2.org/carbon/eventreceiver" name="httpReceiver" statistics="disable" trace="disable"> 
    <from eventAdapterType="http"> 
     <property name="transports">all</property> 
    </from> 
    <mapping customMapping="disable" type="json" /> 
    <to streamName="org.wso2.event.sensor.stream" version="1.0.0" /> 
</eventReceiver>]]> 

在多租户环境中,使用各个租户管理员的凭证基本身份验证。然后它会将事件接收器部署在正确的租户中。部署DAS时将打印日志如下,

[2016-02-11 17:40:39,670] [email protected] [1] [DAS] INFO {org.wso2.carbon.core.services.util.CarbonAuthenticationUtil} - '[email protected] [1]' logged in at [2016-02-11 17:40:39,670-0700] 
[2016-02-11 17:40:39,674] [email protected] [1] [DAS] INFO {org.wso2.carbon.event.receiver.core.internal.util.helper.EventReceiverConfigurationFileSystemInvoker} - Event receiver configuration saved to the filesystem :httpReceiver.xml 
[2016-02-11 17:40:39,675] [email protected] [1] [DAS] INFO {org.wso2.carbon.event.input.adapter.core.internal.InputAdapterRuntime} - Connecting receiver httpReceiver 
[2016-02-11 17:40:39,676] [email protected] [1] [DAS] INFO {org.wso2.carbon.event.stream.core.internal.EventJunction} - Producer added to the junction. Stream:BAM_MESSAGE_TRACE:1.0.0 
[2016-02-11 17:40:39,676] [email protected] [1] [DAS] INFO {org.wso2.carbon.event.receiver.core.EventReceiverDeployer} - Event Receiver configuration successfully deployed and in active state: httpReceiver 
+0

谢谢。它为我工作。 – yeiniel