2017-03-03 5 views
0

MuleSoftで作成したエンドポイントの1つで受信しているリクエストを解析しようとしています。MuleSoft CXFリクエストの解析

これはSalesforceからのSOAPリクエストです。XMLを取得して値を取得することはできませんでした。 SOAPリクエストメッセージは以下の通りです。

SAMPLEのSOAPリクエスト:

<?xml version="1.0" encoding="UTF-8"?> 
<soapenv:Envelope 
    xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" 
    xmlns:xsd="http://www.w3.org/2001/XMLSchema" 
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> 
    <soapenv:Body> 
     <notifications 
      xmlns="http://soap.sforce.com/2005/09/outbound"> 
      <OrganizationId>00123jhk1h230AQ</OrganizationId> 
      <ActionId>04215wergf2345AA0</ActionId> 
      <SessionId>00Dn00000008w1T!AQ0AQLiuZg345345EGC8LAY00OqInU_Exn4.FVinnwwc2j.Naerwt2323g0R4qi9ykmHt.eertert212342dh</SessionId> 
      <EnterpriseUrl>https://12fwghoft.cs50.my.salesforce.com/services/Soap/c/39.0/00Dn00000008w1T</EnterpriseUrl> 
      <PartnerUrl>https://12fwghoft.cs50.my.salesforce.com/services/Soap/u/39.0/00Dn00000008w1T</PartnerUrl> 
      <Notification> 
       <Id>04l45611902IG</Id> 
       <sObject xsi:type="sf:Account" 
        xmlns:sf="urn:sobject.enterprise.soap.sforce.com"> 
        <sf:Id>00q2sv2224ggwAV</sf:Id> 
       </sObject> 
      </Notification> 
     </notifications> 
    </soapenv:Body> 
</soapenv:Envelope> 

MULEインバウンド・メッセージの詳細:

org.mule.DefaultMuleMessage 
{ 
    id=114f2110-0058-11e7-9989-5ce0c55142df 
    payload=[Ljava.lang.Object; 
    correlationId=<not set> 
    correlationGroup=-1 
    correlationSeq=-1 
    encoding=UTF-8 
    exceptionPayload=<not set> 

Message properties: 
    INVOCATION scoped properties: 
    _ApikitResponseTransformer_AcceptedHeaders=*/* 
    _ApikitResponseTransformer_apikitRouterRequest=yes 
    _ApikitResponseTransformer_contractMimeTypes=[] 
    cxf_operation={http://soap.sforce.com/2005/09/outbound}notifications 
    cxf_service={http://soap.sforce.com/2005/09/outbound}NotificationPortService 
    method=public abstract boolean sfdc.account.NotificationPort.notifications(java.lang.String,java.lang.String,java.lang.String,java.lang.String,java.lang.String,java.util.List) 
    INBOUND scoped properties: 
    accept-encoding=gzip 
    cache-control=max-age=259200 
    content-length=1028 
    content-type=text/xml; charset=utf-8 
    host=36ce69be.ngrok.io 
    http.listener.path=/api/* 
    http.method=POST 
    http.query.params=ParameterMap{[]} 
    http.query.string= 
    http.relative.path=/api/netsuite/customers 
    http.remote.address=/127.0.0.1:59266 
    http.request.path=/api/netsuite/customers 
    http.request.uri=/api/netsuite/customers 
    http.scheme=http 
    http.uri.params=ParameterMap{[]} 
    http.version=HTTP/1.1 
    soapaction="" 
    user-agent=Jakarta Commons-HttpClient/3.1 
    x-forwarded-for=136.147.62.8 
    OUTBOUND scoped properties: 
    MULE_ENCODING=UTF-8 
    SESSION scoped properties: 
} 
+0

を意味していますか? ? –

+0

CXFは、封筒から自動的に石鹸本体を抽出します。 '<通知> ...' その後、dataweaveまたはxpathを使用して値を抽出します。 – Abhay

答えて

0

あなたは、XSLTトランス工程を有する単純なXSLコードの下に使用してSOAPメッセージボディ部XMLを抽出することができます。

<xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" 
    xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" 
    xmlns:outbound="http://soap.sforce.com/2005/09/outbound"> 
     <xsl:template match="/"> 
     <xsl:copy-of select="/soapenv:Envelope/soapenv:Body/outbound:notifications"/> 
     </xsl:template> 
    </xsl:stylesheet> 
0

あなたは、exペイロード としてSOAPメッセージの本文を抽出するために、プロキシ・サービスの操作でCXFコンポーネントを使用することができます:あなたはあなたのサンプルリクエストからのノードの値を抽出したい

<cxf:proxy-service port="tmddOCSoapHttpServicePort" namespace="http://www.tmdd.org/3/dialogs" service="TmddOwnerCenterService" payload="body" wsdlLocation="classpath:/TMDD.wsdl" enableMuleSoapHeaders="false" metadata:id="533a80dc-8f06-42c6-9646-a461196dfd72" doc:name="TmddOwnerCenterService"> 
    </cxf:proxy-service> 
関連する問題