hello all,
so i was updating the wsdl for my company's website and ended up getting this error whenever i tried to clear the object cache or access the salesforce api in any way:
( ! ) Fatal error: SOAP-ERROR: Parsing WSDL: Unexpected WSDL element
after some digging around i saw that the structure for the wsdl was this:
<?xml version="1.0" encoding="UTF-8"?>
<definitions xmlns="http://schemas.xmlsoap.org/wsdl/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:tns="urn:enterprise.soap.sforce.com" xmlns:fns="urn:fault.enterprise.soap.sforce.com" xmlns:ens="urn:sobject.enterprise.soap.sforce.com" targetNamespace="urn:enterprise.soap.sforce.com">
<types>
blahblahblah...
</types><style />
<!-- Header Message -->
<message name="Header">
blahblahblah...
</message>
more <message> elements...
<!-- Soap PortType -->
<portType name="Soap">
blahblahblah...
</portType>
<!-- Soap Binding -->
<binding name="SoapBinding" type="tns:Soap">
blahblahblah...
</binding>
<!-- Soap Service Endpoint -->
<service name="SforceService">
<documentation>Sforce SOAP API</documentation>
<port binding="tns:SoapBinding" name="Soap">
<soap:address location="https://login.salesforce.com/services/Soap/c/19.0/0DF70000000L3Zu" />
</port>
</service>
</definitions>
instead of this:
<definitions targetNamespace="urn:enterprise.soap.sforce.com"
xmlns="http://schemas.xmlsoap.org/wsdl/"
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:tns="urn:enterprise.soap.sforce.com"
xmlns:fns="urn:fault.enterprise.soap.sforce.com"
xmlns:ens="urn:sobject.enterprise.soap.sforce.com">
<types>
blahblahblah...
</types>
<!-- Header Message -->
<message name="Header">
blahblahblah...
</message>
more <message> elements...
<!-- Soap PortType -->
<portType name="Soap">
blahblahblah...
</portType>
<!-- Soap Binding -->
<binding name="SoapBinding" type="tns:Soap">
blahblahblah...
</binding>
<!-- Soap Service Endpoint -->
<service name="SforceService">
<documentation>Sforce SOAP API</documentation>
<port binding="tns:SoapBinding" name="Soap">
<soap:address location="https://www.salesforce.com/services/Soap/c/18.0/0DF70000000L3Z6"/>
</port>
</service>
</definitions>
In other words, aside from the different SOAP binding (host and version), there is this extra <styles/> element.
Has anyone else run into this with new wsdls? Does anyone know offhand where that element is coming from? And is this a bug in sf or a bug in the module?
As a quick workaround, removing that element seems to make the module work ok again.
Comments
Comment #1
aaronbaumanI think this may be an artifact of your browser.
I just generated Enterprise and Partner WSDLs, and neither contained a <style> element.
What browser are you using?
Comment #2
legion80 commentedI was using Chrome. I loaded the page that contains the wsdl, and saved it out to enterprise.wsdl. I am certain that I did not do any manual manipulation of the file.
It might have something to do with all the packages included in the wsdl, but I'm unsure.
Comment #3
legion80 commentedThis was what was shown in the Installed Package table:
Arrowpointe Maps - 1.6
Company Dashboards - 1.0
EchoSign - 1.6
HubSpot Integration - 1.4
Informatica Cloud - 1.2
Informatica Data Loader - 1.12
Salesforce for Google AdWords - 1.2
ZenKraft Shipmate - FedEx for Salesforce - 2.1
Comment #4
aaronbaumanI can't replicate this in Chrome, so i'm guessing it's one of those packages.
Any way you can disable the packages one by one to find out which is the culprit?
Comment #5
legion80 commentedunfortunately i don't know if i can.
if the wsdl is malformed, however, is that something that is outside the control of the module, or can the module be written to be more forgiving? or should it remain really strict? even if it is strict, it would be nice if drupal didn't crash completely. i just saw the warning on a blank browser, instead of an error message within the drupal page.
either way, this bug can be closed, since it looks like no one else has run into this issue.
Comment #6
aaronbaumanIt's conceivable that salesforce module could suck in the wsdl, try to parse out any invalid elements, and rewrite before constructing the SoapClient, but it doesn't seem like a very robust solution.
I think the best (and possibly painful) solution is going to be #723630: Move from Enterprise to Partner SOAP Client. AFAIK, the Partner WSDL is totally agnostic to enabled packages or other SF instance customizations... patches welcome =]
I'm gonna mark this postponed pending resolution of 723630
Comment #7
EvanDonovan commented@legion80: I think that the best thing to do, for now, is to avoid using Chrome to save the WSDL. It does weird things to XML output. I recommend Firefox.
Comment #8
kostajh commented