2013-05-17 2 views
1

나는이 흐름 여기뮬 - 변수는

<flow name="SOAPWebService" > 

    <http:inbound-endpoint address="http://localhost:8088/" exchange-pattern="request-response">   
    </http:inbound-endpoint> 

    <set-variable value="#[message.inboundProperties['id']]" variableName="paramId"></set-variable> 
    <set-variable value="#[message.inboundProperties['type']]" variableName="paramType"></set-variable> 

    <component class="com.example.components.SampleComponent" ></component> 

    <mule-xml:xslt-transformer 
     maxIdleTransformers="2" maxActiveTransformers="5" 
     xsl-file="C:\WorkSpace\MyProject\src\main\resources\xslt\PrepareRequestXML.xsl"> 
     <mule-xml:context-property key="paramId" 
      value="#[flowVars['paramId']]" /> 
     <mule-xml:context-property key="paramType" 
      value="#[flowVars['paramType']]" /> 
    </mule-xml:xslt-transformer> 

    <cxf:proxy-client payload="body" 
     enableMuleSoapHeaders="true">   
    </cxf:proxy-client> 
    <http:outbound-endpoint exchange-pattern="request-response" 
     address="http://localhost:8080/ClientsDB/douane" doc:name="HTTP"> 
    </http:outbound-endpoint> 

    <byte-array-to-string-transformer doc:name="Byte Array to String" />  
    <file:outbound-endpoint ....... .. /> 
</flow> 

를 사용

http://localhost:8088/?id=xxx&type=yyyy 

같은 GET의 HTTP 요청에서 일부 변수를 검색하기 위해 노력하고있어는 XSLT 스타일 시트

<xsl:stylesheet version="2.0" 
    xmlns:xsl="http://www.w3.org/1999/XSL/Transform" 
    xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" 
    xmlns:wsd="http://wsdouane/"> 
    <xsl:output method="xml" indent="yes" /> 
    <xsl:param name="paramType"></xsl:param> 
    <xsl:param name="paramId"></xsl:param> 

    <xsl:template match="*" > 
     <xsl:element name="wsd:find" namespace="http://wsdouane/"> 
     <xsl:element name="entity"> 
     <xsl:element name="id"> 
      <xsl:value-of select="$paramId"/> 
     </xsl:element> 
     <xsl:element name="type"> 
      <xsl:value-of select="$paramType"/> 
     </xsl:element> 
     </xsl:element>   
     </xsl:element> 
    </xsl:template> 

    <xsl:template match="text()|processing-instruction()|comment()"> 
     <xsl:copy> 
      <xsl:apply-templates select="@*|node()" /> 
     </xsl:copy> 
    </xsl:template> 
</xsl:stylesheet>  
입니다 찾을 수 없습니다

하지만 흐름을 실행할 때 다음 오류가 발생합니다.

INFO 2013-05-17 10:10:10,839 [[mediation_mod].connector.http.mule.default.receiver.04] org.mule.transformer.simple.AddFlowVariableTransformer: Variable with key "paramId", not found on message using "#[message.inboundProperties['id']]". Since the value was marked optional, nothing was set on the message for this variable 
INFO 2013-05-17 10:10:10,841 [[mediation_mod].connector.http.mule.default.receiver.04] org.mule.transformer.simple.AddFlowVariableTransformer: Variable with key "paramType", not found on message using "#[message.inboundProperties['type']]". Since the value was marked optional, nothing was set on the message for this variable 
INFO 2013-05-17 10:10:10,895 [[mediation_mod].connector.http.mule.default.receiver.04] org.mule.transport.service.DefaultTransportServiceDescriptor: Loading default outbound transformer: org.mule.transport.http.transformers.ObjectToHttpClientMethodRequest 
INFO 2013-05-17 10:10:10,895 [[mediation_mod].connector.http.mule.default.receiver.04] org.mule.transport.service.DefaultTransportServiceDescriptor: Loading default response transformer: org.mule.transport.http.transformers.MuleMessageToHttpResponse 
INFO 2013-05-17 10:10:10,895 [[mediation_mod].connector.http.mule.default.receiver.04] org.mule.transport.service.DefaultTransportServiceDescriptor: Loading default outbound transformer: org.mule.transport.http.transformers.ObjectToHttpClientMethodRequest 
INFO 2013-05-17 10:10:10,895 [[mediation_mod].connector.http.mule.default.receiver.04] org.mule.lifecycle.AbstractLifecycleManager: Initialising: 'connector.http.mule.default.dispatcher.28622115'. Object is: HttpClientMessageDispatcher 
INFO 2013-05-17 10:10:10,896 [[mediation_mod].connector.http.mule.default.receiver.04] org.mule.lifecycle.AbstractLifecycleManager: Starting: 'connector.http.mule.default.dispatcher.28622115'. Object is: HttpClientMessageDispatcher 
INFO 2013-05-17 10:10:10,921 [[mediation_mod].connector.http.mule.default.receiver.04] org.mule.lifecycle.AbstractLifecycleManager: Initialising: 'connector.file.mule.default.dispatcher.27894808'. Object is: FileMessageDispatcher 
INFO 2013-05-17 10:10:10,921 [[mediation_mod].connector.http.mule.default.receiver.04] org.mule.lifecycle.AbstractLifecycleManager: Starting: 'connector.file.mule.default.dispatcher.27894808'. Object is: FileMessageDispatcher 
INFO 2013-05-17 10:10:10,923 [[mediation_mod].connector.http.mule.default.receiver.04] org.mule.transport.file.FileConnector: Writing file to: C:\MuleStudio\SandBox\output\17-05-13_1368778210922.xml 

http를 통해 전달 된 값 대신 null을 제공합니다.

어떤 아이디어 ??

답변

1

다음 http 인바운드를 사용하십시오.

<http:inbound-endpoint address="http://localhost:8088" exchange-pattern="request-response">   
</http:inbound-endpoint> 

http://localhost:8088/?id=xxx&type=yyyy 
+0

문제의 요청으로 작동합니다는 HTTP와 같은 요청 주소를 사용하여 해결 : // localhost를 : 8088/ESB /과 단지에 http : // localhost를 : 8088/ 요청은 http : // localhost : 8088/esb /? id = xxx & type = yyyy가됩니다. –