바로 지금, 청구 시스템을 호출하는 ProcessPayment라는 서비스가 있습니다. 여기서 볼 수 있듯이 지불 서비스에서 다른 결제 서비스로 전화를 걸고 싶습니다. PaymentService의 응답에는 3 개의 데이터 요소가 있습니다. BillingService에는 그 중 하나가 필요합니다.Mule의 CXF 웹 서비스 프록시 구성 문제
Mule에서 둘 이상의 서비스에 대한 플로우를 어떻게 구성합니까? 나는 다양한 순열을 시도했지만 작동하지 않습니다!
뮬-config.xml에
<?xml version="1.0" encoding="UTF-8"?>
<mule xmlns="http://www.mulesoft.org/schema/mule/core" xmlns:cxf="http://www.mulesoft.org/schema/mule/cxf"
xmlns:doc="http://www.mulesoft.org/schema/mule/documentation"
xmlns:spring="http://www.springframework.org/schema/beans" xmlns:core="http://www.mulesoft.org/schema/mule/core"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:http="http://www.mulesoft.org/schema/mule/http"
xmlns:ognl="http://www.mulesoft.org/schema/mule/ognl" xmlns:servlet="http://www.mulesoft.org/schema/mule/servlet"
xmlns:vm="http://www.mulesoft.org/schema/mule/vm" xmlns:pattern="http://www.mulesoft.org/schema/mule/pattern"
xsi:schemaLocation="
http://www.mulesoft.org/schema/mule/core http://www.mulesoft.org/schema/mule/core/3.1/mule.xsd
http://www.mulesoft.org/schema/mule/pattern http://www.mulesoft.org/schema/mule/pattern/3.1/mule-pattern.xsd
http://www.mulesoft.org/schema/mule/cxf http://www.mulesoft.org/schema/mule/cxf/current/mule-cxf.xsd
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
http://www.mulesoft.org/schema/mule/http http://www.mulesoft.org/schema/mule/http/current/mule-http.xsd
http://www.mulesoft.org/schema/mule/ognl http://www.mulesoft.org/schema/mule/ognl/current/mule-ognl.xsd
http://www.mulesoft.org/schema/mule/vm http://www.mulesoft.org/schema/mule/vm/current/mule-vm.xsd">
<!-- <flow name="parallelservices"> <all enableCorrelation="ALWAYS"> <cxf:proxy-service
wsdlLocation="classpath:billingservice.wsdl" bindingId="BillingServiceServiceSoapBinding"
port="BillingServicePort" service="BillingServiceService" payload="body"
namespace="http://com.myapp.demo/" /> </all> </flow> -->
<flow name="initpayment">
<inbound-endpoint address="http://localhost:8585/services/processpayment">
<cxf:proxy-service wsdlLocation="classpath:processpaymentservice.wsdl"
bindingId="ProcessPaymentServiceServiceSoapBinding" service="ProcessPaymentServiceService"
payload="body" namespace="http://com.myapp.demo/" />
</inbound-endpoint>
<outbound-endpoint address="http://localhost:8081/BillingEntry/services/BillingServicePort">
<!-- <flow-ref name="parallelservices" /> -->
<cxf:proxy-client/>
</outbound-endpoint>
</flow>
</mule>
프로세스 지불 WSDL
<?xml version="1.0" encoding="UTF-8"?>
<wsdl:definitions name="ProcessPaymentServiceService" targetNamespace="http://processpayment.icp.sf/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:tns="http://com.myapp.demo/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/">
<wsdl:types>
<schema xmlns="http://www.w3.org/2001/XMLSchema">
<import namespace="http://processpayment.icp.sf/" schemaLocation="processpaymentservice_schema1.xsd"/>
</schema>
</wsdl:types>
<wsdl:message name="processPayment">
<wsdl:part name="parameters" element="tns:processPayment">
</wsdl:part>
</wsdl:message>
<wsdl:message name="processPaymentResponse">
<wsdl:part name="parameters" element="tns:processPaymentResponse">
</wsdl:part>
</wsdl:message>
<wsdl:portType name="IProcessPayment">
<wsdl:operation name="processPayment">
<wsdl:input name="processPayment" message="tns:processPayment">
</wsdl:input>
<wsdl:output name="processPaymentResponse" message="tns:processPaymentResponse">
</wsdl:output>
</wsdl:operation>
</wsdl:portType>
<wsdl:binding name="ProcessPaymentServiceServiceSoapBinding" type="tns:IProcessPayment">
<soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
<wsdl:operation name="processPayment">
<soap:operation soapAction="" style="document"/>
<wsdl:input name="processPayment">
<soap:body use="literal"/>
</wsdl:input>
<wsdl:output name="processPaymentResponse">
<soap:body use="literal"/>
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
<wsdl:service name="ProcessPaymentServiceService">
<wsdl:port name="ProcessPaymentServicePort" binding="tns:ProcessPaymentServiceServiceSoapBinding">
<soap:address location="http://localhost:8081/ProcessPayment/services/ProcessPaymentServicePort"/>
</wsdl:port>
</wsdl:service>
</wsdl:definitions>
결제 서비스 WSDL
<?xml version="1.0" encoding="UTF-8"?>
<wsdl:definitions name="BillingServiceService" targetNamespace="http://com.myapp.demo2/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:tns="http://billing.icp.sf/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/">
<wsdl:types>
<schema xmlns="http://www.w3.org/2001/XMLSchema">
<import namespace="http://billing.icp.sf/" schemaLocation="billingservice_schema1.xsd"/>
</schema>
</wsdl:types>
<wsdl:message name="billingEntryResponse">
<wsdl:part name="parameters" element="tns:billingEntryResponse">
</wsdl:part>
</wsdl:message>
<wsdl:message name="billingEntry">
<wsdl:part name="parameters" element="tns:billingEntry">
</wsdl:part>
</wsdl:message>
<wsdl:portType name="IBillingService">
<wsdl:operation name="billingEntry">
<wsdl:input name="billingEntry" message="tns:billingEntry">
</wsdl:input>
<wsdl:output name="billingEntryResponse" message="tns:billingEntryResponse">
</wsdl:output>
</wsdl:operation>
</wsdl:portType>
<wsdl:binding name="BillingServiceServiceSoapBinding" type="tns:IBillingService">
<soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
<wsdl:operation name="billingEntry">
<soap:operation soapAction="" style="document"/>
<wsdl:input name="billingEntry">
<soap:body use="literal"/>
</wsdl:input>
<wsdl:output name="billingEntryResponse">
<soap:body use="literal"/>
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
<wsdl:service name="BillingServiceService">
<wsdl:port name="BillingServicePort" binding="tns:BillingServiceServiceSoapBinding">
<soap:address location="http://localhost:8081/BillingEntry/services/BillingServicePort"/>
</wsdl:port>
</wsdl:service>
</wsdl:definitions>
즉시 문제
Mule 구성 인바운드 URL을 누를 때 ProcessPayment 서비스 용 wsdl을 생성 할 수 있습니다. 그러나이 URL을 사용하여
<import schemaLocation="".../>
및
<wsdl:port><soap:address>*****</soap:address></wsdl:port>
에 대한 수정 된 값을 보여주고, 나는 SOAPui에 서비스를 테스트 할 수 없습니다입니다. 그러나 Mule 수신 주소가 아닌 원래 서비스 주소를 조회하면 실제 서비스를받을 수 있습니다. 그것은 SOAP UI에서도 실행됩니다.
빠른 질문 :
어떻게 흐름을 실행할 수 있습니까? 브라우저 또는 SOAPui에서 인바운드 URL을 호출하기 만하면 올바르게 작동하지 않습니까?
프록시가 작동하는 경우 soapUI (브라우저가 아님)를 사용하여 프록시를 호출 할 수 있어야합니다. –
나는 아직도 당신이하려는 것을 얻지 못한다. 이것은 인바운드 및 아웃 바운드 서비스가 다르기 때문에 분명히 프록시의 유스 케이스처럼 들리지 않습니다. 따라서 Mule에서 ProcessPaymentService를 호스팅하고이 서비스의 결과를 BillingService의 일부 방법으로 보내시겠습니까? 그러나 ProcessPaymentService를 호출 한 사람의 결과는 어떻게됩니까? ProcessPaymentService의 서비스 클래스가 BillingService를 호출해야합니까? –
그래서 인바운드 및 아웃 바운드 끝점이 같은 경우에만 프록시를 사용합니까? 실제로, 나는 하나의 서비스를 가지고 있으며, 그로부터 흐름은 세 가지 서비스로 갈 것입니다. 지금 당장은 하나의 서비스가 다른 서비스를 순차적으로 호출 할 수 없습니다. 그래서이 시나리오를 먼저 시도해 보았습니다. – r3st0r3