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

问题描述 投票:-2回答:1

我在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="[email protected]"/>
    <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>
wso2 wso2ei
1个回答
0
投票

在该位置下保存名称为sendEmailProxy.xml的以下文件

//库/部署/服务器/突触CONFIGS /默认/代理服务

    <?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="[email protected]"/>
                 <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下方屏幕左侧的服务,你会找到代理,你将有两个选项wsdl1.1 wsdl2.0点击你喜欢的,这个将为您的代理提供wsdl文件

如果您已经拥有自定义wsdl并希望wso2获取该wsdl,那么您需要添加以下参数

<parameter name="useOriginalwsdl">true</parameter>

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

© www.soinside.com 2019 - 2024. All rights reserved.