• Nitish Sharma 7
  • NEWBIE
  • 5 Points
  • Member since 2016
  • Developer
  • Cybage

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
    Questions
  • 2
    Replies

I am trying to make a call from the SoapUI tool to create a Remote Site Setting on a salesforce instance. I downloaded the Metadata WSDL and set it up in the tool by importing it.

If I make a call to describeMetaData it works as expected.

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:met="http://soap.sforce.com/2006/04/metadata">
   <soapenv:Header>
      <met:CallOptions>
         <met:client>SoapUI</met:client>
      </met:CallOptions>
      <met:SessionHeader>
         <met:sessionId>SessionToken</met:sessionId>
      </met:SessionHeader>
   </soapenv:Header>
   <soapenv:Body>
      <met:describeMetadata>
         <met:asOfVersion>36.0</met:asOfVersion>
      </met:describeMetadata>
   </soapenv:Body>
</soapenv:Envelope>
If I attempt to make a call to create a remote setting using the following request,
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:met="http://soap.sforce.com/2006/04/metadata">
	<soapenv:Header>
		<met:AllOrNoneHeader>
			<met:allOrNone>false</met:allOrNone>
		</met:AllOrNoneHeader>
		<met:CallOptions>
			<met:client>SoapUI</met:client>
		</met:CallOptions>
		<met:SessionHeader>
			<met:sessionId>SESSIONTOKEN</met:sessionId>
		</met:SessionHeader>
	</soapenv:Header>
	<soapenv:Body>
		<met:createMetadata>
			<!--Zero or more repetitions:-->
			<met:metadata>
				<RemoteSiteSetting xmlns="http://soap.sforce.com/2006/04/metadata">
					<description>Used for Apex callout to mapping web service</description>
					<disableProtocolSecurity>false</disableProtocolSecurity>
					<isActive>true</isActive>
					<url>https://www.maptestsite.net/mapping1</url>
					<met:fullName>TestSutieMap</met:fullName>
				</RemoteSiteSetting>
			</met:metadata>
		</met:createMetadata>
	</soapenv:Body>
</soapenv:Envelope>


it fails with the error.
 
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
   <soapenv:Body>
      <soapenv:Fault>
         <faultcode>soapenv:Client</faultcode>
         <faultstring>Must specify a {http://www.w3.org/2001/XMLSchema-instance}type attribute value for the {http://soap.sforce.com/2006/04/metadata}metadata element</faultstring>
      </soapenv:Fault>
   </soapenv:Body>
</soapenv:Envelope>
I have tried to force xsi:type="RemoteSiteSetting" on the <met:metadata> tag, but that has not worked either.