---
schema_version: "1"
id: 513e5b2cfb09cfbf0301c4f22fdb8b4353d0dc322c61c358a75825fd7c15f2d7
title: AS2 MDN の受信
collection: mulesoft
version: current
locale: ja-jp
portal_url: https://docs.salesforce.com/mulesoft/current/ja-jp/as2-connector/6.9/as2-connector-example-receiving-mdn-messages.md
canonical_url: https://docs.mulesoft.com/jp/as2-connector/6.9/as2-connector-example-receiving-mdn-messages
source_site: docs.mulesoft.com
content_type: documentation
content_hash: 6cb2bbce6cb19b80e09268bdcc9c43e5b2bf57dfd8667cf83c52625e07b0e2bb
description: MuleSoft Documentation Site
release: "6.9"
latest: true
---
# AS2 MDN の受信

次の例は、Anypoint Connector for AS2 (AS2 Connector) を使用して、取引パートナーから AS2 MDN (Message Disposition Notification) メッセージを受信し、受信したすべての応答でメッセージペイロードが含まれるメッセージを Studio コンソールに記録する方法を示しています。

この例は、​[「AS2 メッセージの受信」](https://docs.mulesoft.com/jp/as2-connector/6.9/as2-connector-example-receive-send#receiving-messages)​の例と似ていますが、次の点が異なります。

- **As 2 listener**​ ソースの代わりに ​**AS2 mdn listener**​ ソースを使用して、パスを ​`/receiveMDN`​ に設定する。
- **\[Logger\]**​ プロパティウィンドウで、​**\[Message (メッセージ)\]**​ 項目を「​`MDN Received: #[payload]`​」(受信した MDN: #\[payload\]) に設定します。

次のスクリーンショットは、この例の Anypoint Studio アプリケーションフローを示しています。

![MDN メッセージの受信例アプリケーションフロー](/mulesoft/current/ja-jp/as2-connector/6.9/_images/as2-connector-example-mdn-listener-flow.png)

この例をテストする方法:

1. このアプリケーションを実行します。
2. [「非同期 AS2 MDN の送信」](https://docs.mulesoft.com/jp/as2-connector/6.9/as2-connector-example-receive-send#asynchronous-mdns)​の例で設定したアプリケーションを実行します。
    
    このアプリケーションの Studio コンソールには、非同期で送信され、受信した AS2 MDN ごとにメッセージが表示されます。次に例を示します。
    
    ```console
    INFO  2022-09-09 17:15:46,409 [[MuleRuntime].uber.06: [as2-basic-example].ReceiveAsyncMDN.CPU_LITE @1369de96] [processor:
    ReceiveAsyncMDN/processors/0; event: 30609f70-307c-11ed-8f5a-38f9d3713331] org.mule.runtime.core.internal.processor.
    LoggerMessageProcessor: MDN Received!
    ```
3. [「同期 AS2 MDN の送信」](https://docs.mulesoft.com/jp/as2-connector/6.9/as2-connector-example-receive-send#synchronous-mdns)​の例で設定したアプリケーションを実行します。
    
    このアプリケーションの Studio コンソールには、同期で送信され、受信した AS2 MDN ごとにメッセージが表示されます。次に例を示します。
    
    ```console
    INFO  2022-09-09 17:15:46,409 [[MuleRuntime].uber.06: [as2-basic-example].ReceiveAsyncMDN.CPU_LITE @1369de96] [processor:
    ReceiveAsyncMDN/processors/0; event: 30609f70-307c-11ed-8f5a-38f9d3713331] org.mule.runtime.core.internal.processor.
    LoggerMessageProcessor: MDN Received!
    ```

<table><tbody><tr><td class="icon"><i class="fa icon-note" title="Note"></i></td><td class="content"><strong>[Receipt delivery url (受信確認配信 URL)]</strong>​ 項目が ​<strong>Send with Async MDN</strong>​ ソースで設定されておらず、HTTP 要求を使用している場合、​<strong>As 2 mdn listener</strong>​ エンドポイント (​<code>http://localhost:8082/receiveMDN</code>​) にヘッダー ​<code>Receipt-Delivery-Option</code>​ を含める必要があります。</td></tr></tbody></table>

## [](#as2-mdn-を受信する-xml-の例)AS2 MDN を受信する XML の例

この例のフローをすばやく Mule アプリケーションに読み込むには、次のコードを Studio XML エディターに貼り付けます。

```xml
<?xml version="1.0" encoding="UTF-8"?>
<mule xmlns:http="http://www.mulesoft.org/schema/mule/http"
	xmlns:as2-mule4="http://www.mulesoft.org/schema/mule/as2-mule4" xmlns="http://www.mulesoft.org/schema/mule/core"
	xmlns:doc="http://www.mulesoft.org/schema/mule/documentation"
	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/core http://www.mulesoft.org/schema/mule/core/current/mule.xsd
http://www.mulesoft.org/schema/mule/as2-mule4 http://www.mulesoft.org/schema/mule/as2-mule4/current/mule-as2-mule4.xsd">
	<http:listener-config name="HTTP_Listener_config" doc:name="HTTP Listener config" >
		<http:listener-connection host="localhost" port="8082" />
	</http:listener-config>
	<as2-mule4:mdn-listener-config name="AS2_Connector_Mdn_listener_config" doc:name="AS2 Connector Mdn listener config" httpListenerConfig="HTTP_Listener_config" >
		<as2-mule4:self-config as2Name="partnera" x509Alias="partnera" email="support@partnera.com" />
		<as2-mule4:partner-config as2Name="partnerb" x509Alias="partnerb" email="support@partnerb.com" />
		<as2-mule4:key-store-config keystorePassword="test" keystorePath="as2/partnera.p12" privateKeyPassword="test" />
	</as2-mule4:mdn-listener-config>
	<flow name="AS2MDNListener" >
		<as2-mule4:as2-mdn-listener doc:name="As 2 mdn listener"path="/receiveMDN" config-ref="AS2_Connector_Mdn_listener_config"/>
		<logger level="INFO" doc:name="Message Received!" message="MDN Received: #[payload]"/>
	</flow>
</mule>
```

## [](#関連情報)関連情報

- [AS2 Connector の例](https://docs.mulesoft.com/jp/as2-connector/6.9/as2-connector-examples)
- [Anypoint Connector の概要](https://docs.mulesoft.com/connectors/introduction/introduction-to-anypoint-connectors)
- [MuleSoft ヘルプセンター](https://help.mulesoft.com)