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
Erik IvarssonErik Ivarsson 

Trying to solve the "Error: Failed to parse wsdl: schema:targetNamespace can not be null" error without making the request invalid.

Im facing an issue when I try to import my WSDL into Salesforce and generate APEX code from this one (Error: Failed to parse wsdl: schema:targetNamespace can not be null). When I add a targetnamespace to my second schema in the following file, I need to update the reference so that my request still has the valid format:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:wss="http://www.boomi.com/connector/wss">
       <soapenv:Header/>
       <soapenv:Body>
          <wss:querySearch>
             <!--Optional:-->
             <Car>
                <Reg_Number></Reg_Number>
             </Car>
          </wss:querySearch>
       </soapenv:Body>
    </soapenv:Envelope>
My current WSDL:
<wsdl:definitions xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tns="http://www.boomi.com/connector/wss" xmlns:xs="http://www.w3.org/2001/XMLSchema" name="WebServiceProvider" targetNamespace="http://www.boomi.com/connector/wss" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">
      <wsdl:types>
        <xs:schema elementFormDefault="qualified" targetNamespace="http://www.boomi.com/connector/wss" version="1.0">
          <xs:import />
          <xs:element name="querySearch" type="tns:querySearch" />
          <xs:complexType name="querySearch">
            <xs:sequence>
              <xs:element minOccurs="0" ref="Car" />
            </xs:sequence>
          </xs:complexType>
          <xs:element name="querySearchResponse" type="tns:querySearchResponse" />
          <xs:complexType name="querySearchResponse">
            <xs:sequence>
              <xs:element minOccurs="0" ref="Car" />
            </xs:sequence>
          </xs:complexType>
        </xs:schema>
        <xs:schema elementFormDefault="qualified" version="1.0">
          <xs:element name="Car" type="Car" />
          <xs:complexType name="Car">
            <xs:sequence>
              <xs:element minOccurs="1" maxOccurs="1" name="Reg_Number" type="xs:string" />
              
            </xs:sequence>
          </xs:complexType>
        </xs:schema>
      </wsdl:types>
      <wsdl:message name="querySearch">
        <wsdl:part name="parameters" element="tns:querySearch" />
      </wsdl:message>
      <wsdl:message name="querySearchResponse">
        <wsdl:part name="parameters" element="tns:querySearchResponse" />
      </wsdl:message>
      <wsdl:portType name="WebServiceProviderPortType">
        <wsdl:operation name="querySearch">
          <wsdl:input message="tns:querySearch" />
          <wsdl:output message="tns:querySearchResponse" />
        </wsdl:operation>
      </wsdl:portType>
      <wsdl:binding name="WebServiceProviderPortBinding" type="tns:WebServiceProviderPortType">
        <soap:binding transport="http://schemas.xmlsoap.org/soap/http" />
        <wsdl:operation name="querySearch">
          <soap:operation soapAction="querySearch" />
          <wsdl:input>
            <soap:body use="literal" />
          </wsdl:input>
          <wsdl:output>
            <soap:body use="literal" />
          </wsdl:output>
        </wsdl:operation>
      </wsdl:binding>
      <wsdl:service name="WebServiceProvider">
        <wsdl:port name="WebServiceProviderPort" binding="tns:WebServiceProviderPortBinding">
          <soap:address location="XXXXXXXX" />
        </wsdl:port>
      </wsdl:service>
    </wsdl:definitions>

