function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion

Metadata API with sessonId of enterprise wsdl login result

Hello, guys. Does anyone succeed in hitting metadata api like create method?
Now I'm trying it but an error saying "INVALID_SESSIN_ID" occurs.

I'm doing like below with java client, but it does not work.
Calls login() which is part of the enterprise WSDL and, if the login succeeds:
  • Sets the returned sessionId into the session header for the metadata SOAP binding. This is required for session authentication on subsequent metadata API calls.
  • Resets the endpoint to the returned metadataServerUrl, which is the target of subsequent metadata API calls.

    All client applications that access the metadata API must complete the tasks in this step before attempting any subsequent metadata API calls.


does someone have any hint..? my soap message is the followings.


<v:Envelope xmlns:i=""
        <v:SessionHeader n0:mustUnderstand="0"
            n1:ns1="" xmlns:n0="soapenv"
            <v:sessionId n2:type="xsd:string" xmlns:n2="xsi">
           xxxxx(session id)
        <t:create id="o0" c:root="1">
            <metadata n3:type="t:metadata"
                <fullName n3:type="d:string">
                <label n3:type="d:string">ByMetaDataAPI</label>
                <length n3:type="d:int">100</length>
                <type n3:type="d:string">Text</type>

thank you very much,

Your SessionHeader element is in the wrong namespace, you have it bound to the V prefix, which is the soap namespace.
I've got it. Scceeded in loging in by changing header namespace. Thank you very much,