2017-05-04 11 views
0

石鹸消費者から、私は石鹸のenvなしで応答を得ていますが、私は石鹸のenvで応答が必要です。ミュール石けんコンシューマーフィルター封筒

マイコード:

<flow name="mws-api-intFlow"> 
     <http:listener config-ref="HTTP_Listener_Configuration" path="pocreate" doc:name="HTTP"/> 
     <dw:transform-message doc:name="Transform Message"> 
      <dw:set-payload><![CDATA[%dw 1.0 
       %output application/xml 
       --- 
       payload]]></dw:set-payload> 
     </dw:transform-message> 
     <ws:consumer config-ref="PO-Create" operation="MIOut_Sync_WSDL_WSPurchaseOrderPushRequestMessage" doc:name="Web_Service-POCreate"/> 
     <mulexml:dom-to-xml-transformer doc:name="DOM to XML"/>  
    </flow> 

それは次の応答を返します。有効にデバッグ中

<?xml version='1.0' encoding='windows-1252'?> 
    <ns1:PurchaseOrderExportReply xmlns:ns1="urn:Ariba:Buyer:vsap" partition="prealm_2068" variant="vrealm_2068"> 
     <ns1:Requisition_PurchImport_Item> 
      <ns1:item> 
       <ns1:LineItems> 
        <ns1:item> 
         <ns1:ERPPONumber>7133</ns1:ERPPONumber> 
         <ns1:NumberInCollection>1</ns1:NumberInCollection> 
         <ns1:PODeliveryDate>2014-04-27T00:00:00AribaBuyerTimeZone</ns1:PODeliveryDate> 
         <ns1:POQuantity>10.000</ns1:POQuantity> 
         <ns1:POUnitPrice>10.00</ns1:POUnitPrice> 
         <ns1:SAPPOLineNumber>00001</ns1:SAPPOLineNumber> 
        </ns1:item> 
       </ns1:LineItems> 
       <ns1:UniqueName>Test</ns1:UniqueName> 
      </ns1:item> 
     </ns1:Requisition_PurchImport_Item> 
    </ns1:PurchaseOrderExportReply> 

を、私は応答が石鹸ENVが付属していることを見つけたが、それはXML形式でのみ身体の一部が表示されます。

<SOAP:Envelope xmlns:SOAP="http://schemas.xmlsoap.org/soap/envelope/"> 
    <SOAP:Header /> 
    <SOAP:Body> 
     <ns1:Requisition_PurchImport_Item xmlns:ns1="urn:Ariba:Buyer:vsap" partition="prealm_2068" variant="vrealm_2068"> 
     <ns1:Requisition_PurchOrdNumberImport_Item> 
      <ns1:item> 
       <ns1:LineItems> 
        <ns1:item> 
        <ns1:ERPPONumber>7133</ns1:ERPPONumber> 
        <ns1:NumberInCollection>1</ns1:NumberInCollection> 
        <ns1:PODeliveryDate>2017-04-27T00:00:00AribaBuyerTimeZone</ns1:PODeliveryDate> 
        <ns1:POQuantity>10.000</ns1:POQuantity> 
        <ns1:POUnitPrice>10.00</ns1:POUnitPrice> 
        <ns1:SAPPOLineNumber>00001</ns1:SAPPOLineNumber> 
        </ns1:item> 
       </ns1:LineItems> 
       <ns1:UniqueName>PR39</ns1:UniqueName> 
      </ns1:item> 
     </ns1:Requisition_PurchOrdNumberImport_Item> 
     </ns1:Requisition_PurchImport_Item> 
    </SOAP:Body> 
</SOAP:Envelope> 

私はこの応答を取得したいと思いますが、どうすれば入手できますか?

答えて

1

Webコンシューマは、ボディのペイロードだけを受信すると、SOAPエンベロープの部分を単独で追加し、エンベロープなしで応答を生成します。
Webサービスコンシューマは、にのみ、というXML文書の本文/操作部分を受け入れるように設計されており、応答として本体/操作を生成します。

あなたは何を得ているのでしょうか。 PLSのドキュメントを参照してください: - :

- https://docs.mulesoft.com/mule-user-guide/v/3.7/web-service-consumer
あなたがここにあなたの例を、以下のようなレスポンス何かで後にSOAPエンベロープを追加するためのXSLTトランスやDataWeaveを使用する操作を行うことができますどのような封筒

とのあなたの完全な応答を作成するDataweaveが必要

<ws:consumer config-ref="PO-Create" operation="MIOut_Sync_WSDL_WSPurchaseOrderPushRequestMessage" doc:name="Web_Service-POCreate"/> 

    <dw:transform-message doc:name="XMLSoapRes" > 
      <dw:input-payload doc:sample="ListInventoryResponse.xml"/> 
      <dw:set-payload><![CDATA[%dw 1.0 
%output application/xml 
%namespace ns0 http://yournamespace/tshirt-service 
%namespace soap http://schemas.xmlsoap.org/soap/envelope/ 
--- 
soap#Envelope : { 

soap#Body:payload 

}]]></dw:set-payload> 
    </dw:transform-message>  
+0

これは、ハードコーディングsoap envとヘッダーのようなものですか?石鹸のヘッダーを受け取るのはどうですか? – bekur

+0

WebサービスコンシューマコンポーネントでSOAPエンベロープを期待することはできません..エンベロープとボディで完全なSOAPレスポンスが必要な場合は、HTTPリクエストコンポーネントを使用してSOAPリクエストを直接送信し、エンベロープでSOAPレスポンスを取得します。 DataweaveまたはXSLTでエンベロープを手動で追加する必要があります。あなたが言うようにハードコーディングされている可能性があります –

関連する問題