WSO2 ESB не отправляет параметр ClinicId в WSO2 DSS

В сконфигурированном прокси-сервисе WSO2 параметр ClinicId не отправляется в DSS. В логах от DSS выдает исключение:

Default Namespace: https://bur.test.ru/dss/services/tfoms
Current Request Name: get_single_inserted_branch_by_id
Current Params: {clinicID=}
Nested Exception:-
java.lang.NumberFormatException: For input string: ""

В логах из ESB:


Nested Exception:-
javax.xml.stream.XMLStreamException: DS Fault Message: Error in 'SQLQuery.processPreNormalQuery': For input string: ""
DS Code: DATABASE_ERROR
Source Data Service:-
Name: TEST
Location: \TEST.dbs
Description: Service generates hospitalisation&
Default Namespace: https://bur.TEST.ru/dss/services/tfoms Current Request Name: get_single_inserted_branch_by_id Current Params: {clinicID=} Nested Exception:- java.lang.NumberFormatException: For input string: ""
На WSO2 DSS работает хорошо и берет информацию из postgres. Вот код прокси-сервиса от WSO2 ESB:

<?xml version="1.0" encoding="UTF-8"?>
<proxy xmlns="http://ws.apache.org/ns/synapse"
       name="BurProxy"
       transports="http,https"
       statistics="disable"
       trace="enable"
       startOnLoad="true">
   <target>
      <inSequence>
         <property name="CLINIC_ID"
                   expression="//clinicID/text()"
                   scope="axis2"
                   type="STRING"/>
         <log level="full">
            <property name="CLINIC_ID" expression="clinicID"/>
         </log>
         <payloadFactory media-type="xml">
            <format>
               <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
                                 xmlns:tfom="https://bur.cdmarf.ru/dss/services/tfoms">
                  <soapenv:Header/>
                  <soapenv:Body>
                     <tfom:get_single_inserted_branch_by_id>
                        <tfom:clinicID>$1</tfom:clinicID>
                     </tfom:get_single_inserted_branch_by_id>
                  </soapenv:Body>
               </soapenv:Envelope>
            </format>
            <args>
               <arg evaluator="xml" expression="$axis2:CLINIC_ID"/>
            </args>
         </payloadFactory>
         <log>
            <property name="PAYLOAD" expression="$body"/>
         </log>
         <call blocking="true">
            <endpoint key="dss"/>
         </call>
         <xslt key="xslt-remove-namespace"/>
         <property name="messageType" value="text/xml" scope="axis2"/>
         <property name="contentType" value="text/xml" scope="axis2"/>
         <property name="rabbitmq.attributes.app.id"
                   value="RMIS"
                   scope="axis2"
                   type="STRING"/>
         <property name="rabbitmq.attributes.type"
                   value="BRANCH"
                   scope="axis2"
                   type="STRING"/>
         <property name="rabbitmq.attributes.user.id"
                   value="rmis"
                   scope="axis2"
                   type="STRING"/>
         <property name="MESSAGE_ID" expression="get-property('MessageID')"/>
         <script language="js">var messageID = mc.getProperty('MESSAGE_ID').substring(9,45);
         	mc.setProperty("RABBIT_MESSAGE_ID", messageID);</script>
         <property name="rabbitmq.attributes.custom.message.id"
                   expression="get-property('RABBIT_MESSAGE_ID')"
                   scope="axis2"/>
         <clone continueParent="true">
            <target sequence="writeToFile"/>
         </clone>
         <send>
            <endpoint key="rabbit"/>
         </send>
         <payloadFactory media-type="xml">
            <format>
               <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
                                 xmlns:tfom="https://bur.cdmarf.ru/dss/services/tfoms">
                  <soapenv:Header/>
                  <soapenv:Body>
                     <tfom:get_inserted_divisions_of_clinic>
                        <tfom:clinicID>$1</tfom:clinicID>
                     </tfom:get_inserted_divisions_of_clinic>
                  </soapenv:Body>
               </soapenv:Envelope>
            </format>
            <args>
               <arg evaluator="xml" expression="$axis2:CLINIC_ID"/>
            </args>
         </payloadFactory>
         <call blocking="true">
            <endpoint key="dss"/>
         </call>
         <iterate xmlns:tfoms="https://bur.cdmarf.ru/dss/services/tfoms"
                  continueParent="true"
                  expression="//tfoms:DIVISION"
                  sequential="true">
            <target>
               <sequence>
                  <property name="rabbitmq.attributes.type"
                            value="DIVISION"
                            scope="axis2"
                            type="STRING"/>
                  <property name="messageType" value="xml" scope="axis2"/>
                  <property name="contentType" value="xml" scope="axis2"/>
                  <property name="MESSAGE_ID" expression="get-property('MessageID')"/>
                  <script language="js">var messageID = mc.getProperty('MESSAGE_ID').substring(9,45);
         	       mc.setProperty("RABBIT_MESSAGE_ID", messageID);</script>
                  <property name="rabbitmq.attributes.custom.message.id"
                            expression="get-property('RABBIT_MESSAGE_ID')"
                            scope="axis2"/>
                  <xslt key="xslt-remove-namespace"/>
                  <clone continueParent="true">
                     <target sequence="writeToFile"/>
                  </clone>
                  <send>
                     <endpoint key="rabbit"/>
                  </send>
               </sequence>
            </target>
         </iterate>
         <payloadFactory media-type="xml">
            <format>
               <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
                                 xmlns:tfom="https://bur.cdmarf.ru/dss/services/tfoms">
                  <soapenv:Body>
                     <tfom:get_inserted_liks_division_to_bed>
                        <tfom:clinicID>$1</tfom:clinicID>
                     </tfom:get_inserted_liks_division_to_bed>
                  </soapenv:Body>
               </soapenv:Envelope>
            </format>
            <args>
               <arg evaluator="xml" expression="$axis2:CLINIC_ID"/>
            </args>
         </payloadFactory>
         <call blocking="true">
            <endpoint key="dss"/>
         </call>
         <iterate xmlns:tfoms="https://bur.cdmarf.ru/dss/services/tfoms"
                  continueParent="true"
                  expression="//tfoms:DIVISION_LINK_STRUCTURE_BED"
                  sequential="true">
            <target>
               <sequence>
                  <property name="rabbitmq.attributes.type"
                            value="DIVISION_LINK_STRUCTURE_BED"
                            scope="axis2"
                            type="STRING"/>
                  <property name="messageType" value="xml" scope="axis2"/>
                  <property name="contentType" value="xml" scope="axis2"/>
                  <property name="MESSAGE_ID" expression="get-property('MessageID')"/>
                  <script language="js">var messageID = mc.getProperty('MESSAGE_ID').substring(9,45);
         	       mc.setProperty("RABBIT_MESSAGE_ID", messageID);</script>
                  <property name="rabbitmq.attributes.custom.message.id"
                            expression="get-property('RABBIT_MESSAGE_ID')"
                            scope="axis2"/>
                  <xslt key="xslt-remove-namespace"/>
                  <clone continueParent="true">
                     <target sequence="writeToFile"/>
                  </clone>
                  <send>
                     <endpoint key="rabbit"/>
                  </send>
               </sequence>
            </target>
         </iterate>
         <payloadFactory media-type="xml">
            <format>
               <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
                                 xmlns:tfom="https://bur.cdmarf.ru/dss/services/tfoms">
                  <soapenv:Body>
                     <tfom:get_inserted_amound_bed>
                        <tfom:clinicID>$1</tfom:clinicID>
                     </tfom:get_inserted_amound_bed>
                  </soapenv:Body>
               </soapenv:Envelope>
            </format>
            <args>
               <arg evaluator="xml" expression="$axis2:CLINIC_ID"/>
            </args>
         </payloadFactory>
         <call blocking="true">
            <endpoint key="dss"/>
         </call>
         <iterate xmlns:tfoms="https://bur.cdmarf.ru/dss/services/tfoms"
                  continueParent="true"
                  expression="//tfoms:AMOUNT_BED"
                  sequential="true">
            <target>
               <sequence>
                  <property name="rabbitmq.attributes.type"
                            value="AMOUNT_BED"
                            scope="axis2"
                            type="STRING"/>
                  <property name="messageType" value="xml" scope="axis2"/>
                  <property name="contentType" value="xml" scope="axis2"/>
                  <property name="MESSAGE_ID" expression="get-property('MessageID')"/>
                  <script language="js">var messageID = mc.getProperty('MESSAGE_ID').substring(9,45);
         	       mc.setProperty("RABBIT_MESSAGE_ID", messageID);</script>
                  <property name="rabbitmq.attributes.custom.message.id"
                            expression="get-property('RABBIT_MESSAGE_ID')"
                            scope="axis2"/>
                  <xslt key="xslt-remove-namespace"/>
                  <clone continueParent="true">
                     <target sequence="writeToFile"/>
                  </clone>
                  <send>
                     <endpoint key="rabbit"/>
                  </send>
               </sequence>
            </target>
         </iterate>
         <respond/>
      </inSequence>
   </target>
   <description/>
