You need to sign in to do that
Don't have an account?
TariqKech
Error 411 - Callout Web Service
Hi,
I have a problem with an web service they hosted into IIS server.
Sometimes, IIS server reject my HTTP request because the header are not conform :
"Error 411 - Missed parameter content-lenght".
Can you help me ?
Best regards.
Call WS :
GetInfosClient.ClientResponse_element res = new GetInfosClient.ClientResponse_element();
GetInfosClient.BasicHttpBinding_ITwoWayAsync tb = new GetInfosClient.BasicHttpBinding_ITwoWayAsync();
res = tb.GetInfosClient('1234566','ORCC');
Sample Result KO :
Error 411 - Lenght requiered.
You have a typo.
Content-Length is a standard param in a HTTP request.
You have written Content-Lenght twice in your post.
Is the typo in the error or in your post?
Hello,
Execuse me, this is a typo in my post.
In the Log file of IIS, the error is "Content-Length missed".
Thank you for your help.
Wierd. I thought that was sent by default. Can you show the code for creating the http response?
I have generate the class of the webservice with the WSDL provided by Biztalk (ETL).
This is the call method :
// Result Structure
GetInfosClient.ClientResponse_element res = new GetInfosClient.ClientResponse_element();
// WebService
GetInfosClient.BasicHttpBinding_ITwoWayAsync tb = new GetInfosClient.BasicHttpBinding_ITwoWayAsync();
// Invoke WebService
res = tb.GetInfosClient('1234566','ORCC');
Thanks.
OK not sure what that means. I do it like this:
HttpRequest req = new HttpRequest();
HttpResponse res = new HttpResponse();
Http http = new Http();
req.setEndpoint('http://your-url');
req.setMethod('POST');
req.setBody('Body=stuff');
req.setCompressed(true); // otherwise we hit a limit of 32000
req.setHeader('extra-header-name', 'extra-header-value');
try {
res = http.send(req);
} catch(System.CalloutException e) {
System.debug('Callout error: '+ e);
}
We have don't invoke the Webservice en HTTP but with the WSDL.
10% of the callout didn't work with this webservice (ETL : Biztalk + Server : IIS).
This is the call generated with the WSDL :
I'm guessing now.
Do you have
@future (callout=true)
at the start of the class which calls
GetInfosClient.ClientResponse_element res = new GetInfosClient.ClientResponse_element();
GetInfosClient.BasicHttpBinding_ITwoWayAsync tb = new GetInfosClient.BasicHttpBinding_ITwoWayAsync();
res = tb.GetInfosClient('1234566','ORCC');
Not really !
This Webservice is called on a VisualForce Controller.
I have posted just a sample of the callout that use for my test in the developper consol.
I used a future method for my callout :
I thought you could not use callouts on a VF controller. I have a callout which I could not use from a controller so I had to move it to a trigger.