1

I'm trying to convert an Apex from a WSDL file, but I'm struggling with it. Since I'm not an experienced developer, the solution may be very simple and I hope anyone can help me.

When I try to convert the file below to Apex, I get this error message:

enter image description here

I've tryed to use some internet tools and also convert the file to json and tryed to convert into apex.

The original file can be found in WSDL File

The original file has the xs:attribute problem that I fixed using the instructions on this Post

Thanks!!

  • Were you able to do it in any soap client like SoapUI? – Pranay Jaiswal Dec 1 '18 at 14:53
0

The WSDL includes the "AgentStatus" simpleType that isn't supported by WebServiceCallout.invoke().

        <xs:simpleType name="AgentStatus">
            <xs:restriction base="xs:string">
                <xs:enumeration value="Prospective">
                    <xs:annotation>
                        <xs:appinfo>
                            <EnumerationValue xmlns="http://schemas.microsoft.com/2003/10/Serialization/">100</EnumerationValue>
                        </xs:appinfo>
                    </xs:annotation>
                </xs:enumeration>
                <xs:enumeration value="Active">
                    <xs:annotation>
                        <xs:appinfo>
                            <EnumerationValue xmlns="http://schemas.microsoft.com/2003/10/Serialization/">200</EnumerationValue>
                        </xs:appinfo>
                    </xs:annotation>
                </xs:enumeration>
                <xs:enumeration value="Suspended">
                    <xs:annotation>
                        <xs:appinfo>
                            <EnumerationValue xmlns="http://schemas.microsoft.com/2003/10/Serialization/">300</EnumerationValue>
                        </xs:appinfo>
                    </xs:annotation>
                </xs:enumeration>
                <xs:enumeration value="Inactive">
                    <xs:annotation>
                        <xs:appinfo>
                            <EnumerationValue xmlns="http://schemas.microsoft.com/2003/10/Serialization/">400</EnumerationValue>
                        </xs:appinfo>
                    </xs:annotation>
                </xs:enumeration>
            </xs:restriction>
        </xs:simpleType>

It's used as the parameter to the "AgentStatus" operation via "tns:IAgentService_AgentStatus_InputMessage".

<wsdl:message name="IAgentService_AgentStatus_InputMessage">
    <wsdl:part name="parameters" element="tns:AgentStatus"/>
</wsdl:message>

It's possible that this is getting mixed up with the complexType in the "urn:infospeed:classweb:api:contracts" namespace.

Are you able to update the WSDL (and the corresponding service) to make the types distinct?

In particular, in the schema for the "http://schemas.datacontract.org/2004/07/Infospeed.Services.ClassWeb.API.Contracts" namespace you have both the "AgentStatus" simpleType and an element "AgentStatus" that is of type "AgentStatus" from the "urn:infospeed:classweb:api:contracts" namespace.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.