有时收到:"执行标注操作时出错#34;在代理中使用callout mediator时

时间:2015-08-19 11:25:45

标签: web-services wso2 wso2esb

有时当我使用Callout mediator时,如果我之前在序列中进行了之前的调用/标注,我会收到此消息。 这是我收到的消息:ERROR_CODE = 0,ERROR_MESSAGE =执行callout操作时出错。 在代理中使用链接时尤其会发生这种情况。

<?xml version="1.0" encoding="UTF-8"?>
<proxy xmlns="http://ws.apache.org/ns/synapse"
       name="InsChildCustomer"
       transports="https,http"
       statistics="disable"
       trace="disable"
       startOnLoad="true">
   <target>
      <inSequence>
         <log level="full" separator=", ***********Incoming###########"/>
         <property name="originalMessage"
                   expression="$body"
                   scope="default"
                   type="OM"/>
         <property xmlns:cus="http://www.example.org/customerWSO2/"
                   name="SNIPPMessage"
                   expression="$body/cus:insertChildCustToNSRequest"
                   scope="default"
                   type="OM"/>
         <sequence key="conf:/resources/sequences/InsChildCustomerHeaderSeq.xml"/>

         <filter xmlns:cus="http://www.example.org/customerWSO2/"
                 source="boolean(//cus:insertChildCustToNSRequest/cus:childCustData/cus:customerContacts/cus:customerContact[1]/cus:email)"
                 regex="true">
            <then>
               <property name="customerContacts"
                         expression="//cus:insertChildCustToNSRequest/cus:childCustData/cus:customerContacts"
                         scope="default"
                         type="OM"/>
            </then>
            <else>
               <property name="noContacts" value="1" scope="default" type="INTEGER"/>
            </else>
         </filter>
         <header name="Action" scope="default" value="addList"/>

                  <payloadFactory media-type="xml">
                     <format>
                        <addressbook xmlns=""
                                     xmlns:platformCommon="urn:common_2015_1.platform.webservices.NS.com"
                                     xmlns:listRel="urn:relationships_2015_1.lists.webservices.NS.com"
                                     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
                                     xmlns:platformCore="urn:core_2015_1.platform.webservices.NS.com"
                                     xsi:type="listRel:CustomerAddressbook">
                           <defaultBilling>$1</defaultBilling>
                           <defaultShipping>$2</defaultShipping>
                           <addressbookAddress xsi:type="platformCommon:Address">
                              <addr1>$3</addr1>
                              <addr2>$4</addr2>
                              <addr3>$5</addr3>
                              <customFieldList>
                                 <customField scriptId="custrecord_addr_4"
                                              xsi:type="platformCore:StringCustomFieldRef">
                                    <value>$6</value>
                                 </customField>
                              </customFieldList>
                              <city>$7</city>
                              <state>$8</state>
                              <zip>$9</zip>
                              <country>$10</country>
                           </addressbookAddress>
                        </addressbook>
                     </format>
                     <args>
                        <arg evaluator="xml" expression="//cus:billingaddressindicator/text()"/>
                        <arg evaluator="xml" expression="//cus:shippingaddressindicator/text()"/>
                        <arg evaluator="xml" expression="//cus:addr1/text()"/>
                        <arg evaluator="xml" expression="//cus:addr2/text()"/>
                        <arg evaluator="xml" expression="//cus:addr3/text()"/>
                        <arg evaluator="xml" expression="//cus:custrecord_addr_4/text()"/>
                        <arg evaluator="xml" expression="//cus:city/text()"/>
                        <arg evaluator="xml" expression="//cus:state/text()"/>
                        <arg evaluator="xml" expression="//cus:zip/text()"/>
                        <arg evaluator="xml" expression="//cus:country/text()"/>
                     </args>
                  </payloadFactory>

                        <send>
                           <endpoint key="conf:/resources/endpoints/NSEndpoint.xml"/>
                        </send>


      </inSequence>
      <outSequence>
         <header xmlns:platformMsgs="urn:messages_2015_1.platform.webservices.NS.com"
                 name="platformMsgs:documentInfo"
                 scope="default"
                 action="remove"/>
         <property xmlns:platformMsgs="urn:messages_2015_1.platform.webservices.NS.com"
                   xmlns:platformCore="urn:core_2015_1.platform.webservices.NS.com"
                   name="isSuccess"
                   expression="//addListResponse/platformMsgs:writeResponseList/platformMsgs:writeResponse/platformCore:status/@isSuccess"
                   scope="default"
                   type="STRING"/>
         <filter xmlns:platformMsgs="urn:messages_2015_1.platform.webservices.NS.com"
                 xmlns:platformCore="urn:core_2015_1.platform.webservices.NS.com"
                 source="//addListResponse/platformMsgs:writeResponseList/platformMsgs:writeResponse/platformCore:status/@isSuccess"
                 regex="true">
            <then>
               <log level="full" separator=", *******before_iterator********"/>
               <property name="customerInternalId"
                         expression="//addListResponse/platformMsgs:writeResponseList/platformMsgs:writeResponse/platformMsgs:baseRef/@internalId"
                         scope="default"
                         type="STRING"/>
               <header name="platformMsgs:platformMsgs:documentInfo"
                       scope="default"
                       action="remove"/>
               <property name="type"
                         expression="//addListResponse/platformMsgs:writeResponseList/platformMsgs:writeResponse/platformMsgs:baseRef/@type"
                         scope="default"
                         type="STRING"/>
               <payloadFactory media-type="xml">
                  <format>
                     <urn:get xmlns:urn="urn:messages_2015_1.platform.webservices.NS.com"
                              xmlns:urn1="urn:core_2015_1.platform.webservices.NS.com"
                              xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
                        <urn:baseRef internalId="$1" type="customer" xsi:type="urn1:RecordRef">
                           <urn1:name/>
                        </urn:baseRef>
                     </urn:get>
                  </format>
                  <args>
                     <arg evaluator="xml" expression="get-property('customerInternalId')"/>
                  </args>
               </payloadFactory>
               <header name="Action" scope="default" value="get"/>
               <sequence key="conf:resources/sequences/customerAddPassport.xml"/>
               <sequence key="conf:resources/sequences/customerAddPreferences.xml"/>
               <callout endpointKey="conf:/resources/endpoints/NSEndpoint.xml">
                  <endpoint name="NSEndpoint">
                     <address uri="https://webservices.sandbox.NS.com/services/NSPort_2015_1"/>
                  </endpoint>
                  <source type="envelope"/>
                  <target xpath="$body/*"/>
               </callout>
               <property xmlns:ns="urn:messages_2015_1.platform.webservices.NS.com"
                         xmlns:listRel="urn:relationships_2015_1.lists.webservices.NS.com"
                         name="customerEntityId"
                         expression="//ns:getResponse/ns:readResponse/ns:record/listRel:entityId"
                         scope="default"
                         type="STRING"/>
               <log level="full" separator=", After_Get"/>
               <property name="OUT_ONLY" value="true" scope="default" type="STRING"/>
               <payloadFactory media-type="xml">
                  <format>
                     <cus:insertChildCustToNSRequest xmlns:cus="http://www.example.org/customerWSO2/">$1                                                                            
                  <cus:transactionid>$2</cus:transactionid>
                        <InternalID xmlns="">$3</InternalID>
                     </cus:insertChildCustToNSRequest>
                  </format>
                  <args>
                     <arg xmlns:cus="http://www.example.org/customerWSO2/"
                          evaluator="xml"
                          expression="$ctx:SNIPPMessage//cus:childCustData"/>
                     <arg xmlns:cus="http://www.example.org/customerWSO2/"
                          evaluator="xml"
                          expression="$ctx:SNIPPMessage//cus:transactionid"/>
                     <arg evaluator="xml" expression="get-property('customerInternalId')"/>
                  </args>
               </payloadFactory>
               <header xmlns:urn="urn:messages_2015_1.platform.webservices.NS.com"
                       name="urn:passport"
                       scope="default"
                       action="remove"/>
               <header xmlns:urn="urn:messages_2015_1.platform.webservices.NS.com"
                       name="urn:preferences"
                       scope="default"
                       action="remove"/>
               <log level="full" separator=", before SNIPP CALL"/>
               <call>
                  <endpoint key="conf:/resources/endpoints/Teacher.QEndpoint.xml"/>
               </call>
               <property name="OUT_ONLY" value="false" scope="default" type="STRING"/>
               <property name="DISABLE_CHUNKING"
                         value="false"
                         scope="axis2"
                         type="STRING"/>
               <property name="messageType" value="text/xml" scope="axis2" type="STRING"/>
               <property name="ContentType" value="text/xml" scope="axis2" type="STRING"/>
               <filter source="get-property('noContacts')" regex="1">
                  <then>
                     <log level="full" separator=", *******without_contacts********"/>
                     <enrich>
                        <source type="inline" clone="true">
                           <insertChildCustToNSResponse xmlns="">
                              <Type/>
                              <Status/>
                              <CustomerInternalId/>
                              <CustomerEntityId/>
                              <ContactInternalId>N.A.</ContactInternalId>
                           </insertChildCustToNSResponse>
                        </source>
                        <target type="body"/>
                     </enrich>
                     <enrich>
                        <source type="property" clone="true" property="type"/>
                        <target xpath="//insertChildCustToNSResponse/Type"/>
                     </enrich>
                     <enrich>
                        <source type="property" clone="true" property="isSuccess"/>
                        <target xpath="//insertChildCustToNSResponse/Status"/>
                     </enrich>
                     <enrich>
                        <source type="property" clone="true" property="customerInternalId"/>
                        <target xpath="//insertChildCustToNSResponse/CustomerInternalId"/>
                     </enrich>
                     <enrich>
                        <source type="property" clone="true" property="customerEntityId"/>
                        <target xpath="//insertChildCustToNSResponse/CustomerEntityId"/>
                     </enrich>
                  </then>
                  <else>
                     <log level="full" separator=", *******with_contacts********"/>
                     <drop/>
                  </else>
               </filter>
            </then>
            <else>
               <log level="full" separator=", From false###########"/>
               <property name="errorCode"
                         expression="//addListResponse/platformMsgs:writeResponseList/platformMsgs:writeResponse/platformCore:status/platformCore:statusDetail/platformCore:code"
                         scope="default"
                         type="STRING"/>
               <property name="errorMessage"
                         expression="//addListResponse/platformMsgs:writeResponseList/platformMsgs:writeResponse/platformCore:status/platformCore:statusDetail/platformCore:message"
                         scope="default"
                         type="STRING"/>
               <enrich>
                  <source type="inline" clone="true">
                     <insertChildCustToNSResponse xmlns="">
                        <Status/>
                        <ErrorCode/>
                        <ErrorMessage/>
                     </insertChildCustToNSResponse>
                  </source>
                  <target type="body"/>
               </enrich>
               <enrich>
                  <source type="property" clone="true" property="isSuccess"/>
                  <target xpath="//insertChildCustToNSResponse/Status"/>
               </enrich>
               <enrich>
                  <source type="property" clone="true" property="errorCode"/>
                  <target xpath="//insertChildCustToNSResponse/ErrorCode"/>
               </enrich>
               <enrich>
                  <source type="property" clone="true" property="errorMessage"/>
                  <target xpath="//insertChildCustToNSResponse/ErrorMessage"/>
               </enrich>
            </else>
         </filter>
         <send/>
      </outSequence>
   </target>
   <publishWSDL key="conf:/resources/wsdls/Customer.wsdl"/>
   <parameter name="serviceType">proxy</parameter>
   <description/>
