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
patelankurbpatelankurb 

Problem with wsdl2Apex code generation - class relationship extension

Wsdl2java (Axis 2.0) generates class extension is properly. But in Apex, generate Apex from WSDL feature is not giving appropriate class relationship.

e.g. I have following xsd in wsdl

<xsd:complexType name="Profile">
      <xsd:simpleContent>
              <xsd:extension base="xsd:string">
                 <xsd:attribute name="lang" type="xsd:string" use="optional"/>
              </xsd:extension>
      </xsd:simpleContent>
</xsd:complexType>

<xsd:complexType name="UserProfile">
        <xsd:simpleContent>
            <xsd:extension base="Profile">
                <xsd:attribute name="code" type="xsd:string"/>
            </xsd:extension>
        </xsd:simpleContent>
</xsd:complexType>

 

WSDL2Apex generates UserProfile and Profile classes, but dont have any relationship. In java Profile class has String _value containment. But Apex class does not have that containment too.

 

Any help would be appreciate.

 

Thanks.

Ankur

 

sfdcdev.wordpress.comsfdcdev.wordpress.com
Did you ever hapen to resolve this issue.
Imran MohammedImran Mohammed

Hi Patel,

 

Did you ever found a solution for the problem you ran into?

patelankurbpatelankurb

After apex class generation, I changed generated code with entends.. I tweek generated code.. and that works for me..

Imran MohammedImran Mohammed

Thanks Patel for the response.

 

Can you please paste the code snippet generated from the WSDL which you mentioned in your question and what changes you did to it?

That will be really helpful, as i am stuck with the similar issue.

 

Imran MohammedImran Mohammed

Hello Patel,

 

Did you mean extends in your previous reply.

Will be really helpful if you can provide some insight on how you did that.

Imran MohammedImran Mohammed

Hi Patel,

 

Can you please give some thoughts on this on how to proceed?

That will be really helpful if you can assist,

 

Gopal_webservice_integrationGopal_webservice_integration

Hi, Imran did you figure out the answer to your question?  I do have a similar issue.  Thanks

Imran MohammedImran Mohammed

Even i did not get the answer. Finally had to modify wsdl accordingly and generate the Apex code?

Looks like WSDL2Apex is not interpreting the complex type as the other tools does.

Maros SitkoMaros Sitko
I know, that is old question, but can someone provide any code for solution? thank you