</proxy>
                                


person Mitchell Cameron    schedule 20.04.2016    source источник
comment
тип данных ClinicID? Вы отправляете пустую строку, а DSS ожидает числовое значение   -  person Jorge Infante Osorio    schedule 20.04.2016
comment
в postgres это целое число. мое мыло: ‹soap:Envelope xmlns:soap=w3.org/2003/05/ мыльный конверт xmlns:tfom=bur.test.ru/dss/services/tfoms› ‹soap:Header/› ‹soap:Body› ‹tfom:get_inserted_amound_bed› ‹tfom:clinicID›1‹/tfom:clinicID› ‹/tfom:get_inserted_amound_bed› ‹/soap:Body› ‹/soap:Envelope ›   -  person Mitchell Cameron    schedule 20.04.2016
comment
Видите ли вы в журнале ESB напечатанное значение ClinicID?   -  person Jorge Infante Osorio    schedule 20.04.2016
comment
Имя текущего запроса: get_single_inserted_branch_by_id Текущие параметры: {clinicID=} Вложенное исключение: - java.lang.NumberFormatException: Для входной строки:   -  person Mitchell Cameron    schedule 21.04.2016
comment
Первый журнал в последовательности должен печатать значение свойства CLINIC_ID, вы видите значение в консоли?   -  person Jorge Infante Osorio    schedule 21.04.2016
comment
Нет, я не вижу его в консоли   -  person Mitchell Cameron    schedule 25.04.2016
comment
хорошо, отправьте запрос.   -  person Jorge Infante Osorio    schedule 25.04.2016
comment
например: ‹soap:Envelope xmlns:soap=w3.org/2003/05/soap -конверт xmlns:tfom=bur.cdmarf.ru/dss/services/tfoms› ‹soap:Header/› ‹soap:Body› ‹tfom:get_inserted_amound_bed› ‹tfom:clinicID›6048820‹/tfom:clinicID› ‹/tfom:get_inserted_amound_bed› ‹/soap:Body› ‹/soap:Envelope›   -  person Mitchell Cameron    schedule 25.04.2016
comment
Вы можете проверить мой ответ?   -  person Jorge Infante Osorio    schedule 26.04.2016


Ответы (1)


Для такого запроса:

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
                  xmlns:tfom="bur.cdmarf.ru/dss/services/tfoms">
   <soapenv:Header/>
   <soapenv:Body>
     <tfom:get_inserted_amound_bed> 
        <tfom:clinicID>6048820</tfom:clinicID> 
     </tfom:get_inserted_amound_bed>    
   </soapenv:Body>
</soapenv:Envelope>

Вы можете использовать эти посредники для захвата и регистрации значения Clinic_id:

     <property name="CLINIC_ID" xmlns:tfom="bur.cdmarf.ru/dss/services/tfoms"
               expression="//tfom:get_inserted_amound_bed/tfom:clinicID"
               scope="default"
               type="STRING"/>
     <log level="custom">
        <property name="CLINIC_ID_PROPERTY_VALUE" expression="get-property('CLINIC_ID')"/>
     </log>
     <log>
        <property name="PAYLOAD" expression="$body"/>
     </log>

В посреднике фабрики полезной нагрузки используйте то же выражение для получения значения идентификатора клиники:

        <args>
           <arg evaluator="xml" expression="get-property('CLINIC_ID')"/>
        </args>
person Jorge Infante Osorio    schedule 25.04.2016
comment
спасибо, но проверить смогу только завтра. И я отвечу тебе - person Mitchell Cameron; 26.04.2016