📄 echo_proxy.cpp
字号:
/*
Created by eSoap Code Generator for C++, >>> DEMO <<< Version - 1.08
**** DO NOT EDIT THIS FILE. *****
Time: Sun Sep 09 09:37:32 2001
**** CODE CREATED USING AN UNREGISTERED VERSION OF ESOAPCG.
Please, after the initial testing, you *MUST* buy a
copy of this application to continue using it.
* Limits of this version:
+ 5 functions per interface
+ 5 User defined types( Complex Types )
*/
#include "soap_envelope.h"
#include "Echo_proxy.h"
/* must be the last include */
#ifdef MEMWATCH
#include <memwatch.h>
#endif
namespace echo {
static const char *__client_code =
"SOAP-CODE:Client";
static const char *__client_param =
"Error: parsing parameter.";
const char *Echo_Proxy::NS_URI = "http://tempuri.com/";
const char *Echo_Proxy::SOAP_ACTION = "http://tempuri.com/";
Echo_Proxy::Echo_Proxy( const char *url, unsigned long timeout )
{
__ht = esoap::TransportFactory::create( url, esoap::TransportFactory::HTTP );
__ht->setTimeout( timeout );
}
Echo_Proxy::~Echo_Proxy()
{
delete __ht;
}
esoap_Vector< int >* Echo_Proxy::echo(
const esoap_Vector< int > & i )
{
esoap::Envelope __env;
esoap::Method *__m = __env.setMethod( "m:echo", NS_URI );
{
esoap::Parameter *__a = new esoap::Array( "i" );
__a->setType( "xsd:int" );
for( size_t __i = 0; __i < (size_t)i.size(); __i++ )
{
__a->addInteger( "item", i[ __i ] );
}
__m->addParameter( __a );
}
esoap::Envelope *__in = __ht->call( __env, SOAP_ACTION );
if( !__in->success() )
{
esoap::SoapException __ex( __in->getFault() );
delete __in;
throw __ex;
}
esoap::Method *__resp = __in->getMethod();
if( !__resp )
{
delete __in;
throw esoap::SoapException( __client_code, __client_param );
}
{ esoap::Array *__a;
if( __resp->getParameterCount() == 1 )
__a = ( esoap::Array * )__in->getRealParameter( __resp->getParameter( 0 ) );
else
__a = ( esoap::Array * )__in->getRealParameter( __resp->getParameter( "return" ) );
if( !__a )
{
delete __in;
throw esoap::SoapException( __client_code, __client_param );
}
esoap_Vector< int > *__o_r = new esoap_Vector< int >;
for( size_t __i = 0; __i < __a->getParameterCount(); __i++ )
{
esoap::Parameter *__p = __in->getRealParameter( __a->getParameter( __i ) );
if( !__p )
{
delete __o_r;
delete __in;
throw esoap::SoapException( __client_code, __client_param );
}
__o_r->push_back( __p->getInteger() );
}
delete __in;
return __o_r;
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -