00001 /* 00002 * Copyright 2003-2004 The Apache Software Foundation. 00003 * 00004 * Licensed under the Apache License, Version 2.0 (the "License"); 00005 * you may not use this file except in compliance with the License. 00006 * You may obtain a copy of the License at 00007 * 00008 * http://www.apache.org/licenses/LICENSE-2.0 00009 * 00010 * Unless required by applicable law or agreed to in writing, software 00011 * distributed under the License is distributed on an "AS IS" BASIS, 00012 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 00013 * See the License for the specific language governing permissions and 00014 * limitations under the License. 00015 */ 00016 00017 #if !defined(AXIS_SOAPBODY_H__INCLUDED_) 00018 #define AXIS_SOAPBODY_H__INCLUDED_ 00019 00020 #include "SoapMethod.h" 00021 #include <axis/server/SoapFault.h> 00022 #include <axis/server/SoapEnvVersions.h> 00023 00024 class Attribute; 00025 00026 /* 00027 * @class SoapBody 00028 * @brief The SOAP Body of a SOAP Envelope according to SOAP 1.2 specification. 00029 * 00030 * The SOAP Body of a SOAP Envelope according to SOAP 1.2 specification. 00031 * 00032 * A SOAP body provides a mechanism for transmitting information to an ultimate SOAP receiver. 00033 * The Body element information item has: 00034 * - A [local name] of Body . 00035 * - A [namespace name] of "http://www.w3.org/2003/05/soap-envelope". 00036 * - Zero or more namespace qualified attribute information items in its [attributes] property. 00037 * - Zero or more namespace qualified element information items in its [children] property. 00038 * 00039 * The Body element information item MAY have any number of character information item children whose 00040 * character code is amongst the white space characters as defined by XML 1.0 [XML 1.0]. These are 00041 * considered significant. 00042 * 00043 * SOAP Body child Element: 00044 * All child element information items of the SOAP Body element information item: 00045 * - SHOULD have a [namespace name] property which has a value, that is the name of the element 00046 * SHOULD be namespace qualified. 00047 * - MAY have any number of character information item children. Child character information 00048 * items whose character code is amongst the white space characters as defined by XML 1.0 [XML 1.0] 00049 * are considered significant. 00050 * - MAY have any number of element information item children. Such element information items MAY be 00051 * namespace qualified. 00052 * - MAY have zero or more attribute information items in its [attributes] property. Among these MAY 00053 * be the following, which has special significance for SOAP processing: 00054 * - encodingStyle attribute information item 00055 * SOAP defines one particular direct child of the SOAP body, the SOAP fault, which is used for reporting 00056 * errors 00057 * 00058 * @author Roshan Weerasuriya (roshan@jkcs.slt.lk) 00059 */ 00060 00061 class SoapBody 00062 { 00063 friend class SoapSerializer; 00064 00065 private: 00066 int serializeAttributes(SoapSerializer& pSZ); 00067 list<Attribute*> m_attributes; 00068 SoapMethod *m_pSoapMethod; 00069 SoapFault *m_pSoapFault; 00070 /* string m_strBodySerialized; */ 00071 00072 public: 00073 00074 int initializeForTesting(); 00075 00076 void addAttribute(Attribute* attr); 00077 /* string& serialize(); */ 00078 int serialize(SoapSerializer& pSZ, SOAP_VERSION eSoapVersion); 00079 /* int serialize(string&, SOAP_VERSION eSoapVersion); */ 00080 void setSoapFault(SoapFault* ptrSoapFault); 00081 void setSoapMethod(SoapMethod* ptrSoapMethod); 00082 SoapBody(); 00083 virtual ~SoapBody(); 00084 00085 }; 00086 00087 #endif