You need to sign in to do that
Don't have an account?
Abhijit Shrikhande 10
it fails with the error.
[MetadataAPI] Calling service from SoapUI
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.
This solution is for future readers.
you need to add <xmlns="http://soap.sforce.com/2006/04/metadata"> inside your createmetadata tag.
after that add <xsi:type = "CustomObject"> inside your metadata tag.Give your type as i have given CustomObject.
If got any further errors then do post.
Try Above code if anyone still facing issues while creating metadata through SoapUI.For me it worked 100%.