Xml Mule-SSL连接器中的协议

Xml Mule-SSL连接器中的协议,xml,ssl,mule,Xml,Ssl,Mule,我正在尝试使用cutom协议和Mule中可用的SSL连接器。我指的是这个骡子文件。但当我试图在连接器中添加协议时,它给出了以下错误 cvc-complex-type.2.4.a: Invalid content was found starting with element 'tcp:custom-protocol'. One of '{"http://www.mulesoft.org/schema/mule/ssl":protocol-handler}' is exp

我正在尝试使用cutom协议和Mule中可用的SSL连接器。我指的是这个骡子文件。但当我试图在连接器中添加协议时,它给出了以下错误

   cvc-complex-type.2.4.a: Invalid content was found starting with element 'tcp:custom-protocol'. One of '{"http://www.mulesoft.org/schema/mule/ssl":protocol-handler}' is expected.
这是我的连接器配置

   <ssl:connector name="SSL__TLS_" validateConnections="false"
   sendBufferSize="0" receiveBufferSize="0" receiveBacklog="0"
  clientSoTimeout="10000" serverSoTimeout="10000" socketSoLinger="0"
 doc:name="SSL (TLS)">
 <ssl:client path="C:\cert\client.cer" storePassword="password1" />
 <ssl:key-store path="C:\cert\keystore.jks" keyPassword="password1"
 storePassword="password1" />
 <ssl:server path="C:\cert\truststore.ts" storePassword="password1" />
 <tcp:custom-protocol rethrowExceptionOnRead="true"
 class="com.mycompany.protocols.CustomProtocol" />
</ssl:connector>
就我读到的协议处理程序而言,我发现它是包含协议类的包名


有人能帮我吗。

我认为问题在于连接器中元件的顺序,请尝试以下方法:

<?xml version="1.0" encoding="UTF-8"?>

<mule xmlns:tcp="http://www.mulesoft.org/schema/mule/tcp"
    xmlns:ssl="http://www.mulesoft.org/schema/mule/ssl" xmlns="http://www.mulesoft.org/schema/mule/core"
    xmlns:tls="http://www.mulesoft.org/schema/mule/tls" xmlns:doc="http://www.mulesoft.org/schema/mule/documentation"
    xmlns:spring="http://www.springframework.org/schema/beans" version="EE-3.5.0"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-current.xsd
http://www.mulesoft.org/schema/mule/core http://www.mulesoft.org/schema/mule/core/current/mule.xsd
http://www.mulesoft.org/schema/mule/ssl http://www.mulesoft.org/schema/mule/ssl/current/mule-ssl.xsd
http://www.mulesoft.org/schema/mule/tls http://www.mulesoft.org/schema/mule/tls/3.4/mule-tls.xsd
http://www.mulesoft.org/schema/mule/tcp http://www.mulesoft.org/schema/mule/tcp/current/mule-tcp.xsd">

    <ssl:connector name="SSL__TLS_" validateConnections="false"
        sendBufferSize="0" receiveBufferSize="0" receiveBacklog="0"
        clientSoTimeout="10000" serverSoTimeout="10000" socketSoLinger="0"
        doc:name="SSL (TLS)">
        <tcp:custom-protocol rethrowExceptionOnRead="true"
            class="com.mycompany.protocols.CustomProtocol" />
        <ssl:client path="C:\cert\client.cer" storePassword="password1" />
        <ssl:key-store path="C:\cert\keystore.jks" keyPassword="password1"
            storePassword="password1" />
        <ssl:server path="C:\cert\truststore.ts" storePassword="password1" />
        <ssl:protocol-handler property="com.mycompany.protocols" />
    </ssl:connector>

    <flow name="mule-sslFlow1" doc:name="mule-sslFlow1">
        <ssl:inbound-endpoint host="localhost" port="80"
            responseTimeout="10000" doc:name="SSL (TLS)" exchange-pattern="request-response" />
        <logger level="INFO" doc:name="Logger" />
    </flow>
</mule>


Hi Ale,我已经添加了名称空间和架构位置。请查找我的完整配置文件@。我仍然收到以下错误:-cvc复杂类型。2.4.a:发现以元素“tcp:custom protocol”开头的无效内容。需要一个“{”}”。请确认协议处理程序实际上是什么意思,它的位置是否与协议标记有关?@Vicky,我已经更新了我的答案,请尝试我粘贴的配置。是的,你是对的。这是订单的问题。有什么具体原因吗?
<?xml version="1.0" encoding="UTF-8"?>

<mule xmlns:tcp="http://www.mulesoft.org/schema/mule/tcp"
    xmlns:ssl="http://www.mulesoft.org/schema/mule/ssl" xmlns="http://www.mulesoft.org/schema/mule/core"
    xmlns:tls="http://www.mulesoft.org/schema/mule/tls" xmlns:doc="http://www.mulesoft.org/schema/mule/documentation"
    xmlns:spring="http://www.springframework.org/schema/beans" version="EE-3.5.0"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-current.xsd
http://www.mulesoft.org/schema/mule/core http://www.mulesoft.org/schema/mule/core/current/mule.xsd
http://www.mulesoft.org/schema/mule/ssl http://www.mulesoft.org/schema/mule/ssl/current/mule-ssl.xsd
http://www.mulesoft.org/schema/mule/tls http://www.mulesoft.org/schema/mule/tls/3.4/mule-tls.xsd
http://www.mulesoft.org/schema/mule/tcp http://www.mulesoft.org/schema/mule/tcp/current/mule-tcp.xsd">

    <ssl:connector name="SSL__TLS_" validateConnections="false"
        sendBufferSize="0" receiveBufferSize="0" receiveBacklog="0"
        clientSoTimeout="10000" serverSoTimeout="10000" socketSoLinger="0"
        doc:name="SSL (TLS)">
        <tcp:custom-protocol rethrowExceptionOnRead="true"
            class="com.mycompany.protocols.CustomProtocol" />
        <ssl:client path="C:\cert\client.cer" storePassword="password1" />
        <ssl:key-store path="C:\cert\keystore.jks" keyPassword="password1"
            storePassword="password1" />
        <ssl:server path="C:\cert\truststore.ts" storePassword="password1" />
        <ssl:protocol-handler property="com.mycompany.protocols" />
    </ssl:connector>

    <flow name="mule-sslFlow1" doc:name="mule-sslFlow1">
        <ssl:inbound-endpoint host="localhost" port="80"
            responseTimeout="10000" doc:name="SSL (TLS)" exchange-pattern="request-response" />
        <logger level="INFO" doc:name="Logger" />
    </flow>
</mule>