In order to have a callout working from within a trigger, you need to make one more step: An @future-Call. That means, from within your trigger, you must collect all the IDs that were inserted/updated/deleted. Then, you must create a Class that implements a static void with the @future-Annotation (thus, this function is always executed asynchronously). Last, you call this function from the trigger and run your callout in the function.
trigger Attachment_AfterAll_Callout on Attachment (after insert, after update, after delete) {
Set<Id> ids = new Set<Id>();
//collect your ids here
//you might get away with just using ALL ids: ids = Trigger.newMap.keyset()
//call @future Function
WebserviceHandler.attachmentCall(ids);
}
In a class file:
public class WebserviceHandler {
@future(callout=true)
public static void attachmentCall(Set<Id> ids) {
//make your WS Callout here.
//Note, this is not guaranteed to run inline with the trigger,
//execution may be delayed!
}
}
Please note that there are limits on how many @future Calls you may have running, so you should batch the execution.