Hot answers tagged

14

As in other programming languages, you can generate Apex code starting from the WSDL using the "Generate from WSDL" button present at the top of the Apex Classes list in the Setup UI. The process is described e.g. in SOAP Services: Defining a Class from a WSDL Document. However, there are a number of limitations in that tooling, including that it only ...


11

The Salesforce wsdl2apex tool does not support a number of WSDL features. See Supported WSDL Features That section does say: Apex also supports the following schema constructs: xsd:attribute, in Apex code saved using API version 15.0 and later However, I've found in practice you usually get the Unsupported Schema element found error message ...


10

Probably the easiest way to understand what methods are defined in a WSDL and what their respective parameters are is to start with a tool like SoapUI. You can import the WSDL and it will generate sample requests that correspond to the available methods. That will give you a good starting point. In terms of the raw WSDL, try starting with the operation ...


9

In addition to sfdcfox pointing out that you generally login to a sandbox at https://test.salesforce.com, there is another option. Since you are using my domain you can login through its URL: Production URL: https://mydomain.my.salesforce.com Sandbox URL: https://mydomain--sandboxName.[Instance].my.salesforce.com. Note that the instance can change when the ...


8

Updating the database using SOAP API You can only send 200 records at once to the DML operations create update upsert delete This is in the documentation under Reference > Core Calls for each of the DML calls. eg from the entry for upsert: Arguments: ExternalIDFieldName string Contains the name of the field on this object with the external ID ...


7

You need to hard code the path but not the server, most languages these days have URI classes that make putting the require URL together pretty easy, e.g. // build a URL object for the regular server URL URL serverUrl = new URL(loginResult.getServerUrl()); // build a new URL thats relative to serverUrl, as the path start with / this'll replace the whole ...


7

First off, you should create an integration only user if you haven't already done so. This allows you to control security (or open up access) for the middleware integration. Typically I set the integration user's profile settings so that its password never expires, but it is not absolutely necessary. Second, you have two different WSDL's you can choose ...


7

UPDATE: There is now a known issue for this that you can track "Generate WSDL" generates a WSDL that does not contain the definition of the compound types address and location if API version is 30.0 or above I've seen this before , but can't find the previous occurrence at the moment in Issue with Adding reference Webservice WSDL to VS2010. There is a ...


7

Yes, the Enterprise WSDL respects field and object-level security. This means that the user performing the export will determine which elements appear in the WSDL. You should perform the export as the user that has the correct permissions.


7

Looks like it could be a bug in .NET's XML serializer: https://help.salesforce.com/HTViewSolution?id=000205824&language=en_US


6

Unfortunately the Enterprise WSDL does not aggregate Apex Web Services defined in the org, only custom objects. I've also confirmed this by writing a short Apex Web Service, downloaded the Enterprise WSDL and searched it for my class and it is not present. Force.com Enterprise WSDL—This API is for most enterprise users who are developing client ...


6

The Enterprise and Partner APIs are intended for usage outside of Salesforce rather than integrating two Salesforce Orgs together. They are typically consumed by languages like Java, .NET, PHP, Ruby, ... As you found, anyType is not supported by Wsdl2Apex. See Supported WSDL Features: The Salesforce datatype anyType is not supported in WSDLs used to ...


6

This is expected behavior .The login() has to be from either partner WSDL or the Enterprise WSDL .The Apex class that the would have created with webservice keywords will generate another WSDL that will hold exact calls you will need to do once you obtain Server URL and Session Id from the login call. Here is a simple blog post showing how to use Enterprise ...


6

It's hard to tell what data you're even working with, but the standard object name is simply Pricebook2 (no underscores). If you are trying to insert a record looking up to this object (such as PricebookEntry), the name of the lookup field is Pricebook2Id.


5

The relevant limits for building something that is boing to bulk read data over the soap api would be Total API requests, there is a limit to the # of API calls you make in a 24 hour period, make sure you're fetching as much data as you can handle in one go (e.g. set the batchsize header of QueryOptions to 2000, which is the maximum). One API request == One ...


5

