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
jdurdenjdurden 

Error: "System.CalloutException: IO Exception: no protocol:"

Greetings,

First of all, I'm very new to Apex and Salesforce as a whole, but I've been programming professionally for almost a decade. I'm trying to learn the ropes here and it seems that finding documentation on very specific problems can be challenging. Thanks in advance for any help you can give.

 

I have spent the last several hours attempting to find a solution to a problem I'm having. I recently imported a WSDL provided to me by another team in my company and, while trying to use some of the Apex methods provided by that process, I'm receiving the following error (exactly as it reads): "System.CalloutException: IO Exception: no protocol:". This exception is thrown at this line (domain censored):

 

WebServiceCallout.invoke(
	this,
	request_x,
	response_map_x,
	new String[]{endpoint_x,
	'',
	'http://integ.xxxxxxxxxx.com/public/interfaces/CustomerAndService/CustomerAndServiceDetails.xsd',
	'CustomerDetailsRequest',
	'http://integ.xxxxxxxxxx.com/public/interfaces/CustomerAndService/CustomerAndServiceDetails.xsd',
	'CustomerDetailsResponse',
	'EAICustomerAndServiceDetails.CustomerDetailsResponse'}
);

 

I notice a couple of things immediately here. First, of course, is that the error says "no protocol". This leads me to believe that I should be providing a protocol to the WebServiceCallout.invoke() method. But in all the examples I'm seeing online, no one appears to be doing that. Or, at the very least, they're not doing it with an argument at the time the method is called.

 

The second thing I noticed is that there is a ":" at the end of "no protocol:". This leads me to believe that it may be trying to list what protocol it thinks it may have but there's nothing there so I'm just seeing a blank string after the ":". This is all best-guess though.

 

I have many questions but I think they can all be answered by asking: where do I assign the protocol? It seems that it should be able to know the protocol since I'm providing it with the endpoint address (assigned to endpoint_x near the top of the class). In this case, HTTPS is the protocol in the endpoint.

 

What am I doing wrong here?

 

Thanks for any help you can provide!

- John

 

Edit: I attempted to find a way to break the hyperlinks in the code I provided so they're not clickable. I couldn't find a way to do that without invalidating the data further and making it confusing to a reader. My apologies.

Best Answer chosen by Admin (Salesforce Developers) 
jdurdenjdurden

Actually, a teammate of mine and I were able to figure it out. This was completely a "newb" mistake. The solution here was that when I created an instance of the class created by the WSDL import which does the WebServiceCallout, I had dummied out the endpoint_x property and had forgotten to fill it with the proper endpoint!

 

So, in short, problem solved... Even if somewhat embarassingly.