📄 ctype_client.cpp
字号:
/////////////////////////////////////////////////////////////////////////////
// $Id: ctype_client.cpp,v 1.5 2001/09/11 12:02:57 rosimildo Exp $
//
// Copyright (c) 2001 Exor International Inc. All rights reserved.
//
// MODULE DESCRIPTION: A simple "echo" example to show how to use
// complex types with the eSoap toolkit. Also, this example shows
// how the server returns some OUT parameters.
//
// MODIFICATION/HISTORY:
//
// $Log: ctype_client.cpp,v $
// Revision 1.5 2001/09/11 12:02:57 rosimildo
// changed copyright from Technopoint to Exit; updated version to 0.9
//
// Revision 1.4 2001/09/09 14:19:52 rosimildo
// Added some comments. Added copyright.
//
// Revision 1.3 2001/09/09 12:37:44 rosimildo
// Updated code for esoapcg 1.08. Added small comments to the
// clients main cpp module.
//
//
// Created 2001/09/10 Rosimildo da Silva, ConnectTel Inc.
// [rdasilva@connecttel.com]
//
/////////////////////////////////////////////////////////////////////////////
#include <stdio.h>
#include "Echo_proxy.h"
#define ESOAP_SERVER_URL "http://localhost:8080/rpcrouter"
int main(int argc, char **argv)
{
echo::Echo_Proxy proxy( ESOAP_SERVER_URL, 30 );
try
{
echo::Address a;
a.set_m_street( "1341 Road Dr." );
a.set_m_city( "Austin" );
a.set_m_state( "TX" );
a.set_m_zipcode( 78728 );
echo::UserProfile user;
user.set_m_name( "Joe" );
user.set_m_age( 35 );
user.set_m_address( a );
// OUT parameters
esoap::String name;
int age;
int zipcode;
printf( "Echo: calling echo() method.\n" );
proxy.echo( user, name, age, zipcode );
printf( "name=%s, age=%d, zipcode=%d\n",
name.c_str(), age, zipcode );
}
catch( esoap::SoapException & e )
{
printf( "SOAP Fault: Code=%s, String=%s\n",
e.getCode().c_str(), e.getString().c_str() );
}
catch( ... )
{
printf( "Weird C++ error. Please fix your code. :-)\n" );
}
// just to cleanup the memory...
delete esoap::ParameterFactory::setInstance( 0 );
return 0;
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -