2013-07-02 2 views
1

Mule을 처음 사용하고 mule을 사용하여 SOAP 웹 서비스를 노출하려고합니다. 부드러운 노새 http://www.mulesoft.org/documentation/display/current/XML-only+SOAP+Web+Service+Example에서 다음 예제를 사용했습니다. DataMapper 구성 요소가 한 요청에서 다른 요청으로 데이터를 매핑하려고하면 웹 서비스가 노출 될 수 있지만 오류가 발생합니다. 첨부 파일에는 필수 구성이 들어 있습니다. Mule Studio의 미리보기 탭을 사용하여 매퍼에서 test xml을 실행하면 다음과 같이 반환됩니다 : 그리고 Your XML is not valid. 오류 : 파일의 조기 종료.Mule의 DataMapper가 필수 출력을 반환하지 않습니다.

좋습니다.

<?xml version="1.0" encoding="UTF-8"?> 

<mule xmlns:data-mapper="http://www.mulesoft.org/schema/mule/ee/data-mapper" xmlns:mulexml="http://www.mulesoft.org/schema/mule/xml" xmlns:http="http://www.mulesoft.org/schema/mule/http" xmlns:cxf="http://www.mulesoft.org/schema/mule/cxf" xmlns="http://www.mulesoft.org/schema/mule/core" xmlns:doc="http://www.mulesoft.org/schema/mule/documentation" xmlns:spring="http://www.springframework.org/schema/beans" version="EE-3.3.2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation=" 
http://www.mulesoft.org/schema/mule/http http://www.mulesoft.org/schema/mule/http/current/mule-http.xsd 
http://www.mulesoft.org/schema/mule/cxf http://www.mulesoft.org/schema/mule/cxf/current/mule-cxf.xsd 
http://www.mulesoft.org/schema/mule/ee/data-mapper http://www.mulesoft.org/schema/mule/ee/data-mapper/current/mule-data-mapper.xsd 
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-current.xsd 
http://www.mulesoft.org/schema/mule/core http://www.mulesoft.org/schema/mule/core/current/mule.xsd 
http://www.mulesoft.org/schema/mule/xml http://www.mulesoft.org/schema/mule/xml/current/mule-xml.xsd "> 
    <data-mapper:config name="admitToUpsert" transformationGraphPath="admittoupsert.grf" doc:name="DataMapper"/> 
    <flow name="admitPatientService" doc:name="admitPatientService"> 
     <http:inbound-endpoint exchange-pattern="request-response" host="localhost" port="8080" doc:name="AdmissionService"/> 
     <cxf:proxy-service port="AdmissionPort" namespace="http://www.mule-health.com/SOA/service/admission/1.0" service="AdmissionService" payload="body" doc:name="Proxy Service" wsdlLocation="service/AdmissionService.wsdl"/> 
     <logger message="First request: #[message.payload]" level="INFO" doc:name="Logger"/> 
     <mulexml:dom-to-xml-transformer doc:name="Object to XML" returnClass="java.lang.String"/> 
     <logger message="Before hiting transfomer: #[message.payload]" level="INFO" doc:name="Logger"/> 
     <data-mapper:transform config-ref="admitToUpsert" doc:name="DataMapper"/> 
     <byte-array-to-string-transformer returnClass="java.lang.String" mimeType="text/plain" doc:name="Byte Array to String"/> 
     <logger message="Upsert Request is: #[message]" level="INFO" doc:name="Logger"/> 
    </flow> 
</mule> 

시험 XML되는 다음 :

다음

구성이다

<ns0:admitSubject xmlns:ns0="http://www.mule-health.com/SOA/service/admission/1.0" xmlns:ns1="http://www.mule-health.com/SOA/model/1.0"> 
    <ns1:Referer> 
     <ns1:clientId>7899</ns1:clientId> 
    </ns1:Referer> 
    <ns1:Referral> 
     <ns1:procedure> 
      <ns1:code>In-patient</ns1:code> 
      <ns1:admission>Elective</ns1:admission> 
      <ns1:department>CARDIOLOGY</ns1:department> 
     </ns1:procedure> 
    </ns1:Referral> 
    <ns1:Subject> 
     <ns1:nationalId>4657</ns1:nationalId> 
     <ns1:firstName>Charles</ns1:firstName> 
     <ns1:lastName>Brown</ns1:lastName> 
     <ns1:address1>Any Street</ns1:address1> 
     <ns1:address2>?</ns1:address2> 
     <ns1:address3>?</ns1:address3> 
     <ns1:nationality>American</ns1:nationality> 
     <ns1:gender>Male</ns1:gender> 
     <ns1:dateOfBirth>1987-01-19</ns1:dateOfBirth> 
    </ns1:Subject> 
    </ns0:admitSubject> 

WSDL 및 XSD는 https://github.com/mulesoft/Pre-sales-hospital-admission/tree/master/src/main/resources/service로부터 당겨질 수있다. 페이지에 많은 데이터가 발생 했으므로 여기에 붙여 넣지 않은 것에 대해 사과드립니다. 요청시 추가 할 수 있습니다.

답변

0

해결할 수 있습니다. XML을 붙여 넣는 동안 일부 특수 문자가 들끓는 것 같습니다. Mule 스튜디오에서 XSD로부터 XML을 생성했을 때 제대로 작동했습니다.