When I alter my WSDL to the following (adding a targetnamespace and adding the "tns:" to the types):
<wsdl:definitions xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tns="http://www.boomi.com/connector/wss" xmlns:xs="http://www.w3.org/2001/XMLSchema" name="WebServiceProvider" targetNamespace="http://www.boomi.com/connector/wss">
      <wsdl:types>
        <xs:schema elementFormDefault="qualified" targetNamespace="http://www.boomi.com/connector/wss" version="1.0">
          <xs:element name="Car" type="tns:Car"/>
          <xs:complexType name="Car">
            <xs:sequence>
              <xs:element maxOccurs="1" minOccurs="1" name="Reg_Number" type="xs:string"/>
            </xs:sequence>
          </xs:complexType>
          <xs:element name="querySearch" type="tns:querySearch"/>
          <xs:complexType name="querySearch">
            <xs:sequence>
              <xs:element minOccurs="0" ref="tns:Car"/>
            </xs:sequence>
          </xs:complexType>
          <xs:element name="querySearchResponse" type="tns:querySearchResponse"/>
          <xs:complexType name="querySearchResponse">
            <xs:sequence>
              <xs:element minOccurs="0" ref="tns:Car"/>
            </xs:sequence>
          </xs:complexType>
        </xs:schema>
      </wsdl:types>
      <wsdl:message name="querySearch">
        <wsdl:part element="tns:querySearch" name="parameters"/>
      </wsdl:message>
      <wsdl:message name="querySearchResponse">
        <wsdl:part element="tns:querySearchResponse" name="parameters"/>
      </wsdl:message>
      <wsdl:portType name="WebServiceProviderPortType">
        <wsdl:operation name="querySearch">
          <wsdl:input message="tns:querySearch"/>
          <wsdl:output message="tns:querySearchResponse"/>
        </wsdl:operation>
      </wsdl:portType>
      <wsdl:binding name="WebServiceProviderPortBinding" type="tns:WebServiceProviderPortType">
        <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
        <wsdl:operation name="querySearch">
          <soap:operation soapAction="querySearch"/>
          <wsdl:input>
            <soap:body use="literal"/>
          </wsdl:input>
          <wsdl:output>
            <soap:body use="literal"/>
          </wsdl:output>
        </wsdl:operation>
      </wsdl:binding>
      <wsdl:service name="WebServiceProvider">
        <wsdl:port binding="tns:WebServiceProviderPortBinding" name="WebServiceProviderPort">
          <soap:address location="XXXXXXXXXXXXXXXXX"/>
        </wsdl:port>
      </wsdl:service>
    </wsdl:definitions>

It goes through Salesforce but generates the following request:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:wss="http://www.boomi.com/connector/wss">
       <soapenv:Header/>
       <soapenv:Body>
          <wss:querySearch>
             <!--Optional:-->
             <wss:Car>
                <wss:Reg_Number>?</wss:Reg_Number>
             </wss:Car>
          </wss:querySearch>
       </soapenv:Body>
    </soapenv:Envelope>
It adds the "wss" prefix to the Car element and the input paramter in the request, which makes the request invalid. Can I solve this in some way by altering the namespaces or something like that? The wsdl is generated from Dell Boomi and hence a solution from there would be prefered but for now I am satisfied if I can alter the WSDL manually.

Ciao!
sushant panigrahisushant panigrahi
Hi Erik

I am having same problrm like you, i generated wsdl , 

It seems request profile invalid. Please give me some suggestion how you handle,

User-added image
using wsdl link, salesforce triggering boomi and sending data. 
 
but it is showing error: "No data produced from map, please check source profile and make sure it matches source data."
 
1. Initially it was showing unsupported include tag than i use wsdl=single to eliminate include tag.
2. and than targetnamespace can not be null than i use typenamespace in request profile and provide name space 
 
After this 2 salesforce enable to generate apexcode and parse successfully and it is triggering boomi. but now it is showing this error , request profile invalid it seems , please give me suggestion what should i do?
 
I am attaching screenshot of request profile and wsdl link, where i need to change, 
 
WSDL
 
