• Mehmet
  • NEWBIE
  • 0 Points
  • Member since 2012
  • Nefos GmbH

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 1
    Questions
  • 2
    Replies
I get this error when I try to call a webservice through a class generated from WSDL by WSDL2Apex. The strange thing is:

1. When I send the request to http://requestb.in, I can see that the request arrives properly. This is the message as seen in requestb.in:
<?xml version="1.0" encoding="UTF-8"?>
<env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
	<env:Header />
	<env:Body>
		<PingRequest xmlns="http://www.abacus.ch/abaconnect/2007.10/core/AbaConnectTypes">
			<Echo>Hello Abacus</Echo>
		</PingRequest>
	</env:Body>
</env:Envelope>
2. When I send the exact same message to the proper endpoint via SoapUI, I get a proper response:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
   <soapenv:Body>
      <act:PingResponse xmlns:act="http://www.abacus.ch/abaconnect/2007.10/core/AbaConnectTypes">
         <act:Echo>hello this is the AbaConnect Webservice Server! Your message was: Hello Abacus( Ping-Nr: 1)</act:Echo>
      </act:PingResponse>
   </soapenv:Body>
</soapenv:Envelope>
3. But when I use Apex to send the request, I get the error message in the log:
19:08:10.249 (249851430)|SYSTEM_METHOD_ENTRY|[1846]|WebServiceCallout.invoke(APEX_OBJECT, APEX_OBJECT, MAP, LIST)
19:08:10.253 (253470025)|CALLOUT_REQUEST|[1846]|PingType:[Echo=Hello Abacus, Echo_type_info=(Echo, http://www.abacus.ch/abaconnect/2007.10/core/AbaConnectTypes, null, 1, 1, false), apex_schema_type_info=(http://www.abacus.ch/abaconnect/2007.10/core/AbaConnectTypes, true, false), field_order_type_info=(Echo)]::SFDC_STACK_DEPTH=1 SOAPAction="ping" User-Agent=SFDC-Callout/30.0 Accept=text/xml Content-Type=text/xml; charset=UTF-8 
19:08:10.344 (344790775)|EXCEPTION_THROWN|[1846]|System.CalloutException: Web service callout failed: Failed to get next element
19:08:10.344 (344950829)|HEAP_ALLOCATE|[1846]|Bytes:58
19:08:10.344 (344974228)|SYSTEM_METHOD_EXIT|[1846]|WebServiceCallout.invoke(APEX_OBJECT, APEX_OBJECT, MAP, LIST)
I searched and googled quite a lot, but couldn't find any solution so far. Some people have the same error, but no solution suggested that would help me.

Any help will be greatly appreciated.

Cheers

Mehmet




I get this error when I try to call a webservice through a class generated from WSDL by WSDL2Apex. The strange thing is:

1. When I send the request to http://requestb.in, I can see that the request arrives properly. This is the message as seen in requestb.in:
<?xml version="1.0" encoding="UTF-8"?>
<env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
	<env:Header />
	<env:Body>
		<PingRequest xmlns="http://www.abacus.ch/abaconnect/2007.10/core/AbaConnectTypes">
			<Echo>Hello Abacus</Echo>
		</PingRequest>
	</env:Body>
</env:Envelope>
2. When I send the exact same message to the proper endpoint via SoapUI, I get a proper response:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
   <soapenv:Body>
      <act:PingResponse xmlns:act="http://www.abacus.ch/abaconnect/2007.10/core/AbaConnectTypes">
         <act:Echo>hello this is the AbaConnect Webservice Server! Your message was: Hello Abacus( Ping-Nr: 1)</act:Echo>
      </act:PingResponse>
   </soapenv:Body>
</soapenv:Envelope>
3. But when I use Apex to send the request, I get the error message in the log:
19:08:10.249 (249851430)|SYSTEM_METHOD_ENTRY|[1846]|WebServiceCallout.invoke(APEX_OBJECT, APEX_OBJECT, MAP, LIST)
19:08:10.253 (253470025)|CALLOUT_REQUEST|[1846]|PingType:[Echo=Hello Abacus, Echo_type_info=(Echo, http://www.abacus.ch/abaconnect/2007.10/core/AbaConnectTypes, null, 1, 1, false), apex_schema_type_info=(http://www.abacus.ch/abaconnect/2007.10/core/AbaConnectTypes, true, false), field_order_type_info=(Echo)]::SFDC_STACK_DEPTH=1 SOAPAction="ping" User-Agent=SFDC-Callout/30.0 Accept=text/xml Content-Type=text/xml; charset=UTF-8 
19:08:10.344 (344790775)|EXCEPTION_THROWN|[1846]|System.CalloutException: Web service callout failed: Failed to get next element
19:08:10.344 (344950829)|HEAP_ALLOCATE|[1846]|Bytes:58
19:08:10.344 (344974228)|SYSTEM_METHOD_EXIT|[1846]|WebServiceCallout.invoke(APEX_OBJECT, APEX_OBJECT, MAP, LIST)
I searched and googled quite a lot, but couldn't find any solution so far. Some people have the same error, but no solution suggested that would help me.

Any help will be greatly appreciated.

Cheers

Mehmet




I am having trouble inserting a list of chatter feed items of type 'ContentPost'. These feed items are being dynamically created for a list of contacts/campaign members (post.ParentId = 'contact id goes here') associated to a campaign; as well as the campaign itself. While I am iterating over the list of contacts I am also creating an attachment for each of them then
associating this attachment to the feed item. Both Attachments and Feed Items are added to separate lists then post for loop are inserted into the database.

 

I am able to successfully insert the chatter feed items (as text post posts, not content) if I don't associated the attachments, however when I associate the attachment body to the content data field of the feed item I get the following error:

 

Insert failed. First exception on row 0; first error: INVALID_ID_FIELD, You do not have the level of access necessary to perform the operation you requested. Please contact the owner of the record or your administrator if access is necessary.: []

 

I am running this as a system administrator on our dev sandbox, so I'm not sure what is causing this insufficient privileges error. I would appreciate any help on this, and if needed I can provide a more technical description with code snippets of the logic.