从代理服务或序列或休息API WSO2开发者工作室3.6.0在构建之后从$ ctx,$ trp,$ body等XPATH变量中删除$。请告诉我如何解决这个问题或解决这个问题。
示例序列
<sequence xmlns="http://ws.apache.org/ns/synapse" name="XMFSequence">
<property xmlns:ns="http://org.apache.synapse/xsd" xmlns:np1="http://ws.apache.org/commons/ns/payload" xmlns:np="http://schemas.xmlsoap.org/soap/envelope/" xmlns:np2="http://services.www.up.com/xmf/2.0" name="serviceName" expression="//np:Envelope/np:Header/np2:request-header/np2:service-name" scope="default" type="STRING"/>
<property xmlns:ns="http://org.apache.synapse/xsd" xmlns:fn="http://www.w3.org/2005/xpath-functions" name="localEntryName" expression="fn:replace($ctx:serviceName,'/','-')" scope="default" type="STRING"/>
<property xmlns:ns="http://org.apache.synapse/xsd" name="contractEnforcedVal" expression="get-property(get-property('localEntryName'))" scope="default" type="STRING"/>
<filter xmlns:ns="http://org.apache.synapse/xsd" xpath="fn:contains(get-property('contractEnforcedVal'),$trp:XMFRequestor)">
<then>
<filter xpath="fn:contains(get-property('contractEnforcedVal'),'isSecured=true')">
<then>
<class name="com.uprr.app.poc.esb.mediator.RequestHandler">
<property name="secValServiceURL" value="http://localhost:9080/SecurityService/secure-util"/>
</class>
<filter xpath="fn:contains(get-property('isAuthorized'),'true')">
<then>
<send>
<endpoint key-expression="get-property('serviceName')"/>
</send>
</then>
<else>
<drop/>
</else>
</filter>
</then>
<else>
<send>
<endpoint key-expression="get-property('serviceName')"/>
</send>
</else>
</filter>
</then>
<else>
<drop/>
</else>
</filter>
答案 0 :(得分:0)
请检查CAPP的pom文件中的maven-car-plugin版本。它应该是2.0.8,如下所示
<groupId>org.wso2.maven</groupId>
<artifactId>maven-car-plugin</artifactId>
<version>2.0.8</version>
还要确保ESB项目的pom文件包含版本2.0.8作为序列插件版本
<groupId>org.wso2.maven</groupId>
<artifactId>wso2-esb-sequence-plugin</artifactId>
<version>2.0.8</version>