You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by wh...@apache.org on 2005/06/14 11:29:47 UTC

cvs commit: ws-axis/c/tests/auto_build/testcases/dynamic/DynamicSOAPVersionTest DynUnrefAttachmentTest.cpp

whitlock    2005/06/14 02:29:47

  Added:       c/tests/auto_build/testcases/dynamic/DynamicSOAPVersionTest
                        DynUnrefAttachmentTest.cpp
  Log:
  Create new unit test
  
  Revision  Changes    Path
  1.1                  ws-axis/c/tests/auto_build/testcases/dynamic/DynamicSOAPVersionTest/DynUnrefAttachmentTest.cpp
  
  Index: DynUnrefAttachmentTest.cpp
  ===================================================================
  // Copyright 2003-2004 The Apache Software Foundation.
  // 
  // Licensed under the Apache License, Version 2.0 (the "License");
  // you may not use this file except in compliance with the License.
  // You may obtain a copy of the License at
  // 
  //        http://www.apache.org/licenses/LICENSE-2.0
  // 
  // Unless required by applicable law or agreed to in writing, software
  // distributed under the License is distributed on an "AS IS" BASIS,
  // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  // See the License for the specific language governing permissions and
  // limitations under the License.
  
  #include <axis/AxisException.hpp>
  #include <axis/client/Call.hpp>
  #include <axis/AxisWrapperAPI.hpp>
  #include <iostream>
  #include <string>
  #include <exception>
  using namespace std;
  AXIS_CPP_NAMESPACE_USE 
  
  int main(int argc, char* argv[])
  {
  	try
  	{
  		Call call;
  		call.setEndpointURI(argv[1]);
  		call.initialize(CPP_DOC_PROVIDER);
  		call.setSOAPVersion(SOAP_VER_1_1);
  		call.setTransportProperty(SOAPACTION_HEADER , "Trash");
  		call.setOperation("put", "http://localhost/axis/DynUnrefAttachment");
  
  		if (AXIS_SUCCESS != call.invoke())
  		{
  			cout << "Invoke failed" << endl;
  			return 0;
  		}
  
  		if(AXIS_SUCCESS != call.checkMessage("putResponse", "http://localhost/axis/DynUnrefAttachment"))
  		{
  			cout << "Check message failed" << endl;
  			return 0;
  		}
  		call.unInitialize();
  	}
  	catch(AxisException& e)
  	{
  	     cout << "Exception : " <<  e.what()<< endl;		
  	}
  	catch(exception& e)
  	{
  	    cout << "Unknown exception has occured" << endl;
  	}
  	catch(...)
  	{
  		 cout << "Unspecified exception has occured" << endl;
  	}
  	cout << "----------------------------TEST COMPLETE--------------------------------" << endl;
  	return 0;
  }