00001 /* 00002 * Copyright 2004-2005 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 /* 00018 * XSEC 00019 * 00020 * XSECSOAPRequestorSimple := (Very) Basic implementation of a SOAP 00021 * HTTP wrapper for testing the client code. 00022 * 00023 * 00024 * $Id: XSECSOAPRequestorSimple.hpp,v 1.4 2005/02/03 13:53:54 milan Exp $ 00025 * 00026 */ 00027 00028 #ifndef XSECSOAPREQUESTORSIMPLE_INCLUDE 00029 #define XSECSOAPREQUESTORSIMPLE_INCLUDE 00030 00031 #include <xsec/framework/XSECDefs.hpp> 00032 #include <xsec/utils/XSECSOAPRequestor.hpp> 00033 00034 #include <xercesc/util/XMLUri.hpp> 00035 00036 XSEC_DECLARE_XERCES_CLASS(DOMDocument); 00037 00041 /*\@{*/ 00042 00055 class DSIG_EXPORT XSECSOAPRequestorSimple : public XSECSOAPRequestor { 00056 00057 public : 00058 00063 enum envelopeType { 00064 00065 ENVELOPE_NONE, 00066 ENVELOPE_SOAP11, 00067 ENVELOPE_SOAP12 00069 }; 00070 00073 00084 XSECSOAPRequestorSimple(const XMLCh * uri); 00085 virtual ~XSECSOAPRequestorSimple(); 00086 00088 00091 00105 virtual XERCES_CPP_NAMESPACE_QUALIFIER DOMDocument * 00106 doRequest(XERCES_CPP_NAMESPACE_QUALIFIER DOMDocument * request); 00107 00109 00112 00124 void setEnvelopeType(envelopeType et); 00125 00126 00127 private: 00128 00129 char * wrapAndSerialise(XERCES_CPP_NAMESPACE_QUALIFIER DOMDocument * request); 00130 XERCES_CPP_NAMESPACE_QUALIFIER DOMDocument * 00131 parseAndUnwrap(const char * buf, unsigned int len); 00132 00133 XERCES_CPP_NAMESPACE_QUALIFIER XMLUri 00134 m_uri; 00135 00136 envelopeType m_envelopeType; 00137 00138 }; 00139 00140 00141 #endif /* XSECSOAPREQUESTORSIMPLE_INCLUDE */ 00142