2

Im facing an issue when I try to import my WSDL into Salesforce and generate APEX code from this one. When I add a targetnamespace to my second schema in the following file, which is required in Salesforce, 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!

Your Answer

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

Browse other questions tagged or ask your own question.