You are viewing a plain text version of this content. The canonical link for it is here.
Posted to axis-cvs@ws.apache.org by da...@apache.org on 2004/06/23 13:01:40 UTC

cvs commit: ws-axis/c/tests/client/exceptionTest/gen_src ExceptionTest.wsdl Makefile.am MathOps.cpp MathOps.h gen.sh

damitha     2004/06/23 04:01:40

  Modified:    c/tests/client/exceptionTest Makefile.am
  Added:       c/tests/client/exceptionTest/gen_src ExceptionTest.wsdl
                        Makefile.am MathOps.cpp MathOps.h gen.sh
  Log:
  
  
  Revision  Changes    Path
  1.3       +2 -6      ws-axis/c/tests/client/exceptionTest/Makefile.am
  
  Index: Makefile.am
  ===================================================================
  RCS file: /home/cvs/ws-axis/c/tests/client/exceptionTest/Makefile.am,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- Makefile.am	22 Jun 2004 12:06:20 -0000	1.2
  +++ Makefile.am	23 Jun 2004 11:01:40 -0000	1.3
  @@ -1,6 +1,2 @@
  -bin_PROGRAMS = mathops
  -SUBDIRS =
  -AM_CPPFLAGS = $(CPPFLAGS)
  -mathops_SOURCES =  OutOfBoundStruct.cpp AxisDivByZeroException.cpp AxisNormalDetailException.cpp MathOps.cpp SpecialDetailStruct.cpp AxisOutOfBoundException.cpp DivByZeroStruct.cpp MathOpsClient.cpp
  -mathops_LDADD = $(LDFLAGS)
  -INCLUDES = -I$(AXISCPP_HOME)/include
  +SUBDIRS = gen_src
  +
  
  
  
  1.1                  ws-axis/c/tests/client/exceptionTest/gen_src/ExceptionTest.wsdl
  
  Index: ExceptionTest.wsdl
  ===================================================================
  <definitions xmlns="http://schemas.xmlsoap.org/wsdl/" xmlns:tns="http://soapinterop.org/wsdl" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:ns2="http://soapinterop.org/types" targetNamespace="http://soapinterop.org/wsdl">
  	<message name="divRequest">
  		<part name="int0" type="xsd:int"/>
  		<part name="int1" type="xsd:int"/>
  	</message>
  	<message name="divResponse">
  		<part name="addReturn" type="xsd:int"/>
  	</message>
  	<portType name="MathOps">
  		<operation name="div" parameterOrder ="int0 int1">
  			<input message="tns:divRequest"/>
  			<output message="tns:divResponse"/>
  		 </operation>
  	</portType>
  	<binding name="MathOpsBinding" type="tns:MathOps">
  		<soap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/>
  		<operation name="div">
  			  <soap:operation soapAction="MathOps#div"/>
                  <input name="divRequest">
                      <soap:body 
                          encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" 
                          namespace="http://localhost/axis/MathOps" 
                          use="encoded"/>
                  </input>
                  <output name="divResponse">
                      <soap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" 
                          namespace="http://localhost/axis/MathOps" 
                          use="encoded"/>
                  </output>
  			</operation>
  		</binding>
  	<service name="MathOpsService">
  		<port name="MathOps" binding="tns:MathOpsBinding">
  			<soap:address location="http://localhost/axis/MathOps"/>
  		</port>
  	</service>
  	<!-- Fault messages -->
  </definitions>
  
  
  
  1.1                  ws-axis/c/tests/client/exceptionTest/gen_src/Makefile.am
  
  Index: Makefile.am
  ===================================================================
  bin_PROGRAMS = mathops
  SUBDIRS =
  AM_CPPFLAGS = $(CPPFLAGS)
  mathops_SOURCES =  MathOps.cpp ../MathOpsClient.cpp
  mathops_LDADD = $(LDFLAGS)
  INCLUDES = -I$(AXISCPP_HOME)/include
  
  
  
  1.1                  ws-axis/c/tests/client/exceptionTest/gen_src/MathOps.cpp
  
  Index: MathOps.cpp
  ===================================================================
  /*
   * This file was auto-generated by the Axis C++ Web Service Generator (WSDL2Ws)
   * This file contains Client Stub implementation for remote web service.
   */
  
  #include "MathOps.h"
  
  #include <axis/server/AxisWrapperAPI.h>
  
  using namespace std;
  
   MathOps::MathOps(const char* pchEndpointUri, AXIS_PROTOCOL_TYPE eProtocol)
  :Stub(pchEndpointUri, eProtocol)
  {
  }
  
  MathOps::MathOps()
  :Stub(" ", APTHTTP)
  {
  	m_pCall->setEndpointURI("http://localhost/axis/MathOps");
  }
  
  MathOps::~MathOps()
  {
  }
  
  
  /*Methods corresponding to the web service methods*/
  
  /*
   * This method wrap the service method div
   */
  int MathOps::div(int Value0, int Value1)
  {
  	int Ret;
  	char* cFaultcode;
  	char* cFaultstring;
  	char* cFaultactor;
  	char* cFaultdetail;
  	try
  	{
  		if (AXIS_SUCCESS != m_pCall->initialize(CPP_RPC_PROVIDER, NORMAL_CHANNEL)) 
  			return Ret;
  		m_pCall->setTransportProperty(SOAPACTION_HEADER , "MathOps#div");
  		m_pCall->setSOAPVersion(SOAP_VER_1_1);
  		m_pCall->setOperation("div", "http://soapinterop.org/wsdl");
  		applyUserPreferences();
  		m_pCall->addParameter((void*)&Value0, "int0", XSD_INT);
  		m_pCall->addParameter((void*)&Value1, "int1", XSD_INT);
  		if (AXIS_SUCCESS == m_pCall->invoke())
  		{
  			if(AXIS_SUCCESS == m_pCall->checkMessage("divResponse", "http://soapinterop.org/wsdl"))
  			{
  				Ret = m_pCall->getElementAsInt("addReturn", 0);
  			}
  		}
  		m_pCall->unInitialize();
  		return Ret;
  	}
  	catch(AxisException& e)
  	{
  		int iExceptionCode = e.getExceptionCode();
  		if(AXISC_NODE_VALUE_MISMATCH_EXCEPTION != iExceptionCode)
  		{
  			throw;
  		}
  		else if (AXIS_SUCCESS == m_pCall->checkFault("Fault","http://localhost/axis/MathOps" ))//Exception handling code goes here
  		{
  			cFaultcode = m_pCall->getElementAsString("faultcode", 0);
  			cFaultstring = m_pCall->getElementAsString("faultstring", 0);
  			cFaultactor = m_pCall->getElementAsString("faultactor", 0);
  		        cFaultdetail = m_pCall->getElementAsString("faultdetail", 0);
  		        throw AxisException(cFaultdetail);
  		}
  		else throw;
  	}
  }
  
  int MathOps::getFaultDetail(char** ppcDetail)
  {
  	return m_pCall->getFaultDetail(ppcDetail);
  }
  
  
  
  
  1.1                  ws-axis/c/tests/client/exceptionTest/gen_src/MathOps.h
  
  Index: MathOps.h
  ===================================================================
  /*
   * This file was auto-generated by the Axis C++ Web Service Generator (WSDL2Ws)
   * This file contains Client Stub Class for remote web service 
   */
  
  #if !defined(__MATHOPS_CLIENTSTUB_H__INCLUDED_)
  #define __MATHOPS_CLIENTSTUB_H__INCLUDED_
  
  #include <axis/client/Stub.h>
  /*include Exception header files here*/
  
  
  class MathOps :public Stub
  {
  public:
  	MathOps(const char* pchEndpointUri, AXIS_PROTOCOL_TYPE eProtocol=APTHTTP);
  	MathOps();
  public:
  	virtual ~MathOps();
  public: 
  	int div(int Value0,int Value1);
  	int getFaultDetail(char** ppcDetail);
  };
  
  #endif /* !defined(__MATHOPS_CLIENTSTUB_H__INCLUDED_)*/
  
  
  
  1.1                  ws-axis/c/tests/client/exceptionTest/gen_src/gen.sh
  
  Index: gen.sh
  ===================================================================
  java org.apache.axis.wsdl.wsdl2ws.WSDL2Ws ExceptionTest.wsdl -lc++ -sclient