/* File: WSMethodInvocation.h Contains: WebServicesCore Method Invocation API Version: QuickTime 7.3 Copyright: (c) 2007 (c) 2002 by Apple Computer, Inc., all rights reserved Bugs?: For bug reports, consult the following page on the World Wide Web: http://developer.apple.com/bugreporter/ */ #ifndef __MIXEDMODE__ #include "MixedMode.h" #endif #ifndef __CFSTRING__ #include "CFString.h" #endif #ifndef __CFURL__ #include "CFURL.h" #endif #ifndef __CFRUNLOOP__ #include "CFRunLoop.h" #endif #ifndef __CFXMLPARSER__ #include "CFXMLParser.h" #endif #ifndef __CFXMLNODE__ #include "CFXMLNode.h" #endif /* WebServicesCore */ /* WebServicesCore error codes */ #if PRAGMA_ONCE #pragma once #endif #ifdef __cplusplus extern "C" { #endif #if PRAGMA_IMPORT #pragma import on #endif #if PRAGMA_STRUCT_ALIGN #pragma options align=mac68k #elif PRAGMA_STRUCT_PACKPUSH #pragma pack(push, 2) #elif PRAGMA_STRUCT_PACK #pragma pack(2) #endif #if PRAGMA_ENUM_ALWAYSINT #if defined(__fourbyteints__) && !__fourbyteints__ #define __WSMETHODINVOCATION__RESTORE_TWOBYTEINTS #pragma fourbyteints on #endif #pragma enumsalwaysint on #elif PRAGMA_ENUM_OPTIONS #pragma option enum=int #elif PRAGMA_ENUM_PACK #if __option(pack_enums) #define __WSMETHODINVOCATION__RESTORE_PACKED_ENUMS #pragma options(!pack_enums) #endif #endif enum { errWSInternalError = -65793L, /* An internal framework error */ errWSTransportError = -65794L, /* A network error occured */ errWSParseError = -65795L, /* The server response wasn't valid XML */ errWSTimeoutError = -65796L /* The invocation timed out */ }; /* * WSTypeID * * Discussion: * Internally, WebServicesCore uses the following enumeration when * serializing between CoreFoundation and XML types. Because CFTypes * are defined at runtime, it isn't always possible to produce a * static mapping to a particular CFTypeRef. This enum and * associated API allows for static determination of the expected * serialization. */ enum WSTypeID { /* * No mapping is known for this type */ eWSUnknownType = 0, /* * CFNullRef */ eWSNullType = 1, /* * CFBooleanRef */ eWSBooleanType = 2, /* * CFNumberRef for 8, 16, 32 bit integers */ eWSIntegerType = 3, /* * CFNumberRef for long double real numbers */ eWSDoubleType = 4, /* * CFStringRef */ eWSStringType = 5, /* * CFDateRef */ eWSDateType = 6, /* * CFDataRef */ eWSDataType = 7, /* * CFArrayRef */ eWSArrayType = 8, /* * CFDictionaryRef */ eWSDictionaryType = 9 }; typedef enum WSTypeID WSTypeID; /* * WSGetWSTypeIDFromCFType() * * Discussion: * Returns the WSTypeID associated with CFTypeRef. There is not a * one to one mapping between CFTypeID and WSTypesID therefore an * actual instance of a CFType must be passed. * * Parameters: * * ref: * a CFTypeRef object * * Result: * the WSTypeID used in serializing the object. If no WSTypeID * matches, eWSUnknownType is returned. * * Availability: * Non-Carbon CFM: not available * CarbonLib: not available * Mac OS X: in version 10.2 and later */ EXTERN_API_C( WSTypeID ) WSGetWSTypeIDFromCFType(CFTypeRef ref); /* * WSGetCFTypeIDFromWSTypeID() * * Discussion: * Returns the CFTypeID that is associated with a given WSTypeID. * CFTypeIDs are only valid during a particular instance of a * process and should not be used as static values. * * Parameters: * * typeID: * a WSTypeID constant * * Result: * a CFTypeID, or 0 if not found * * Availability: * Non-Carbon CFM: not available * CarbonLib: not available * Mac OS X: in version 10.2 and later */ EXTERN_API_C( CFTypeID ) WSGetCFTypeIDFromWSTypeID(WSTypeID typeID); typedef CALLBACK_API( void *, WSClientContextRetainCallBackProcPtr )(void * info); typedef CALLBACK_API( void , WSClientContextReleaseCallBackProcPtr )(void * info); typedef CALLBACK_API( CFStringRef , WSClientContextCopyDescriptionCallBackProcPtr )(void * info); /* * WSClientContext * * Discussion: * Several calls in WebServicesCore take a callback with an optional * context pointer. The context is copied and the info pointer * retained. When the callback is made, the info pointer is passed * to the callback. */ struct WSClientContext { /* * set to zero (0) */ CFIndex version; /* * info pointer to be passed to the callback */ void * info; /* * callback made on the info pointer. This field may be NULL. */ WSClientContextRetainCallBackProcPtr retain; /* * callback made on the info pointer. This field may be NULL. */ WSClientContextReleaseCallBackProcPtr release; /* * callback made on the info pointer. This field may be NULL. */ WSClientContextCopyDescriptionCallBackProcPtr copyDescription; }; typedef struct WSClientContext WSClientContext; /* Web Service protocol types. These constant strings specify the type of web service method invocation created. These are passed to WSMethodInvocationCreate. For information on these service types, see: XML-RPC: SOAP 1.1: SOAP 1.2: */ extern CFStringRef kWSXMLRPCProtocol; extern CFStringRef kWSSOAP1999Protocol; extern CFStringRef kWSSOAP2001Protocol; /* Dictionary entry if the invocation result is not a fault. This is always available in method responses, although for SOAP messages, it may be more correctly to query the result dictionary for the specific field you're interested in. What this really means is that the dictionary returned by the invocation may contain more than one value, wherein the result data is duplicated several times. If you don't know what to ask for to dump the reply, you can ask for this key. If you do know what you want, you should request that field expliclty. You can also specify the name of the reply parameter in the invocation using kWSMethodInvocationResultParameterName. This will add an alias for the given name to the result dictionary such that kWSMethodInvocationResult will always return the correct parameter. (This won't work for multi-value returns, however.) */ extern CFStringRef kWSMethodInvocationResult; /* Dictionary entries if the result is a fault */ extern CFStringRef kWSFaultString; /* a CFString */ extern CFStringRef kWSFaultCode; /* a CFNumber */ extern CFStringRef kWSFaultExtra; /* a CFString or CFDictionary, or NULL */ /* If the result is a fault, and if the value of kWSFaultString in the reply dictionary is kWSNetworkStreamFaultString, then kWSFaultExtra will be a dictionary indicating the network error and kWSFaultCode is ignored in this case. See