如何更改WSDL并在代理服务中添加输入变量?

时间:2019-04-08 16:21:12

标签: wso2 wso2ei

我在WSO EI 6.4.0中创建了代理服务,该服务发送电子邮件。在流程中,我使用以下属性:AttachmentFile,transport.mail.bodyWhenAttached,senderAddress和Subject。如何使用输入参数sender_address,subject,mail_text,attachment_file创建自定义wsdl。还是可以使用其他解决方案? 我想通过API调用此代理服务器并发送参数。

<inSequence xmlns="http://ws.apache.org/ns/synapse">
    <property name="transport.mail.Format" scope="axis2" type="STRING" value="Attachment"/>
    <property name="AttachmentFile" scope="axis2" type="STRING" value="attachment.csv"/>
    <property name="ContentType" scope="axis2" type="STRING" value="text/html"/>
    <property name="messageType" scope="axis2" type="STRING" value="text/html"/>
    <property expression="Some body text" name="transport.mail.bodyWhenAttached"
        scope="axis2" type="STRING"/>
    <property name="senderAddress" scope="default" type="STRING" value="test@test.com"/>
    <property name="Subject" scope="transport" type="STRING" value="WSO Email Test"/>
    <property name="OUT_ONLY" scope="default" type="STRING" value="true"/>
    <property name="FORCE_SC_ACCEPTED" scope="axis2" type="STRING" value="true"/>
    <log level="full"/>
    <header
        expression="fn:concat('mailto:', get-property('senderAddress'))"
        name="To" scope="default"/>
    <call>
        <endpoint>
            <default/>
        </endpoint>
    </call>
</inSequence>

1 个答案:

答案 0 :(得分:0)

在位置

下以名称sendEmailProxy.xml保存以下文件
  

// repository / deployment / server / synapse-configs / default / proxy-services

    <?xml version="1.0" encoding="UTF-8"?>
        <proxy xmlns="http://ws.apache.org/ns/synapse"
               name="sendEmailProxy"
               startOnLoad="true"
               statistics="disable"
               trace="disable"
               transports="http,https">
           <target>
              <inSequence>
                 <property name="transport.mail.Format"
                           scope="axis2"
                           type="STRING"
                           value="Attachment"/>
                 <property name="AttachmentFile"
                           scope="axis2"
                           type="STRING"
                           value="attachment.csv"/>
                 <property name="ContentType"
                           scope="axis2"
                           type="STRING"
                           value="text/html"/>
                 <property name="messageType"
                           scope="axis2"
                           type="STRING"
                           value="text/html"/>
                 <property name="senderAddress"
                           scope="default"
                           type="STRING"
                           value="test@test.com"/>
                 <property name="Subject"
                           scope="transport"
                           type="STRING"
                           value="WSO Email Test"/>
                 <property name="OUT_ONLY" scope="default" type="STRING" value="true"/>
                 <property name="FORCE_SC_ACCEPTED"
                           scope="axis2"
                           type="STRING"
                           value="true"/>
                 <log level="full"/>
                 <header expression="fn:concat('mailto:', get-property('senderAddress'))"
                         name="To"
                         scope="default"/>
                 <call>
                    <endpoint>
                       <default/>
                    </endpoint>
                 </call>
                 <respond/>
              </inSequence>
           </target>
<parameter name="useOriginalwsdl">true</parameter>
           <description/>
        </proxy>

保存后,请启动wso2 EI / ESB实例,登录到该实例,然后单击services下面屏幕左侧的服务,您将找到代理,您将有两个选择{{ 1}}单击您喜欢的那个,这将为您提供wsdl文件作为代理

如果您已经有一个自定义的wsdl,并且希望wso2接听该wsdl,那么您需要添加以下参数

  

wsdl1.1 wsdl2.0

这将接受您的自定义wsdl,而wso2不会生成它自己的wsdl

相关问题