How can i get the XML values in mule?

222 views Asked by At

In Mule I am using SOAP Component it is receiving the WSDL file in XML format. After that I want to get The XML data. but it show error. Here i am using

#[message.InboundProperties['Subject']]

It show the Null Value. This my XML Code

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:out="http://soap.sforce.com/2005/09/outbound" xmlns:urn="urn:sobject.enterprise.soap.sforce.com">
   <soapenv:Header/>
   <soapenv:Body>
      <out:notifications>
         <out:OrganizationId>00D9XXXXXXXXXXXx</out:OrganizationId>
         <out:ActionId>04k90xxxxxx</out:ActionId>
         <out:SessionId>XXXXXXXXXXXXXXX</out:SessionId>
         <out:EnterpriseUrl>https://ap1.salesforce.com/services/Soap/c/29.0/00D90000000q0Mc</out:EnterpriseUrl>
         <out:PartnerUrl>https://ap1.salesforce.com/services/Soap/u/29.0/00D90000000q0Mc</out:PartnerUrl>
         <!--1 to 100 repetitions:-->
         <out:Notification>
            **<out:Id>?</out:Id>
            <out:sObject>
               <!--Zero or more repetitions:-->
               <urn:fieldsToNull>?</urn:fieldsToNull>
                <!--Optional:-->
               <urn:Subject>Test</urn:Subject>
            </out:sObject>**
         </out:Notification>
      </out:notifications>
   </soapenv:Body>
</soapenv:Envelope>

SOAP Working properly. <urn:Subject>Test</urn:Subject> the Subject value from this XML file

2

There are 2 answers

3
Philip Parker On

Can you clarify your question:

Are you getting an error trying to run your program or when you call from SOAP client? Can you paste your Mule code. If you want to have the XML as your payload after the SOAP message processor(MP) you will need to set the operation to 'proxy service' inside the SOAP MP.

0
Anirban Sen Chowdhary On

Since the XML is a SOAP, to extract a node value you need to use XPATH http://blogs.mulesoft.com/mule-3-6-xml-xpath-xslt-xquery3/
and Mule namespace maneger https://developer.mulesoft.com/docs/display/current/XML+Namespaces