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
Abhijit ShrikhandeAbhijit Shrikhande 

Unable to call a public facing webservice

I am trying to call a public facing webservice. I am able to call this webservice using SoapUI and it returns me the output I seek.
I downloaded the wsdl and generated a wsdl class. After generating the wsdl class, I tried to invoke this in an Execute Anonymous block of code.
The webservice is hosted at:
The block of code I used to call the service is:

peopleaskOozIeSoap.PeopleAskServiceSoap mypass = new peopleaskOozIeSoap.PeopleAskServiceSoap();
peopleaskOozIeSoap.ArrayOfstring hoos = new peopleaskOozIeSoap.ArrayOfstring();
hoos =  mypass.GetQuestionsAbout('lauren bacall');

The error I am facing is:
FATAL_ERROR|System.CalloutException: Web service callout failed: Unexpected element. Parser was expecting element '' but found ':Questions'

What am I doing wrong? How can I call this webservice? 
Did you add this url under "Remove Site Settings" to allow for callouts ?
Abhijit ShrikhandeAbhijit Shrikhande
You mean "remote site settings". Yes I have added the URL to that list of remote sites.
James LoghryJames Loghry
Sounds like Wsdl 2 Apex didn't quite generate your Apex correctly.  Either that or you're WSDL is wonky.  Try modifying your PeopleaskOozIeSoap class by modifying your ArrayOfString element's namespace, changing it from "" to ":Questions" to see if that shows anything different.  In other words, you may have to play around a bit with your Wsdl 2 Apex class to get your callout working.
Abhijit ShrikhandeAbhijit Shrikhande
It looks like this wsdl is a problematic one. The only client I know which is able to call it is soap-UI. I also faced a similar issue in my .NEt application and microsoft concierge support services could not resolve it. I was able to use the http class to invoke the web service.