axis-c-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Bochnak Filip <Filip.Boch...@edmb.debis.com>
Subject AW: AW: simple question -> Interoparability Problem C,C++ with Java
Date Wed, 26 May 2004 15:25:36 GMT
Hi Ashish

So, could you tell me how you did that, plz? Or could you send me a simple
example for that?
I did implement a simple method with java on a server side, which is
supposed to return a string like "hello".
I also implemented the java client and it works fine.

java.lang.String calling(java.lang.String param){
		return param;
}

To get a c++ client, I used the wsdl2ws tool which I called with
java -classpath %classpath%;.\wsdl2ws.jar
org.apache.axis.wsdl.wsdl2ws.WSDL2Ws TestService.wsdl -o./ClientOut -lc++
-sclient 

and then I got the following two files


FIRST FILE


#if !defined(__TESTSERVICE_CLIENTSTUB_H__INCLUDED_)
#define __TESTSERVICE_CLIENTSTUB_H__INCLUDED_

#include <axis/client/Call.h>
#include <string>
using namespace std;

class TestService 
{
private:
	Call* m_pCall;
public:
	TestService();
public:
	virtual ~TestService();
public: 
	void calling(xsd__string Value0,xsd__string Value1);	
};

#endif /* !defined(__TESTSERVICE_CLIENTSTUB_H__INCLUDED_)*/


SECOND FILE


#include "TestService.h"

#include <axis/server/AxisWrapperAPI.h>

#include <string>
using namespace std;

#include <iostream>

bool CallBase::bInitialized;
CallFunctions CallBase::ms_VFtable;
TestService::TestService()
{
	m_pCall = new Call();
	m_pCall->SetProtocol(APTHTTP);
	
m_pCall->SetEndpointURI("http://localhost:8080/axis/services/TestService_Ser
vice");
}

TestService::~TestService()
{
	delete m_pCall;
}


/*Methods corresponding to the web service methods*/

/*
 * This method wrap the service methodaufruf
 */
void TestService::calling(xsd__string Value0, xsd__string Value1)
{
	string m("");
	if (AXIS_SUCCESS != m_pCall->Initialize(CPP_RPC_PROVIDER,
NORMAL_CHANNEL)) return ;
	m_pCall->SetTransportProperty(SOAPACTION_HEADER , "");
	m_pCall->SetSOAPVersion(SOAP_VER_1_1);
	m_pCall->SetOperation("calling", "service:TestService");
	m_pCall->AddParameter((void*)&Value0, "param", XSD_STRING);
	m_pCall->AddParameter((void*)&Value1, "callingReturn", XSD_STRING);
	if (AXIS_SUCCESS == m_pCall->Invoke())
	{
		if(AXIS_SUCCESS == m_pCall->CheckMessage("callingResponse",
"service:TestService"))
		{
			/*not successful*/
			cout << "not successful !!!" << endl;
			m = m_pCall->GetElementAsString("callingReturn", 0);
			cout << m;

		}
		cout << "***successful***" << endl;
	}
	m_pCall->UnInitialize();
}


Thanks for you help
Phil


-----Ursprüngliche Nachricht-----
Von: Ashish Rangole [mailto:Ashish.Rangole@vexcel.com]
Gesendet: Mittwoch, 26. Mai 2004 17:07
An: Apache AXIS C User List
Betreff: Re: AW: simple question -> Interoparability Problem C,C++ with
Java


Yes, exactly.

Ashish

On Wed, 2004-05-26 at 09:02, Bochnak Filip wrote:
> Hi Ashish
> Yeah, but have you been able to run Axis C++ which calls java services on
a
> tomcat server ???
> Cu Phil
> 
> -----Ursprüngliche Nachricht-----
> Von: Ashish Rangole [mailto:Ashish.Rangole@vexcel.com]
> Gesendet: Mittwoch, 26. Mai 2004 17:00
> An: Apache AXIS C User List
> Betreff: Re: simple question -> Interoparability Problem C,C++ with Java
> 
> 
> Yes you can. Axis-C++ and gSoap are the possible options.
> I use gSoap and it works very well.
> 
> Ashish
> 
> 
> On Wed, 2004-05-26 at 06:09, Bochnak Filip wrote:
> > Hi all
> > 
> > I have a simple question. Can I implement a C++ Client which connects to
a
> > Java Web Service with Axis?
> > I´ve tried for weeks to run a simple example like getQuote! But it
didn´t
> > work.
> > I use Axis C++ 1.1.1 on the Client side and Axis-1_1 Java on the Server
> > Side.
> > Does anyone have any clues ??? plz...
> > 
> > Thanks for your help
> > Phil

Mime
View raw message