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
CapgeminiCapgemini 

Problem with <xsd: extension> elements in WSDL while Callouts

Hi,

 

We are trying to integrate salesforce with an external system using Callouts. We recieved WSDL from external system and we are able generate wsdl2apex classes sucessfully. But the relationships are missing between the classes. Due to this we are not able to call the external web service. We found that this is due to the <xsd: extension> elements found in WSDL. Is there any way to reolsve this issue? Is there any way to remove <extension> elements without disturbing the schema?

<xsd:complexType abstract="false" name="InsurancePolicySearchCriteria"> <xsd:complexContent> <xsd:extension base="contractandspecification:ContractSearchCriteria"> <xsd:sequence> <xsd:element maxOccurs="1" minOccurs="0" name="lineOfBusinessName" type="xsd:string" /> <xsd:element maxOccurs="1" minOccurs="0" name="multiLinePolicyIndicator" type="xsd:string" /> <xsd:element maxOccurs="1" minOccurs="0" name="plannedEndDate" type="xsd:date" /> <xsd:element maxOccurs="1" minOccurs="0" name="policyEffectiveDate" type="xsd:date" /> <xsd:element maxOccurs="1" minOccurs="0" name="policySourceOperation" type="xsd:string" /> <xsd:element maxOccurs="1" minOccurs="0" name="policySourceSystem" type="xsd:string" /> <xsd:element maxOccurs="1" minOccurs="0" name="regionCode" type="xsd:string" /> <xsd:element maxOccurs="1" minOccurs="0" name="renewalDate" type="xsd:date" /> <xsd:element maxOccurs="1" minOccurs="0" name="version" type="xsd:string" /> <xsd:element maxOccurs="1" minOccurs="0" name="insuredSearchCriteria" type="party:PartySearchCriteria" /> <xsd:element maxOccurs="1" minOccurs="0" name="policyholderSearchCriteria" type="party:PartySearchCriteria" /> </xsd:sequence> </xsd:extension> </xsd:complexContent> </xsd:complexType>

 

<xsd:complexType abstract="false" name="ContractSearchCriteria">
   <xsd:complexContent>
    <xsd:extension base="common:SearchCriteria">
     <xsd:sequence>
      <xsd:element maxOccurs="1" minOccurs="0" name="externalReference" type="xsd:string" />
 
      <xsd:element maxOccurs="1" minOccurs="0" name="inceptionDate" type="xsd:date" />
     </xsd:sequence>
    </xsd:extension>
   </xsd:complexContent>
  </xsd:complexType>

 

 wsdl2apex genearted two different calsses InsurancePolicySearchCriteria & ContractSearchCriteria, but the relationship is missing between these classes. Is there any way to resolve this type of issues from salesforce?

Best Answer chosen by Admin (Salesforce Developers) 
suresh_indiasuresh_india

Eventhough this is a old post, I think sharing the info below would help someone who land on this post.

 

I was able to fix this issue by making a workaround in the wsdl2apex generated class. Salesforce will not parse the <xsd:extension base="common:SearchCriteria"> element correctly during wsdl2apex conversion. The element which is mentioned as base will be generated as a sperate inner class. What I did is, I copied the content of that inner class into the original class (which has the extension element in it). Also we would need to correct the apex_schema_type_info, field_order_type_info objects in the inner class after copying. After this change, I was able to call that service and get a response successfully. 

 

P.S : Mark this as resolved, if this works for you...

All Answers

JitendraJitendra

Hi,

 

I think in external webservice itself there is no relationship between these two classes and thats why you are facing the problem.

 

Please confiem that WSDL contains relationship or not by creating the proxy classes either in Java or .Net.

If it does not, ask the external systems's team to correct the WSDL.

 

tural sadigovtural sadigov

I get the same error

the webservice is ok I have consumed it from .NET and it works. Apex classes generated from wsdl loose the inheritance relations. I have changed them manually but they still do not work.

gaparagapara

Hi

 

Were you able to find any solution to this problem?

suresh_indiasuresh_india

Eventhough this is a old post, I think sharing the info below would help someone who land on this post.

 

I was able to fix this issue by making a workaround in the wsdl2apex generated class. Salesforce will not parse the <xsd:extension base="common:SearchCriteria"> element correctly during wsdl2apex conversion. The element which is mentioned as base will be generated as a sperate inner class. What I did is, I copied the content of that inner class into the original class (which has the extension element in it). Also we would need to correct the apex_schema_type_info, field_order_type_info objects in the inner class after copying. After this change, I was able to call that service and get a response successfully. 

 

P.S : Mark this as resolved, if this works for you...

This was selected as the best answer
ViveikViveik

Hi, Where is your Blog budy, please share with us ur blog


suresh_india wrote:

Eventhough this is a old post, I think sharing the info below would help someone who land on this post.

 

I was able to fix this issue by making a workaround in the wsdl2apex generated class. Salesforce will not parse the <xsd:extension base="common:SearchCriteria"> element correctly during wsdl2apex conversion. The element which is mentioned as base will be generated as a sperate inner class. What I did is, I copied the content of that inner class into the original class (which has the extension element in it). Also we would need to correct the apex_schema_type_info, field_order_type_info objects in the inner class after copying. After this change, I was able to call that service and get a response successfully. 

 

P.S : Mark this as resolved, if this works for you...



.

kaustav goswamikaustav goswami
Can you please explain the chnages that you had to do in the apex_schema_type_info? Was there two different namespace involved?