我正在尝试编写一个包含多个调用的代理服务,其中第一个服务的输出用于创建对第二个服务的请求,并且最终从第二个服务的输出将在甚至我进行第三个服务之前进行转换。现在我在第二步本身就遇到了问题。
这是我所拥有的代理配置,其中服务1的输出用于为第二次服务调用创建有效负载。
<proxy xmlns="http://ws.apache.org/ns/synapse"
name="CreateListingFromGetLocation" statistics="disable"
trace="disable" transports="http https">
<target>
<inSequence>
<property action="set" name="userName" scope="default"
type="STRING" value="Rama"/>
<property action="set" name="password" scope="default"
type="STRING" value="Ramapass"/>
<property action="set" name="clientIP" scope="default"
type="STRING" value="1.11.111.111"/>
<payloadFactory>
<format>
<soapenv:Envelope
xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:tem="http://tempuri.org/">
<soapenv:Header/>
<soapenv:Body>
<tem:Pool_GetNewSession>
<tem:Name>$1</tem:Name>
<tem:Password>$2</tem:Password>
<tem:ClientIP>$3</tem:ClientIP>
</tem:Pool_GetNewSession>
</soapenv:Body>
</soapenv:Envelope>
</format>
<args>
<arg expression="get-property('userName')"/>
<arg expression="get-property('password')"/>
<arg expression="get-property('clientIP')"/>
</args>
</payloadFactory>
<log category="INFO" level="custom" separator=",">
<property expression="//*" name="Triggering getSession API call.."/>
</log>
<callout action="urn:Pool_GetNewSession" serviceURL="http://localhost:8989/GetNewSession/">
<source type="envelope"/>
<target xmlns="http://tempuri.org/" xpath="//Pool_GetNewSessionResponse"/>
</callout>
<property action="set"
expression="//tem:Pool_GetNewSessionResult"
name="sessionId" scope="default" type="STRING" xmlns:tem="http://tempuri.org/"/>
<log category="INFO" level="custom" separator=",">
<property expression="get-property('sessionId')" name="SessionID"/>
</log>
<property action="set" name="siteId" scope="default"
type="STRING" value="51"/>
<property action="set" name="productId" scope="default"
type="STRING" value="8351"/>
<property action="set" name="perfDateList" scope="default"
type="STRING" value="12/13/2014 E"/>
<property action="set" name="marketingCode" scope="default"
type="STRING" value="Premium"/>
<property action="set" name="targetSystem" scope="default"
type="STRING" value="Govinda"/>
<payloadFactory>
<format>
<soapenv:Envelope
xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:tem="http://tempuri.org/">
<soapenv:Header/>
<soapenv:Body>
<tem:Pool_SendXMLRequest>
<tem:Name>$1</tem:Name>
<tem:SiteID>$2</tem:SiteID>
<tem:sXMLInput>
<request>
<displaydata>
<fetch_display_data>
<fn_name>eapi_fetch_mkt_locations_mkt</fn_name>
<param type="operator">$1</param>
<param type="string">$2</param>
<param type="string">$3</param>
<param type="string">$4</param>
<param type="string">$5</param>
</fetch_display_data>
</displaydata>
</request>
</tem:sXMLInput>
<tem:TargetSystem>$6</tem:TargetSystem>
<tem:Session>$7</tem:Session>
</tem:Pool_SendXMLRequest>
</soapenv:Body>
</soapenv:Envelope>
</format>
<args>
<arg expression="get-property('userName')"/>
<arg expression="get-property('siteId')"/>
<arg expression="get-property('productId')"/>
<arg expression="get-property('perfDateList')"/>
<arg expression="get-property('marketingCode')"/>
<arg expression="get-property('targetSystem')"/>
<arg expression="get-property('sessionId')"/>
</args>
</payloadFactory>
<log category="INFO" level="custom" separator=",">
<property expression="//*" name="Triggering getLocation API call.."/>
</log>
<callout action="urn:Pool_SendXMLRequest" serviceURL="http://localhost:8989/GetLocation/">
<source type="envelope"/>
<target xpath="//result"/>
</callout>
<log category="INFO" level="full" separator=","/>
</inSequence>
<outSequence>
<send/>
</outSequence>
<faultSequence/>
</target>
</proxy>
我观察到两件事,即使我进行第二次服务调用之前倾倒有效负载的日志调解器正在显示有效负载三次 - 不确定我是否遗漏了某些东西。以下是有效负载如何重复..
2014-04-18 09:32:27,961 [-] [PassThroughMessageProcessor-20] INFO CreateListingFromGetLocation Triggering getSession API call.. = <?xml version="1.0" encoding="utf-8"?><soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:tem="http://tempuri.org/"><soapenv:Body><tem:Pool_GetNewSession><tem:Name>Rama</tem:Name><tem:Password>Ramapass</tem:Password><tem:ClientIP>1.11.111.111</tem:ClientIP></tem:Pool_GetNewSession></soapenv:Body></soapenv:Envelope><soapenv:Header xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"></soapenv:Header><soapenv:Body xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"><tem:Pool_GetNewSession xmlns:tem="http://tempuri.org/"><tem:Name>Rama</tem:Name><tem:Password>Ramapass</tem:Password><tem:ClientIP>1.11.111.111</tem:ClientIP></tem:Pool_GetNewSession></soapenv:Body><tem:Pool_GetNewSession xmlns:tem="http://tempuri.org/"><tem:Name>Rama</tem:Name><tem:Password>Ramapass</tem:Password><tem:ClientIP>1.11.111.111</tem:ClientIP></tem:Pool_GetNewSession>RamaRamapass1.11.111.111
2014-04-18 09:32:27,972 [-] [PassThroughMessageProcessor-20] INFO CreateListingFromGetLocation SessionID = vf103lotgawlfltjjuldtamv|51
2014-04-18 09:32:27,980 [-] [PassThroughMessageProcessor-20] INFO CreateListingFromGetLocation Triggering getLocation API call.. = <?xml version="1.0" encoding="utf-8"?><soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:tem="http://tempuri.org/"><soapenv:Body><tem:Pool_SendXMLRequest><tem:Name>Rama</tem:Name><tem:SiteID>51</tem:SiteID><tem:sXMLInput><request xmlns="http://ws.apache.org/ns/synapse"><displaydata><fetch_display_data><fn_name>eapi_fetch_mkt_locations_mkt</fn_name><param type="operator">Rama</param><param type="string">51</param><param type="string">8351</param><param type="string">12/13/2014 E</param><param type="string">Premium</param></fetch_display_data></displaydata></request></tem:sXMLInput><tem:TargetSystem>Govinda</tem:TargetSystem><tem:Session>vf103lotgawlfltjjuldtamv|51</tem:Session></tem:Pool_SendXMLRequest></soapenv:Body></soapenv:Envelope><soapenv:Header xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"></soapenv:Header><soapenv:Body xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"><tem:Pool_SendXMLRequest xmlns:tem="http://tempuri.org/"><tem:Name>Rama</tem:Name><tem:SiteID>51</tem:SiteID><tem:sXMLInput><request xmlns="http://ws.apache.org/ns/synapse"><displaydata><fetch_display_data><fn_name>eapi_fetch_mkt_locations_mkt</fn_name><param type="operator">Rama</param><param type="string">51</param><param type="string">8351</param><param type="string">12/13/2014 E</param><param type="string">Premium</param></fetch_display_data></displaydata></request></tem:sXMLInput><tem:TargetSystem>Govinda</tem:TargetSystem><tem:Session>vf103lotgawlfltjjuldtamv|51</tem:Session></tem:Pool_SendXMLRequest></soapenv:Body><tem:Pool_SendXMLRequest xmlns:tem="http://tempuri.org/"><tem:Name>Rama</tem:Name><tem:SiteID>51</tem:SiteID><tem:sXMLInput><request xmlns="http://ws.apache.org/ns/synapse"><displaydata><fetch_display_data><fn_name>eapi_fetch_mkt_locations_mkt</fn_name><param type="operator">Rama</param><param type="string">51</param><param type="string">8351</param><param type="string">12/13/2014 E</param><param type="string">Premium</param></fetch_display_data></displaydata></request></tem:sXMLInput><tem:TargetSystem>Govinda</tem:TargetSystem><tem:Session>vf103lotgawlfltjjuldtamv|51</tem:Session></tem:Pool_SendXMLRequest>Rama51<tem:sXMLInput xmlns:tem="http://tempuri.org/"><request xmlns="http://ws.apache.org/ns/synapse"><displaydata><fetch_display_data><fn_name>eapi_fetch_mkt_locations_mkt</fn_name><param type="operator">Rama</param><param type="string">51</param><param type="string">8351</param><param type="string">12/13/2014 E</param><param type="string">Premium</param></fetch_display_data></displaydata></request></tem:sXMLInput><request xmlns="http://ws.apache.org/ns/synapse"><displaydata><fetch_display_data><fn_name>eapi_fetch_mkt_locations_mkt</fn_name><param type="operator">Rama</param><param type="string">51</param><param type="string">8351</param><param type="string">12/13/2014 E</param><param type="string">Premium</param></fetch_display_data></displaydata></request><displaydata xmlns="http://ws.apache.org/ns/synapse"><fetch_display_data><fn_name>eapi_fetch_mkt_locations_mkt</fn_name><param type="operator">Rama</param><param type="string">51</param><param type="string">8351</param><param type="string">12/13/2014 E</param><param type="string">Premium</param></fetch_display_data></displaydata><fetch_display_data xmlns="http://ws.apache.org/ns/synapse"><fn_name>eapi_fetch_mkt_locations_mkt</fn_name><param type="operator">Rama</param><param type="string">51</param><param type="string">8351</param><param type="string">12/13/2014 E</param><param type="string">Premium</param></fetch_display_data>eapi_fetch_mkt_locations_mktRama51835112/13/2014 EPremiumGovindavf103lotgawlfltjjuldtamv|51
当我构建第二个服务调用的请求有效负载时,我可能做错了。
有人可以帮忙吗?
答案 0 :(得分:0)
看起来像是一个日志记录问题,但数据正常。