</proxy>


<?xml version="1.0" encoding="UTF-8"?>
<proxy xmlns="http://ws.apache.org/ns/synapse"
       name="ChildCustomerToSnipp"
       transports="jms"
       statistics="disable"
       trace="disable"
       startOnLoad="true">
   <target>
      <inSequence>
         <property xmlns:ns="http://org.apache.synapse/xsd"
                   name="customerInternalId"
                   expression="//InternalID"/>
         <log level="full" separator="**Consumed from IN MQ before Seq**"/>
         <sequence key="ConvertCustomerSoapToJSONSeq"/>
      </inSequence>
      <outSequence>
         <log level="full" separator="**Consumed from OUT Seq**"/>
         <property xmlns:ns="http://org.apache.synapse/xsd"
                   name="snippMemberId"
                   expression="json-eval($.Data)"/>
         <log level="custom" separator="**From Out Seq before Update**">
            <property xmlns:ns="http://org.apache.synapse/xsd"
                      name="DataProperty"
                      expression="get-property('snippMemberId')"/>
            <property xmlns:ns="http://org.apache.synapse/xsd"
                      name="customerInternalId"
                      expression="get-property('customerInternalId')"/>
         </log>
         <sequence key="UpdateSnippMemeber"/>
      </outSequence>
   </target>
   <parameter name="transport.jms.ContentType">text/xml</parameter>
   <parameter name="transport.jms.Destination">Teacher.Q</parameter>
   <description/>
</proxy>

0 个答案:

没有答案