While I'd be happy (and surprised!) to see an implementation using the webservice framework, I think it's impossible. The documentation keeps silence about adjusting namespaces or field names, and both are handled internally. There is some hope though. Salesforce outbound messages are simple enough to successfully accept them with Apex REST. You could ...


5

The Id at the end is the PackageVersion identifier, this is primarily used in the Partner API wsdl and can be configured on the API wsdl download page (setup->Develop->API) before you generate the wsdl. Even if you have no use for this feature a default Id is generated for backward compatibility. However the docs probably describe this feature better: See ...


5

The FuseIT Wsdl2Apex tool can generate HttpRequests using the DOM classes. To do this you need to select the HTTP Request option for the required methods. Here is an example of how the generated HTTPRequest version of the login method appears. Each request and response element gets a constructor that works with a Dom.XmlNode and a corresponding method to ...


5

You do not need to generate the partner WSDL again as it will not have changed. But if the customer has hard coded the set of field names in their logic your new field will not be handled. That may be OK. If you need them to handle the new field in some specific way you will have to let them know so they can change their code. Or if the fields are handled ...


5

Salesforce's Wsdl2Apex doesn't support the xs:attribute element. In this post, @Sonam_SFDC describes how to fix the issue: Here, I understand that the schema contain definition of attribute that is not part of any object/element. In a normal document layout schema, this would permitted in this form for the purposes of defining reusable element ...


5

The Async class is intended to be used in a continuation. See Make Long-Running Callouts from a Visualforce Page Basically, a continuation will provide a callback mechanism so that when the async callout is complete you can bring the result back to the client. A @future method won't provide that callback mechanism. It's more fire and forget.


5

A critical difference between the two is how change is handled i.e. what needs to be done when the org the WSDLs are generated from's structure changes - when new fields and objects being added. In most businesses such changes do happen. With the Partner WSDL, the client code can automatically adapt with no need for the Partner WSDL to be generated again ...


4

Try right clicking the page and click "View page source". The Source IS the XML document


4

As you have probably worked out, types like DebuggingHeader are generated in the WSDL because they are part of the API infrastructure that is available to a client. While you could (manually) remove them as they are typically optional I am not sure why it would be worth the trouble. Which of your own SObjects you expose obviously depends which objects you ...


4

The WSDL is available on any edition that has the API enabled: Enterprise, Unlimited, Performance, Developer, and Sandbox (and a few other special types). If you don't have the link to the WSDL, it is likely you do not have permission for that organization. Often times, some administrators will make so-called "admin" profiles that are not actually ...


4

If you don't need the new > v20.0 features, you can still use it verbatim for some time. It really isn't much more than a wrapper for things you'd do yourself if you used SoapClient (I've done this for a small Drupal module). Of course, you can just drop a v31.0 WSDL in the appropriate place, and it should work just fine. I wouldn't just change the endpoint,...


4

You need to obtain the WSDL from the external application. For example, for PayPal those are available here. So finding those WSDLs for the external service is the first step. Note that it is very common that the WSDL will require some modification before you can generate Apex code from it using the "Generate from Apex" (wsdl2apex) button and in some cases ...


4

If you just want all the results in a single variable you could create a List and use the addRange method. List<SaveResult> allSavedResults = new List<SaveResult>(); allSavedResults.addRange(SfdcBinding.update(oppList.ToArray())); allSavedResults.addRange(SfdcBinding.update(pHUpdateList.ToArray())); allSavedResults.addRange(SfdcBinding. create(...


4

Trial version accounts do not provide WSDL. You need to have developer or enterprise account to generate WSDL for your environment. If you are not able to see it in the options then it might be because you may not be logged in as admin or with Modify All Data permission and that might be stopping you from generating the WSDL. Else the procedure is quite ...


4

The native version of Wsdl2Apex doesn't support {http://www.w3.org/2001/XMLSchema}anyType because WebserviceCallout.invoke can't. By having Account in the methods Arguments and return type Salesforce is going to generate xsd:complexType's for all sorts of supporting types. A number of these will have elements like: <xsd:element name="NewValue" ...


Only top voted, non community-wiki answers of a minimum length are eligible