You are viewing a plain text version of this content. The canonical link for it is here.
Posted to c-user@axis.apache.org by Luciana Trubian <lu...@gmail.com> on 2007/10/02 15:01:21 UTC
Write an output file in server side code (Axis 1.6b C++)
Hi,
I'm using Axis 1.6b C++ on a Linux Machine (Red Hat).
Starting from a wsdl file (euroconv.wdsl), I've genereted (with
WSDL2Ws) the following files:
(server in c++)
AxisServiceException.cpp
AxisServiceException.hpp
EuroConvertitore.cpp
EuroConvertitore.hpp
EuroConvertitoreService.cpp
EuroConvertitoreWrapper.cpp <-- Problems!
EuroConvertitoreWrapper.hpp
(client in java)
(No problems..)
....
The application works fine (under apache 2.0.59).
I have also login and password: in java client code i've set login and
password in this way:
private void _initEuroConvertitoreProxy() {
try {
euroConvertitore_PortType = (new
euroconverter.EuroConvertitore.EuroConvertitore_ServiceLocator()).getEuroConvertitore();
if (euroConvertitore_PortType != null) {
if (_endpoint != null)
{
((javax.xml.rpc.Stub)euroConvertitore_PortType)._setProperty("javax.xml.rpc.service.endpoint.address",
_endpoint);
((javax.xml.rpc.Stub)euroConvertitore_PortType)._setProperty(org.apache.axis.AxisEngine.PROP_DOMULTIREFS,
Boolean.FALSE);
((javax.xml.rpc.Stub)euroConvertitore_PortType)._setProperty(javax.xml.rpc.Stub.USERNAME_PROPERTY,
"miki");
((javax.xml.rpc.Stub)euroConvertitore_PortType)._setProperty(javax.xml.rpc.Stub.PASSWORD_PROPERTY,
"mouse");
}
Now my question is: is it possible to write an output file in server code?
Is it possible have this code to extract i.e. the username? Example:
int CalculatorWrapper::invoke(void *pMsg)
{
IMessageData* mc = (IMessageData*)pMsg;
const AxisChar *method = mc->getOperationName();
string log = mc->getUserName(); //is it correct? Anyway it
compiles correctly...
ofstream out;
out.open("/root/Desktop/fileLoginUtente.txt", ios::app);
out << "Test: " << log;
out.close();
...
}
The application works fine, but it doesn't write the output file.
I work as root.
I create also the similar server JAVA code (in Eclipse under Tomcat),
and it works (it creates and write output file).
I restart apache everty time I recreate .so library.
Thanks a lot,
Luciana
---------------------------------------------------------------------
To unsubscribe, e-mail: axis-c-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-c-user-help@ws.apache.org
Re: Write an output file in server side code (Axis 1.6b C++)
Posted by Luciana Trubian <lu...@gmail.com>.
Ok!! Now it works!!!! Thanks a lot....
But the string log is empty: how can I get the login (and password)
that I already set in java code client side?? I have to use some
apache libraries?
Thanks!
Luciana
2007/10/3, Samisa Abeysinghe <sa...@wso2.com>:
>
> > string log = mc->getUserName(); //is it correct? Anyway it
> > compiles correctly...
> >
> > ofstream out;
> > out.open("/root/Desktop/fileLoginUtente.txt", ios::app);
> > out << "Test: " << log;
> >
> The problem could be that the server may not have the write permission
> to write to the location /root/Desktop.
>
> Try: out.open("/tmp/fileLoginUtente.txt", ios::app);
>
> and see if the file gets written.
>
> Samisa...
>
> --
> Samisa Abeysinghe : WSO2 WSF/PHP
> "http://wso2.org/projects/wsf/php?WSO2 Web Services Framework%2FPHP - Open source PHP extention for providing and consuming Web services in PHP"
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: axis-c-user-unsubscribe@ws.apache.org
> For additional commands, e-mail: axis-c-user-help@ws.apache.org
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: axis-c-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-c-user-help@ws.apache.org
Re: Write an output file in server side code (Axis 1.6b C++)
Posted by Samisa Abeysinghe <sa...@wso2.com>.
> string log = mc->getUserName(); //is it correct? Anyway it
> compiles correctly...
>
> ofstream out;
> out.open("/root/Desktop/fileLoginUtente.txt", ios::app);
> out << "Test: " << log;
>
The problem could be that the server may not have the write permission
to write to the location /root/Desktop.
Try: out.open("/tmp/fileLoginUtente.txt", ios::app);
and see if the file gets written.
Samisa...
--
Samisa Abeysinghe : WSO2 WSF/PHP
"http://wso2.org/projects/wsf/php?WSO2 Web Services Framework%2FPHP - Open source PHP extention for providing and consuming Web services in PHP"
---------------------------------------------------------------------
To unsubscribe, e-mail: axis-c-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-c-user-help@ws.apache.org