6 votes
Accepted

Unsupported Schema element found http://www.w3.org/2001/XMLSchema:attribute

In this particular case you are dealing with the common wsdl:import that .NET adds to web services to handle generic serialization (schemas.microsoft.com.2003.10.Serialization.xsd Schema). Being ...
Daniel Ballinger's user avatar
6 votes

Unsupported Schema element found http://www.w3.org/2001/XMLSchema:attribute

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 ...
Scott Pelak's user avatar
  • 7,484
5 votes
Accepted

Bypass the "Apex type not found" error

No, you can't bypass it when using wsdl2Apex and the corresponding WebServiceCallout.invoke() call. It expects to be able to deserialize the entire response message according to what was defined in ...
Daniel Ballinger's user avatar
5 votes
Accepted

Use Named Credentials with a SOAP WSDL2APEX class

I haven't tested this, but when you are creating your Named Credential you have the option to tick "Generate Authorization Header", which should do this for you automatically:
smukov's user avatar
  • 5,503
5 votes
Accepted

Null pointer Exception in test classes when installing the Custom Metadata Loader

The problem is occurring in the upsertMetadata SOAP callout in a testing context. The test Cases in CustomMetadataUploadControllerTest are using the MDWrapperWebServiceMock mock for the SOAP requests....
Daniel Ballinger's user avatar
5 votes
Accepted

Issue with SOAP Header created via Apex

Looking at http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd I see <xsd:complexType name="PasswordString"> <xsd:annotation> <xsd:documentation>...
Daniel Ballinger's user avatar
4 votes

Make RPC/Encoded callouts from Apex

One option would be to craft the raw HttpRequest yourself and then parse the response. A tool like SoapUI would be really useful here. You could use it to generate sample requests and responses. Then ...
Daniel Ballinger's user avatar
4 votes
Accepted

Exact Target SOAP API: Using 'SimpleFilterPart' for Retrieve

I had the same problem using directly the apex class generated from ExactTarget WSDL in SalesForce. I solved in this way. First in the wsdl generated class we have to declare "virtual" the public ...
JGL's user avatar
  • 56
4 votes
Accepted

SOQL retrieve limited?

lead.setFirstName(sobj[j].getField("FirstName").toString()); The Lead FirstName field is not required. As such, it will return as null via the API if it is not defined. You will need to check if it ...
Daniel Ballinger's user avatar
4 votes

Creating Data Extension using Apex (WSDL2Apex)

