• Slachterman
  • NEWBIE
  • 0 Points
  • Member since 2012

  • Chatter
    Feed
  • 0
    Best Answers
  • 1
    Likes Received
  • 0
    Likes Given
  • 1
    Questions
  • 1
    Replies

I am having trouble with wsdl2apex code generation, mainly due to the use of xs:import namespace and xs:extension in my WSDL.

In particular, I am seeing the error System.CalloutException: Web service callout failed: Unable to parse callout response. Apex type not found for element . . .. The raw SOAP response returned by the web service looks as I would expect.

I would like to modify the generated Apex classes to work around this issue, as server-side changes to the web service is not an option.

The SOAP response looks like the below:

 

<ns:getAccountsResponse>
 <ns:return xsi:type="ax1:AccountReturn">
  <ax2:successful>true</ax2:successful>
  <ax2:transactionId>1000</ax2:transactionId>
  <ax1:Accounts xsi:type="ax1:Account">

 

And the WSDL looks like this for the ax1 target namespace:

 

<xs:complexType name="AccountReturn">
 <xs:complexContent>
  <xs:extension base="ax100:BaseReturnObject">
   <xs:sequence>
    <xs:element maxOccurs="unbounded" minOccurs="0" name="Accounts" nillable="true" type="ax1:Account"/>
   </xs:sequence>
  </xs:extension>
 </xs:complexContent>
</xs:complexType>

 
And for the ax2 target namespace:

<xs:complexType name="BaseReturnObject">
 <xs:sequence>
  <xs:element minOccurs="0" name="successful" type="xs:boolean"/>
  <xs:element minOccurs="0" name="transactionId" nillable="true" type="xs:integer"/>
 </xs:sequence>
</xs:complexType>

 

The generated Apex Class which maps to AccountReturn only contains the fields for Accounts in ax1, but not the BaseReturnObject fields in ax2, since the wsdl2apex generation does not respect the use of xs:extension or the importing of namespaces (based on my research).

Is there anyway to modify the Apex Class to make this work? I tried adding the fields from BaseReturnObject to AccountReturn, and modifying field_order_type_info. However, it appears that apex_schema_type_info can only point to one namespace, and this may be the reason that the parsing of the callout response is still failing.

I am having trouble with wsdl2apex code generation, mainly due to the use of xs:import namespace and xs:extension in my WSDL.

In particular, I am seeing the error System.CalloutException: Web service callout failed: Unable to parse callout response. Apex type not found for element . . .. The raw SOAP response returned by the web service looks as I would expect.

I would like to modify the generated Apex classes to work around this issue, as server-side changes to the web service is not an option.

The SOAP response looks like the below:

 

<ns:getAccountsResponse>
 <ns:return xsi:type="ax1:AccountReturn">
  <ax2:successful>true</ax2:successful>
  <ax2:transactionId>1000</ax2:transactionId>
  <ax1:Accounts xsi:type="ax1:Account">

 

And the WSDL looks like this for the ax1 target namespace:

 

<xs:complexType name="AccountReturn">
 <xs:complexContent>
  <xs:extension base="ax100:BaseReturnObject">
   <xs:sequence>
    <xs:element maxOccurs="unbounded" minOccurs="0" name="Accounts" nillable="true" type="ax1:Account"/>
   </xs:sequence>
  </xs:extension>
 </xs:complexContent>
</xs:complexType>

 
And for the ax2 target namespace:

<xs:complexType name="BaseReturnObject">
 <xs:sequence>
  <xs:element minOccurs="0" name="successful" type="xs:boolean"/>
  <xs:element minOccurs="0" name="transactionId" nillable="true" type="xs:integer"/>
 </xs:sequence>
</xs:complexType>

 

The generated Apex Class which maps to AccountReturn only contains the fields for Accounts in ax1, but not the BaseReturnObject fields in ax2, since the wsdl2apex generation does not respect the use of xs:extension or the importing of namespaces (based on my research).

Is there anyway to modify the Apex Class to make this work? I tried adding the fields from BaseReturnObject to AccountReturn, and modifying field_order_type_info. However, it appears that apex_schema_type_info can only point to one namespace, and this may be the reason that the parsing of the callout response is still failing.

Hi,

Am unable to refresh any of the resources in the IDE from the server.

When am trying to refresh a page from the web, getting an Exception saying:

 

 

Unable to refresh resource 'MileaeExension.cls':
com.salesforce.ide.api.metadata.types.Metadata$JaxbAccessorF_fullName cannot be cast to com.sun.xml.bind.v2.runtime.reflect.Accessor

 

Unable to refresh resource 'MileaeExension.cls':


com.salesforce.ide.api.metadata.types.Metadata$JaxbAccessorF_fullName cannot be cast to com.sun.xml.bind.v2.runtime.reflect.Accessor

 

Please assist to rectify the issue. 

 

Thanks in advance,

VNath