Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unexpected element. Parser was expecting element 'http://schemas.xmlsoap.org/soap/envelope/:Fault' but found 'urn:partner.soap.sforce.com:describeSObjectResponse' #298

Open
rusinm opened this issue Apr 28, 2022 · 2 comments

Comments

@rusinm
Copy link

rusinm commented Apr 28, 2022

Hi team,

I experience an issue when executing API calls. The client throws a following error:

Unexpected element. Parser was expecting element 'http://schemas.xmlsoap.org/soap/envelope/:Fault' but found 'urn:partner.soap.sforce.com:describeSObjectResponse'\nCaused by: org.mule.runtime.api.connection.ConnectionException: Unexpected element. Parser was expecting element 'http://schemas.xmlsoap.org/soap/envelope/:Fault' but found 'urn:partner.soap.sforce.com:describeSObjectResponse'\nCaused by: com.sforce.ws.ConnectionException: Unexpected element. Parser was expecting element 'http://schemas.xmlsoap.org/soap/envelope/:Fault' but found 'urn:partner.soap.sforce.com:describeSObjectResponse'\n#011at com.sforce.ws.bind.TypeMapper.verifyTag(TypeMapper.java:461) ~[force-wsc-53.1.0.jar:?]\n#011at com.sforce.ws.transport.SoapConnection.createException(SoapConnection.java:203) ~[force-wsc-53.1.0.jar:?]\n#011at com.sforce.ws.transport.SoapConnection.receive(SoapConnection.java:163) ~[force-wsc-53.1.0.jar:?]\n#011at com.sforce.ws.transport.SoapConnection.send(SoapConnection.java:108) ~[force-wsc-53.1.0.jar:?]\n#011at com.sforce.soap.partner.PartnerConnection.describeSObject(PartnerConnection.java:1491) ~[force-partner-api-53.1.0.jar:?]\n#011at

I believe all transport implementations evaluate the responses as failed when the status code >= 400:

https://github.com/forcedotcom/wsc/blob/master/src/main/java/com/sforce/ws/transport/JdkHttpTransport.java#L219

I inspected the code and came to a conclusion that this error is caused by the API returning HTTP status code >= 400, but the payload is not based on the Fault structure. Does it make sense?

Thanks for any feedback.

@reubencornel
Copy link
Contributor

Hey @rusinm what entity are you doing the describe on?

@rusinm
Copy link
Author

rusinm commented Apr 28, 2022

hi @reubencornel, it's Opportunity.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants