1

I'm trying to solve this problem with Salesforce.

I'm trying to generate apex classes from WSDL (converted from WADL)

Parsing works correcly without any errors and warning. But I can't generate the apex code from WSDL.

Step 1

enter image description here

Step 2 with error

enter image description here

WSDL file

<?xml version="1.0" encoding="UTF-8"?>
    <definitions xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" targetNamespace="https://earthquake.usgs.gov/fdsnws/event/1/wsdl" xmlns="http://schemas.xmlsoap.org/wsdl/">
      <types>
        <xs:schema xmlns:tns="https://earthquake.usgs.gov/fdsnws/event/1/schemas" targetNamespace="https://earthquake.usgs.gov/fdsnws/event/1/schemas" xmlns:xs="http://www.w3.org/2001/XMLSchema">
          <xs:simpleType name="orderby">
            <xs:restriction base="xs:string">
              <xs:enumeration value="time" />
              <xs:enumeration value="time-asc" />
              <xs:enumeration value="magnitude" />
              <xs:enumeration value="magnitude-asc" />
            </xs:restriction>
          </xs:simpleType>
          <xs:simpleType name="format">
            <xs:restriction base="xs:string">
              <xs:enumeration value="quakeml" />
              <xs:enumeration value="csv" />
              <xs:enumeration value="geojson" />
              <xs:enumeration value="kml" />
            </xs:restriction>
          </xs:simpleType>
          <xs:simpleType name="kmlcolorby">
            <xs:restriction base="xs:string">
              <xs:enumeration value="age" />
              <xs:enumeration value="depth" />
            </xs:restriction>
          </xs:simpleType>
          <xs:simpleType name="reviewstatus">
            <xs:restriction base="xs:string">
              <xs:enumeration value="automatic" />
              <xs:enumeration value="reviewed" />
            </xs:restriction>
          </xs:simpleType>
          <xs:simpleType name="producttype">
            <xs:restriction base="xs:string">
              <xs:enumeration value="moment-tensor" />
              <xs:enumeration value="focal-mechanism" />
              <xs:enumeration value="shakemap" />
              <xs:enumeration value="losspager" />
              <xs:enumeration value="dyfi" />
            </xs:restriction>
          </xs:simpleType>
          <xs:element name="GET_version_InputMessage">
            <xs:complexType>
              <xs:sequence />
            </xs:complexType>
          </xs:element>
          <xs:element name="GET_version_OutputMessage" type="xs:string" />
          <xs:element name="GET_catalogs_InputMessage">
            <xs:complexType>
              <xs:sequence />
            </xs:complexType>
          </xs:element>
          <xs:element name="GET_catalogs_OutputMessage" type="xs:anyType" />
          <xs:element name="GET_contributors_InputMessage">
            <xs:complexType>
              <xs:sequence />
            </xs:complexType>
          </xs:element>
          <xs:element name="GET_contributors_OutputMessage" type="xs:anyType" />
          <xs:element name="GET_application.wadl_InputMessage">
            <xs:complexType>
              <xs:sequence />
            </xs:complexType>
          </xs:element>
          <xs:element name="GET_application.wadl_OutputMessage" type="xs:anyType" />
          <xs:element name="GET_query_InputMessage">
            <xs:complexType>
              <xs:sequence>
                <xs:element minOccurs="0" name="starttime" type="xs:dateTime" />
                <xs:element minOccurs="0" name="endtime" type="xs:dateTime" />
                <xs:element minOccurs="0" name="updatedafter" type="xs:dateTime" />
                <xs:element minOccurs="0" default="-90" name="minlatitude" type="xs:double" />
                <xs:element minOccurs="0" default="90" name="maxlatitude" type="xs:double" />
                <xs:element minOccurs="0" default="-180" name="minlongitude" type="xs:double" />
                <xs:element minOccurs="0" default="0" name="latitude" type="xs:double" />
                <xs:element minOccurs="0" default="0" name="longitude" type="xs:double" />
                <xs:element minOccurs="0" default="0" name="minradius" type="xs:double" />
                <xs:element minOccurs="0" default="180" name="maxradius" type="xs:double" />
                <xs:element minOccurs="0" name="mindepth" type="xs:double" />
                <xs:element minOccurs="0" name="maxdepth" type="xs:double" />
                <xs:element minOccurs="0" name="minmagnitude" type="xs:double" />
                <xs:element minOccurs="0" name="maxmagnitude" type="xs:double" />
                <xs:element minOccurs="0" name="magnitudetype" type="xs:string" />
                <xs:element minOccurs="0" name="includeallmagnitudes" type="xs:boolean" />
                <xs:element minOccurs="0" name="includeallorigins" type="xs:boolean" />
                <xs:element minOccurs="0" name="includearrivals" type="xs:boolean" />
                <xs:element minOccurs="0" name="eventid" type="xs:string" />
                <xs:element minOccurs="0" name="limit" type="xs:integer" />
                <xs:element minOccurs="0" default="1" name="offset" type="xs:integer" />
                <xs:element minOccurs="0" default="time" name="orderby" type="tns:orderby" />
                <xs:element minOccurs="0" name="contributor" type="xs:string" />
                <xs:element minOccurs="0" name="catalog" type="xs:string" />
                <xs:element minOccurs="0" default="quakeml" name="format" type="tns:format" />
                <xs:element minOccurs="0" name="callback" type="xs:string" />
                <xs:element minOccurs="0" default="age" name="kmlcolorby" type="tns:kmlcolorby" />
                <xs:element minOccurs="0" default="false" name="kmlanimated" type="xs:boolean" />
                <xs:element minOccurs="0" name="eventtype" type="xs:string" />
                <xs:element minOccurs="0" name="reviewstatus" type="tns:reviewstatus" />
                <xs:element minOccurs="0" name="minmmi" type="xs:double" />
                <xs:element minOccurs="0" name="maxmmi" type="xs:double" />
                <xs:element minOccurs="0" name="mincdi" type="xs:double" />
                <xs:element minOccurs="0" name="maxcdi" type="xs:double" />
                <xs:element minOccurs="0" name="minfelt" type="xs:integer" />
                <xs:element minOccurs="0" default="*" name="alertlevel" type="xs:string" />
                <xs:element minOccurs="0" name="mingap" type="xs:double" />
                <xs:element minOccurs="0" name="maxgap" type="xs:double" />
                <xs:element minOccurs="0" name="minsig" type="xs:integer" />
                <xs:element minOccurs="0" name="maxsig" type="xs:integer" />
                <xs:element minOccurs="0" name="producttype" type="tns:producttype" />
              </xs:sequence>
            </xs:complexType>
          </xs:element>
          <xs:element name="GET_query_OutputMessage" type="xs:anyType" />
        </xs:schema>
      </types>
      <message name="GET_version_InputMessage">
        <part name="GET_version_InputMessage" xmlns:q1="https://earthquake.usgs.gov/fdsnws/event/1/schemas" element="q1:GET_version_InputMessage" />
      </message>
      <message name="GET_version_OutputMessage">
        <part name="GET_version_OutputMessage" xmlns:q2="https://earthquake.usgs.gov/fdsnws/event/1/schemas" element="q2:GET_version_OutputMessage" />
      </message>
      <message name="GET_catalogs_InputMessage">
        <part name="GET_catalogs_InputMessage" xmlns:q3="https://earthquake.usgs.gov/fdsnws/event/1/schemas" element="q3:GET_catalogs_InputMessage" />
      </message>
      <message name="GET_catalogs_OutputMessage">
        <part name="GET_catalogs_OutputMessage" xmlns:q4="https://earthquake.usgs.gov/fdsnws/event/1/schemas" element="q4:GET_catalogs_OutputMessage" />
      </message>
      <message name="GET_contributors_InputMessage">
        <part name="GET_contributors_InputMessage" xmlns:q5="https://earthquake.usgs.gov/fdsnws/event/1/schemas" element="q5:GET_contributors_InputMessage" />
      </message>
      <message name="GET_contributors_OutputMessage">
        <part name="GET_contributors_OutputMessage" xmlns:q6="https://earthquake.usgs.gov/fdsnws/event/1/schemas" element="q6:GET_contributors_OutputMessage" />
      </message>
      <message name="GET_application.wadl_InputMessage">
        <part name="GET_application.wadl_InputMessage" xmlns:q7="https://earthquake.usgs.gov/fdsnws/event/1/schemas" element="q7:GET_application.wadl_InputMessage" />
      </message>
      <message name="GET_application.wadl_OutputMessage">
        <part name="GET_application.wadl_OutputMessage" xmlns:q8="https://earthquake.usgs.gov/fdsnws/event/1/schemas" element="q8:GET_application.wadl_OutputMessage" />
      </message>
      <message name="GET_query_InputMessage">
        <part name="GET_query_InputMessage" xmlns:q9="https://earthquake.usgs.gov/fdsnws/event/1/schemas" element="q9:GET_query_InputMessage" />
      </message>
      <message name="GET_query_OutputMessage">
        <part name="GET_query_OutputMessage" xmlns:q10="https://earthquake.usgs.gov/fdsnws/event/1/schemas" element="q10:GET_query_OutputMessage" />
      </message>
      <portType name="API_PortType">
        <operation name="GET_version">
          <documentation></documentation>
          <input xmlns:q11="https://earthquake.usgs.gov/fdsnws/event/1/wsdl" message="q11:GET_version_InputMessage" />
          <output xmlns:q12="https://earthquake.usgs.gov/fdsnws/event/1/wsdl" message="q12:GET_version_OutputMessage">
            <documentation></documentation>
          </output>
        </operation>
        <operation name="GET_catalogs">
          <documentation></documentation>
          <input xmlns:q13="https://earthquake.usgs.gov/fdsnws/event/1/wsdl" message="q13:GET_catalogs_InputMessage" />
          <output xmlns:q14="https://earthquake.usgs.gov/fdsnws/event/1/wsdl" message="q14:GET_catalogs_OutputMessage">
            <documentation></documentation>
          </output>
        </operation>
        <operation name="GET_contributors">
          <documentation></documentation>
          <input xmlns:q15="https://earthquake.usgs.gov/fdsnws/event/1/wsdl" message="q15:GET_contributors_InputMessage" />
          <output xmlns:q16="https://earthquake.usgs.gov/fdsnws/event/1/wsdl" message="q16:GET_contributors_OutputMessage">
            <documentation></documentation>
          </output>
        </operation>
        <operation name="GET_application.wadl">
          <documentation></documentation>
          <input xmlns:q17="https://earthquake.usgs.gov/fdsnws/event/1/wsdl" message="q17:GET_application.wadl_InputMessage" />
          <output xmlns:q18="https://earthquake.usgs.gov/fdsnws/event/1/wsdl" message="q18:GET_application.wadl_OutputMessage">
            <documentation></documentation>
          </output>
        </operation>
        <operation name="GET_query">
          <documentation></documentation>
          <input xmlns:q19="https://earthquake.usgs.gov/fdsnws/event/1/wsdl" message="q19:GET_query_InputMessage" />
          <output xmlns:q20="https://earthquake.usgs.gov/fdsnws/event/1/wsdl" message="q20:GET_query_OutputMessage">
            <documentation></documentation>
          </output>
        </operation>
      </portType>
      <binding name="API_Binding" xmlns:q21="https://earthquake.usgs.gov/fdsnws/event/1/wsdl" type="q21:API_PortType">
        <soap:binding transport="http://schemas.xmlsoap.org/soap/http" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" />
        <operation name="GET_version">
          <soap:operation soapAction="GET_version" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" />
          <input>
            <soap:body use="literal" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" />
          </input>
          <output>
            <soap:body use="literal" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" />
          </output>
        </operation>
        <operation name="GET_catalogs">
          <soap:operation soapAction="GET_catalogs" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" />
          <input>
            <soap:body use="literal" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" />
          </input>
          <output>
            <soap:body use="literal" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" />
          </output>
        </operation>
        <operation name="GET_contributors">
          <soap:operation soapAction="GET_contributors" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" />
          <input>
            <soap:body use="literal" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" />
          </input>
          <output>
            <soap:body use="literal" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" />
          </output>
        </operation>
        <operation name="GET_application.wadl">
          <soap:operation soapAction="GET_application.wadl" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" />
          <input>
            <soap:body use="literal" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" />
          </input>
          <output>
            <soap:body use="literal" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" />
          </output>
        </operation>
        <operation name="GET_query">
          <soap:operation soapAction="GET_query" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" />
          <input>
            <soap:body use="literal" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" />
          </input>
          <output>
            <soap:body use="literal" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" />
          </output>
        </operation>
      </binding>
      <service name="API">
        <documentation></documentation>
        <port name="default_Port" xmlns:q22="https://earthquake.usgs.gov/fdsnws/event/1/wsdl" binding="q22:API_Binding">
          <soap:address location="https%3A%2F%2Fearthquake.usgs.gov%2Ffdsnws%2Fevent%2F1%2F" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" />
        </port>
      </service>
    </definitions>

Thanks in advice,

0

I assume the API you are using is the USGS Earthquake Catalog. It appears their WADL is for describing a REST based web service rather than one that is SOAP based.

The Salesforce WSDL2Apex tooling won't really help you here as it is all based around SOAP based services.

Salesforce also has JSON support, so if you calls using the format=geojson query string parameter is should be fairly straight forward to parse the json response.

E.g. sent a GET request to https://earthquake.usgs.gov/fdsnws/event/1/query?format=geojson&starttime=2014-01-01&endtime=2014-01-02 then use and Apex JSONParser to parse it.

There are even tools available that will generate Apex classes based on the structure of the JSON response. See json2apex

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.