https://xxxxxxxxxxxxxx/ws/soap/cal/v1/getData?wsdl=single 
This XML file does not appear to have any style information associated with it. The document tree is shown below.
<wsdl:definitions xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"xmlns:tns="http://www.boomi.com/connector/wss"xmlns:xs="http://www.w3.org/2001/XMLSchema" name="WebServiceProvider"targetNamespace="http://www.boomi.com/connector/wss">
<wsdl:types>
<xs:schema xmlns:tns="namespace.GERenewables.COM" elementFormDefault="qualified"targetNamespace="namespace.GERenewables.COM" version="1.0">
<xs:element name="Opportunity_Info" type="tns:Opportunity_Info"/>
<xs:complexType name="Opportunity_Info">
<xs:sequence>
<xs:element maxOccurs="1" minOccurs="0" name="OPPORTUNITY_NUMBER" type="xs:string"/>
<xs:element maxOccurs="1" minOccurs="0" name="OPPORTUNITY_NAME" type="xs:string"/>
<xs:element maxOccurs="1" minOccurs="0" name="INSTALL_COUNTRY" type="xs:string"/>
<xs:element maxOccurs="1" minOccurs="0" name="INSTALL_STATE" type="xs:string"/>
<xs:element maxOccurs="1" minOccurs="0" name="SITE_VAVG" type="xs:string"/>
<xs:element maxOccurs="1" minOccurs="0" name="SITE_K_FACTOR" type="xs:string"/>
<xs:element maxOccurs="1" minOccurs="0" name="SITE_AIR_DENSITY" type="xs:string"/>
<xs:element maxOccurs="1" minOccurs="0" name="SITE_WIND_SHEAR" type="xs:string"/>
<xs:element maxOccurs="1" minOccurs="0" name="SITE_STUDY_HEIGHT" type="xs:string"/>
<xs:element maxOccurs="1" minOccurs="0" name="SITE_CTI" type="xs:string"/>
<xs:element maxOccurs="1" minOccurs="0" name="PLANNED_COD" type="xs:string"/>
<xs:element maxOccurs="1" minOccurs="0" name="PROJECT_SCOPE" type="xs:string"/>
</xs:sequence>
</xs:complexType>
<xs:element name="ResponseData_oppty" type="tns:ResponseData_oppty"/>
<xs:complexType name="ResponseData_oppty">
<xs:sequence>
<xs:element maxOccurs="1" minOccurs="0" name="Internal_ID" type="xs:string"/>
<xs:element maxOccurs="1" minOccurs="0" name="StatusMessage" type="xs:string"/>
<xs:element maxOccurs="1" minOccurs="0" name="ERROR" type="xs:string"/>
</xs:sequence>
</xs:complexType>
</xs:schema>
<xs:schema xmlns:ns2="namespace.GERenewables.COM" elementFormDefault="qualified"targetNamespace="http://www.boomi.com/connector/wss" version="1.0">
<xs:import namespace="namespace.GERenewables.COM"/>
<xs:element name="getOpportunity" type="tns:getOpportunity"/>
<xs:complexType name="getOpportunity">
<xs:sequence>
<xs:element minOccurs="0" ref="ns2:Opportunity_Info"/>
</xs:sequence>
</xs:complexType>
<xs:element name="getOpportunityResponse" type="tns:getOpportunityResponse"/>
<xs:complexType name="getOpportunityResponse">
<xs:sequence>
<xs:element minOccurs="0" ref="ns2:ResponseData_oppty"/>
</xs:sequence>
</xs:complexType>
</xs:schema>
</wsdl:types>
<wsdl:message name="getOpportunity">
<wsdl:part element="tns:getOpportunity" name="parameters"/>
</wsdl:message>
<wsdl:message name="getOpportunityResponse">
<wsdl:part element="tns:getOpportunityResponse" name="parameters"/>
</wsdl:message>
<wsdl:portType name="WebServiceProviderPortType">
<wsdl:operation name="getOpportunity">
<wsdl:input message="tns:getOpportunity"/>
<wsdl:output message="tns:getOpportunityResponse"/>
</wsdl:operation>
</wsdl:portType>
<wsdl:binding name="WebServiceProviderPortBinding" type="tns:WebServiceProviderPortType">
<soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
<wsdl:operation name="getOpportunity">
<soap:operation soapAction="getOpportunity"/>
<wsdl:input>
<soap:body use="literal"/>
</wsdl:input>
<wsdl:output>
<soap:body use="literal"/>
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
<wsdl:service name="WebServiceProvider">
<wsdl:port binding="tns:WebServiceProviderPortBinding" name="WebServiceProviderPort">
<soap:address location="https://test.connect.boomi.com/ws/soap/GERW/HEROKU/processOpportunityDetails"/>
</wsdl:port>
</wsdl:service>
</wsdl:definitions>