1

I have the below apex class as a SOAP Webservice

global class TestingWebService {

    webservice static List<ContentDocument> getContentNotes(date startDate, date endDate) {
        ContentDocument[] ContentDocumentToReturn = new ContentDocument[0];
        for(ContentDocument contentDoc : [SELECT Id, LatestPublishedVersion.title,LatestPublishedVersion.textPreview, LastModifiedDate,
                                          (SELECT LinkedEntityId FROM ContentDocumentLinks WHERE LinkedEntity.Type='Contact')
                                          FROM ContentDocument WHERE LastModifiedDate >=:startDate AND LastModifiedDate <=:endDate  order by lastModifiedDate desc LIMIT 1000]) {

                                              if(!contentDoc.ContentDocumentLinks.isEmpty()) {
                                                  ContentDocumentToReturn.add(contentDoc);
                                              }
                                          }        
        return ContentDocumentToReturn;
    }  
}

I have generated the WSDL from the apex classes page in Salesforce but when I add the WSDL in SOAP UI to test the web service I got the below list of errors:

enter image description here

After wasting hours on google I got the below link

https://success.salesforce.com/issues_view?id=a1p3A000000eatxQAA this solved all error except the first two as shown in the above picture

Could someone please help me either merge this wsdl with the enterprise WSDL or how to solve the first two errors as shown in the image

2 Answers 2

2

Here is the complex Type for StringList (From the Enterprise WSDL):

<complexType name="StringList">
  <sequence>
    <element name="values" type="xsd:string" minOccurs="0" maxOccurs="unbounded"/>
  </sequence>
</complexType>

And ChangeEventHeader (From the Partner WSDL):

<simpleType name="changeEventType">
  <restriction base="xsd:string">
    <enumeration value="CREATE"/>
    <enumeration value="UPDATE"/>
    <enumeration value="DELETE"/>
    <enumeration value="UNDELETE"/>
    <enumeration value="GAP_CREATE"/>
    <enumeration value="GAP_UPDATE"/>
    <enumeration value="GAP_DELETE"/>
    <enumeration value="GAP_UNDELETE"/>
  </restriction>
</simpleType>
<complexType name="ChangeEventHeader">
  <sequence>
    <element name="entityName" type="xsd:string"/>
    <element name="recordIds" type="xsd:string" minOccurs="1" maxOccurs="unbounded"/>
    <element name="commitTimestamp" type="xsd:long"/>
    <element name="commitNumber" type="xsd:long"/>
    <element name="commitUser" type="xsd:string"/>
    <element name="diffFields" type="xsd:string" minOccurs="0" maxOccurs="unbounded"/>
    <element name="changeType" type="tns:changeEventType"/>
    <element name="changeOrigin" type="xsd:string"/>
    <element name="transactionKey" type="xsd:string"/>
    <element name="sequenceNumber" type="xsd:int"/>
    <element name="isTransactionEnd" type="xsd:boolean"/>
    <element name="nulledFields" type="xsd:string" minOccurs="0" maxOccurs="unbounded"/>
  </sequence>
</complexType>
1
  • Thank you so much!
    – gs650x
    Jun 2, 2019 at 9:31
0

If you still have the same error, maybe this works for you:

Into webservice WSLD file, below xsd:schema, as the previous comments explained, you have to insert inline those missing lines, that's right, but be also aware of adding "wsd", into every label/line you are adding

For instance, it would be:

<xsd:schema elementFormDefault="qualified" targetNamespace="http://soap.sforce.com/schemas/class/KS_WS_Products">
            <xsd:simpleType name="changeEventType">
                <xsd:restriction base="xsd:string">
                    <xsd:enumeration value="CREATE"/>
                    <xsd:enumeration value="UPDATE"/>
                    <xsd:enumeration value="DELETE"/>
                    <xsd:enumeration value="UNDELETE"/>
                    <xsd:enumeration value="GAP_CREATE"/>
                    <xsd:enumeration value="GAP_UPDATE"/>
                    <xsd:enumeration value="GAP_DELETE"/>
                    <xsd:enumeration value="GAP_UNDELETE"/>
                </xsd:restriction>
            </xsd:simpleType>
            <xsd:complexType name="ChangeEventHeader">
                <xsd:sequence>
                    <xsd:element name="entityName" type="xsd:string"/>
                    <xsd:element name="recordIds" type="xsd:string" minOccurs="1" maxOccurs="unbounded"/>
                    <xsd:element name="commitTimestamp" type="xsd:long"/>
                    <xsd:element name="commitNumber" type="xsd:long"/>
                    <xsd:element name="commitUser" type="xsd:string"/>
                    <xsd:element name="diffFields" type="xsd:string" minOccurs="0" maxOccurs="unbounded"/>
                    <xsd:element name="changeType" type="tns:changeEventType"/>
                    <xsd:element name="changeOrigin" type="xsd:string"/>
                    <xsd:element name="transactionKey" type="xsd:string"/>
                    <xsd:element name="sequenceNumber" type="xsd:int"/>
                    <xsd:element name="isTransactionEnd" type="xsd:boolean"/>
                    <xsd:element name="nulledFields" type="xsd:string" minOccurs="0" maxOccurs="unbounded"/>
                </xsd:sequence>
            </xsd:complexType>

That worked for me!

Best regards!

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .