Pregunta

When I try to import the following WSDL into SalesForce and generate APEX classes from it, I get the error "Unable to find element for {http://tempuri.org/}Account"

<?xml version="1.0" encoding="UTF-8"?>
<wsdl:definitions xmlns:http="http://schemas.xmlsoap.org/wsdl/http/" xmlns:nspf1="http://tempuri.org/" xmlns:nspf2="http://tempuri.org/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tns="urn:ipostep_vP.0010000109.in_WCSX_com.sap.b1i.vplatform.runtime_INB_WS_CALL_SYNC_XPT_INB_WS_CALL_SYNC_XPT.ipo_proc" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="ipostep_vP.0010000109.in_WCSX_com.sap.b1i.vplatform.runtime_INB_WS_CALL_SYNC_XPT_INB_WS_CALL_SYNC_XPT.ipo_proc" targetNamespace="urn:ipostep_vP.0010000109.in_WCSX_com.sap.b1i.vplatform.runtime_INB_WS_CALL_SYNC_XPT_INB_WS_CALL_SYNC_XPT.ipo_proc">
<wsdl:types>
<xs:schema xmlns:ns0="http://tempuri.org/" xmlns:xs="http://www.w3.org/2001/XMLSchema" targetNamespace="http://tempuri.org/" elementFormDefault="qualified" attributeFormDefault="unqualified">
<xs:element name="Account" type="ns0:AccountType">
<xs:annotation>
<xs:documentation>Root element for the document</xs:documentation>
</xs:annotation>
</xs:element>
<xs:complexType name="AccountType">
<xs:annotation>
<xs:documentation>Automatically generated complex type comprising the whole document for the purpose of schema re-use</xs:documentation>
</xs:annotation>
<xs:sequence>
<xs:element name="Name" type="xs:string" form="qualified"/>
<xs:element name="SfIdcId" type="xs:string" form="qualified"/>
<xs:element name="Phone" type="xs:string" form="qualified"/>
<xs:element name="Fax" type="xs:string" form="qualified"/>
<xs:element name="Website" type="xs:string" form="qualified"/>
<xs:element name="Description" type="xs:string" form="qualified"/>
<xs:element name="CurrencyIsoCode" type="xs:string" form="qualified"/>
<xs:element name="Credit_Limit__c" type="xs:string" form="qualified"/>
<xs:element name="SAP_Salesperson__c" type="xs:string" form="qualified"/>
<xs:element name="External_Salesperson__c" type="xs:string" form="qualified"/>
<xs:element name="Customer_Territory__c" type="xs:string" form="qualified"/>
<xs:element name="BillingStreet" type="xs:string" form="qualified"/>
<xs:element name="BillingCity" type="xs:string" form="qualified"/>
<xs:element name="BillingState" type="xs:string" form="qualified"/>
<xs:element name="BillingPostalCode" type="xs:string" form="qualified"/>
<xs:element name="BillingCountry" type="xs:string" form="qualified"/>
<xs:element name="ShippingStreet" type="xs:string" form="qualified"/>
<xs:element name="ShippingCity" type="xs:string" form="qualified"/>
<xs:element name="ShippingState" type="xs:string" form="qualified"/>
<xs:element name="ShippingPostalCode" type="xs:string" form="qualified"/>
<xs:element name="ShippingCountry" type="xs:string" form="qualified"/>
<xs:element name="email" type="xs:string" form="qualified"/>
<xs:element name="Industry" type="xs:string" form="qualified"/>
<xs:element name="PriceList" type="xs:string" form="qualified"/>
</xs:sequence>
</xs:complexType>
</xs:schema>
<xs:schema xmlns:ns0="http://tempuri.org/" xmlns:xs="http://www.w3.org/2001/XMLSchema" targetNamespace="http://tempuri.org/" elementFormDefault="qualified" attributeFormDefault="unqualified">
<xs:element name="AccountResponse" type="ns0:AccountResponseType">
<xs:annotation>
<xs:documentation>Root element for the document</xs:documentation>
</xs:annotation>
</xs:element>
<xs:complexType name="AccountResponseType">
<xs:annotation>
<xs:documentation>Automatically generated complex type comprising the whole document for the purpose of schema re-use</xs:documentation>
</xs:annotation>
<xs:sequence>
<xs:element name="AccountResult" type="xs:string" form="qualified"/>
</xs:sequence>
</xs:complexType>
</xs:schema>
</wsdl:types>
<wsdl:message name="Account">
<wsdl:part name="body" element="nspf1:Account"/>
</wsdl:message>
<wsdl:message name="AccountResponse">
<wsdl:part name="body" element="nspf2:AccountResponse"/>
</wsdl:message>
<wsdl:portType name="ipostep_vP.0010000109.in_WCSX_com.sap.b1i.vplatform.runtime_INB_WS_CALL_SYNC_XPT_INB_WS_CALL_SYNC_XPT.ipo_proc">
<wsdl:operation name="UA.sfdcIncoming">
<wsdl:input message="tns:Account"/>
<wsdl:output message="tns:AccountResponse"/>
</wsdl:operation>
</wsdl:portType>
<wsdl:binding name="ipostep_vP.0010000109.in_WCSX_com.sap.b1i.vplatform.runtime_INB_WS_CALL_SYNC_XPT_INB_WS_CALL_SYNC_XPT.ipo_proc_SoapBinding" type="tns:ipostep_vP.0010000109.in_WCSX_com.sap.b1i.vplatform.runtime_INB_WS_CALL_SYNC_XPT_INB_WS_CALL_SYNC_XPT.ipo_proc">
<soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
<wsdl:operation name="UA.sfdcIncoming">
<soap:operation soapAction=""/>
<wsdl:input>
<soap:body use="literal"/>
</wsdl:input>
<wsdl:output>
<soap:body use="literal"/>
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
<wsdl:service name="ipostep_vP.0010000109.in_WCSX_com.sap.b1i.vplatform.runtime_INB_WS_CALL_SYNC_XPT_INB_WS_CALL_SYNC_XPT.ipo_proc_Service">
<wsdl:port name="ipostep_vP.0010000109.in_WCSX_com.sap.b1i.vplatform.runtime_INB_WS_CALL_SYNC_XPT_INB_WS_CALL_SYNC_XPT.ipo_proc_SoapBinding_HTTP" binding="tns:ipostep_vP.0010000109.in_WCSX_com.sap.b1i.vplatform.runtime_INB_WS_CALL_SYNC_XPT_INB_WS_CALL_SYNC_XPT.ipo_proc_SoapBinding">
<soap:address location="http://xxx.xxx.com:9080/B1iXcellerator/exec/soap/vP.0010000109.in_WCSX/com.sap.b1i.vplatform.runtime/INB_WS_CALL_SYNC_XPT/INB_WS_CALL_SYNC_XPT.ipo/proc"/>
</wsdl:port>
<wsdl:port name="ipostep_vP.0010000109.in_WCSX_com.sap.b1i.vplatform.runtime_INB_WS_CALL_SYNC_XPT_INB_WS_CALL_SYNC_XPT.ipo_proc_SoapBinding_HTTPS" binding="tns:ipostep_vP.0010000109.in_WCSX_com.sap.b1i.vplatform.runtime_INB_WS_CALL_SYNC_XPT_INB_WS_CALL_SYNC_XPT.ipo_proc_SoapBinding">
<soap:address location="https://xxx.xxx.com:943/B1iXcellerator/exec/soap/vP.0010000109.in_WCSX/com.sap.b1i.vplatform.runtime/INB_WS_CALL_SYNC_XPT/INB_WS_CALL_SYNC_XPT.ipo/proc"/>
</wsdl:port>
</wsdl:service>
</wsdl:definitions>

This WSDL imports fine into Visual Studio when I generate a service reference from it and I can query the associated soap just fine.

¿Fue útil?

Solución

There are 2 Schemas in the Wsdl and both have the same targetNamespace. Try to comment out the seperation of Schemas and it will work...

<!--</xs:schema>
<xs:schema xmlns:ns0="http://tempuri.org/" xmlns:xs="http://www.w3.org/2001/XMLSchema"     targetNamespace="http://tempuri.org/" elementFormDefault="qualified" attributeFormDefault="unqualified">-->
Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top