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
EmanuelaEmanuela 

MetadataBindigStub not found in metadata.wsdl

hi everyone,
I have a problem!
I need to create a custom object with metadata api (ver 12.0) and, searching for examples, i've found the one below :

MetadataBindingStub stub = (MetadataBindingStub) new MetadataServiceLocator().getMetadata();
stub.setTimeout(60000);

// Login using Partner WSDL
// Getting the Session ID from Partner WSDL


SessionHeader sh = new SessionHeader();
sh.setSessionId(loginResult.getSessionId());

stub.setHeader(new MetadataServiceLocator().getServiceName()
.getNamespaceURI(), "SessionHeader", sh);


CustomObject co = new CustomObject();
String name = "MyNewObj";
co.setFullName(name + "__c");
co.setDeploymentStatus(DeploymentStatus.Deployed);
co.setDescription("Created by the Metadata API");
co.setEnableActivities(true);
co.setLabel(name + " Object");
co.setPluralLabel(co.getLabel() + "s");
co.setSharingModel(SharingModel.ReadWrite);
CustomField nf = new CustomField();
nf.setType(FieldType.Text);
nf.setLabel(co.getFullName() + " Name");
co.setNameField(nf);
AsyncResult[] ars = stub.create(new Metadata[] { co} )

The problem is that I've not 'MetadataSoapBindingStub' into library generated by 'metadata wsdl', and I've not a 'MetadataServiceLocator'.
I have a 'MetadataServiceStub' but it doesn't work in the same way.
Can anyone help me? Could you tell me when I can find the 'MetadataBindingStub'?
EmanuelaEmanuela
please...anyone could help me?
I need to find the 'MetadataBindingStub' as soon as possible!
SuperfellSuperfell
What soap stack are you using ? MetadatbindingStub is generated by Axis 1.x, other soap tools might call it something else.
EmanuelaEmanuela
Simon! You are an angel!
Axis 2.0 doesn't generate the MetadataBindingStub.
Axis 1.4 work better ;)
Thank you so much!

cheers,
Emanuela