1

I am facing issue while invoking a webservice call. Request is getting processed properly at other system end but since its an async call I get back response with empty body.

Problem is this response is giving me an exception as

System.CalloutException: Web service callout failed: unknown tag type :1 at END_DOCUMENT seen ...... @1:112

My Invoke method is

WebServiceCallout.invoke(
              this,
              request_x,
              response_map_x,
              new String[]{endpoint_x,
              'http://xxx.com/xi/WebService/soap1.1',
              'MessageLink', 
              'receipt_msg', 
              'http://schemas.xmlsoap.org/soap/envelope/',
              'Body',              
              'schemasXmlsoapOrgSoapEnvelope.body_element'} 
            );

Does some one have any idea , how to correct this?

  • It is quite common for a remote service to send back an HTML error page rather than the expected XML response format which then leads to response parsing errors. You should be able to see what is coming back in the response in the debug log. – Keith C Jul 30 '14 at 8:31
  • @KeithC No, I am not able to see it. The problem is that exception is thrown in the invoke method itself. I wanted to ask what is the best way to handle such issue or avoid it. – user3458117 Jul 30 '14 at 8:38
  • 1
    The invoke converts the Apex objects into XML, makes a network call to the remote service and attempts to turn the returned (assumed XML) data back into Apex objects. If any of these steps go wrong your call to WebServiceCallout.invoke will throw an exception. So you should make sure your logging is properly configured and examine the CALLOUT_REQUEST and CALLOUT_RESPONSE entries. – Keith C Jul 30 '14 at 9:27
  • Can you expand the example code in the question out to include the entire message (especially the response_x and response_map_x). Better yet, can you share a link to the WSDL. It will be easier to examine the required SOAP Request and Response when taken as a whole. – Daniel Ballinger Jul 30 '14 at 10:06

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.