The method to target is below public exacttargetComWsdlPartnerapi.CreateResponse_element Create(exacttargetComWsdlPartnerapi.CreateOptions Options,exacttargetComWsdlPartnerapi.APIObject[] Objects) { ...
Mohith Shrivastava's user avatar
4 votes
Accepted

What is the meaning of array elements of *type_info variables in SOAP / WSDL auto-generated Apex classes?

The details are fairly well covered in What are the parameters for the Salesforce WebServiceCallout.invoke method? From Jeremy's answer: If the variable represents another XML element or a text node, ...
Daniel Ballinger's user avatar
3 votes
Accepted

Axapta Wsdl2Apex Error

Can you share the WSDL in question? I've made a free alternative version of WSDL2Apex that can process xsd imports directly - See FuseIT SFDC Explorer. Generally speaking with imports (as Keith ...
Daniel Ballinger's user avatar
3 votes
Accepted

Where can i find the header information in a webservice callout request?

The DEBUG logging will have two CALLOUT_REQUEST entries. The first will have the SOAP formatted POST body. I.e. the <env:Envelope ...> <?xml version="1.0" encoding="utf-8"?> <env:...
Daniel Ballinger's user avatar
3 votes

WebServiceCallout (wsdl2apex)

The easiest way to debug a WebServiceCallout.invoke call is to capture the debug log from a Developer Edition org. In this case it will include the CALLOUT_REQUEST, CALLOUT_RESPONSE events. The info ...
Daniel Ballinger's user avatar
3 votes
Accepted

Apex to WSDL Generation

If you have the methods marked as a web service keyword there will be a link next to the class in the class list to generate the WSDL Setup -> Develop -> Apex Classes
Eric's user avatar
  • 53.9k
3 votes

How to make a SOAP call using APEX Class?

If your WSDL is proving to be problematic with the built in wsdl2apex implementation that Salesforce provides you could also try the version they make available via GitHub. Another alternative is the ...
Daniel Ballinger's user avatar
3 votes

Forming SOAP header through apex class if the WSDL provided has no information regarding the header

As an alternative you can also modify the generated APEX class, adding a security header. That way you won't have to generate the entire xml string from scratch. This is described in detail here: ...
Guy Clairbois's user avatar
3 votes
Accepted

how do i get the sessionId in Apex class

You can use the FuseIT SFDC Explorer to simplify the process and keep the generated Apex to a minimum. To do this, point the Wsdl2Apex tab at the downloaded Partner API Wsdl. On the method selection ...
Daniel Ballinger's user avatar
3 votes

WSDL2Apex Ignoring Namespace

WSDL to Apex doesn't support referencing elements from a different namespace: Apex also supports the following schema constructs: xsd:all, in Apex code saved using API version 15.0 and later xsd:...
Pr0tput's user avatar
  • 112
3 votes
Accepted

WSDL2Apex: How to edit Paypal WSDL because of few XSD schema imports?

That's an interesting WSDL that presents a number of challenges to import into Salesforce. I've been able to generate the Apex classes for it using the FuseIT SFDC Explorer Wsdl2Apex functionality (...
Daniel Ballinger's user avatar
3 votes

Alter WSDL2APEX Classes for callout tracking

The wsdl2apex generated classes will include the inputHttpHeaders_x and outputHttpHeaders_x members. You can use inputHttpHeaders_x to send additional HTTP headers in on the request and ...
Daniel Ballinger's user avatar
3 votes

When can or can't I use Wsdl2Apex?

The web based version of WSDL2Apex is ultimately a code generator for WebServiceCallout.invoke. If you use it then you generally get the limitations for both WSDL2Apex and WebserviceCallout.invoke. ...
Daniel Ballinger's user avatar
3 votes
Accepted

Apex callout exception when making hitting an external Service

The reason for this erro was , I was passing the username and password in the wrong way in Http header like below: sample.inputHttpHeaders_x = new Map<String, String>(); sample....
SfdcBat's user avatar
  • 4,751
3 votes
Accepted

Tracing the request.xml sent using apex callout

You can't see the full CALLOUT_REQUEST from a Sandbox. See the idea - View Callout Request and Response XML in Sandbox. We can't do this without blowing up the debug logs. Debug logs can only be 2MB, ...
Daniel Ballinger's user avatar
3 votes

Test Class for WSDL2Apex class generated by Salesforce Partner WSDL

I made a alternative version of WSDL2Apex that can also generate the test classes for coverage and the Mock. You can get it via the FuseIT SFDC Explorer for free (Disclaimer: This is from my current ...
Daniel Ballinger's user avatar
3 votes
Accepted

Apex callout fails suddenly

Check the debug log for the raw CALLOUT_RESPONSE. You might need to do this in a developer edition org to see it. An h4 in the response suggests you are getting an HTML page back in the response. ...
Daniel Ballinger's user avatar
3 votes
Accepted

FuseIT WSDL2Apex Error: Missing namespace for operation

I just tried to process the WSDL you provided. The error was: Missing namespace for operation: [doAction] PortType:COINSInterfacePort Parameter name: Input.Message.Namespace This corresponds to ...
Daniel Ballinger's user avatar
3 votes
Accepted

Script Too Large Error While Generating Apex Classes Using Metadata WSDL

When I've wanted to invoke this API from Apex in the past I have used this already generated and modified code: Apex Wrapper Salesforce Metadata API though it looks like it hasn't have much ...
Keith C's user avatar
  • 134k
3 votes
Accepted

Importing Wsdl2Apex with multiple wsdl:part in a wsdl:message

Unfortunately I don't think you are going to be able to use wsdl2apex and the corresponding WebServiceCallout.invoke() to call these multipart methods. As you have observed, the init message is ...
Daniel Ballinger's user avatar
2 votes

How do I create a listener within my org to let others POST to it and save data?

As I understand, your requirement is to explore certain business function as a web service (preferably REST),for that i'll recommend you to Salesforce developer forum wherein you can find lots of ...
Anshul's user avatar
  • 2,599

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