RE: SSL Client
Title: Message Hi, thanks for the reply, I did actually get it working with the changes I described - these were applied to the Axis C++ 1.5 Final sources. I was actually looking for the repository on the Apache website, and the main page at http://ws.apache.org/axis still links to 'Get Involved' > 'CVS Repository' = http://ws.apache.org/axis/cvs.html - but the links there are no longer valid? One extra remark for others trying to get SSL to work: I noticed that even for a client-only installation, I needed the AXISCPP_DEPLOY environment variable and an appropriate axiscpp.conf configuration file there for SSL to work (with Channel_HTTP_SSL: ...\HTTPSSLChannel.dll in it). This axiscpp.conf was not necessary for the client without SSL, is that correct? Kind regards, Iwan -Original Message-From: Fred Preston [mailto:[EMAIL PROTECTED] Sent: dinsdag 21 februari 2006 17:37To: Apache AXIS C User ListSubject: RE: SSL ClientHi Iwan, Did you get SSL working? Also, you should not be downloading the Axis code from CVS repository as this abandoned months ago and the new Axis repository is now in SVN (it should all be on the Apache web site :-) ). From your code snippets, it looks like you are using quite an old version of the code and it could be that some of your problems have already been resolved when you try the latest code extracted from SVN repository :-) Regards,Fred Preston. Iwan Tomlow <[EMAIL PROTECTED]> 21/02/2006 07:57 Please respond to "Apache AXIS C User List" To: "'Apache AXIS C User List'" cc: "'axis-c-dev@ws.apache.org'" Subject: RE: SSL Client One thing I forgot to mention: to prevent the crash, I also had to changethe following in xml\XMLParserXerces.cpp:Ln 79:const AnyElement* XMLParserXerces::next(bool isCharData){ bool bCanParseMore = false; if(!m_bFirstParsed) {- m_pParser->parseFirst(*m_pInputSource, m_ScanToken);- m_bFirstParsed = TRUE;+ m_bFirstParsed = m_pParser->parseFirst(*m_pInputSource,m_ScanToken);+ if (!m_bFirstParsed)+ return NULL; }Kind regards,Iwan Tomlow-Original Message-From: Iwan Tomlow [mailto:[EMAIL PROTECTED] Sent: dinsdag 21 februari 2006 8:53To: 'Apache AXIS C User List'Cc: 'axis-c-dev@ws.apache.org'Subject: RE: SSL ClientHello,Just to let you know I managed to get the SSL configured usingvc\transport\Axis3\HTTPSSLChannel.However, I think I stumbled over a bug in the transport layer, because theAxis-client was always crashing when using SSL. Can't seem to access theCVS-sources at the moment, so I don't know if it has been noticed and fixedalready, so I'll post it here.Debugging showed the Xerces-parser was using bogus data to throw aUTF8FormatException, so the following code in ClientAxisEngine.cpp failed:Ln 223: int nSoapVersion = m_pDZ->getVersion (); if (nSoapVersion == VERSION_LAST) /* version not supported */ { Status = AXIS_FAIL; // return AXIS_FAIL;The status was indeed AXIS_FAIL, but because the return-statement iscommented out, the subsequent call to "m_pDZ->getHeader ();" caused a crashin the Xerces parser.I finally tracked it down to what I think is a bug in the getBytes() inaxis3/HTTPTransport.cpp (Ln 588). Probably because of using SSL, what I wasreceiving after the HTTP-header was always a first chunk containing *only*the chunk size + CRLF, nothing more. This caused the following code to neverexecute extra reads to really get any of the chunk data: //There might be chunk extensions in there too but we maynot need them unsigned int endOfChunkData =m_strReceived.find( "\r\n"); // make sure we have read at least some part of the message if ( endOfChunkData == std::string::npos) {endOfChunkData was 3 in this case (data was "4db\r\n"), and data was neverread. I tried to fix it like this, which worked for me (not at all sure thatthis is a complete and trustworhty fix); this should make sure at least someof the actual chunk data is read before continuing: // make sure we have read at least some part of the message- if( endOfChunkData == std::string::npos)+
Re: AxisC++ 1.5 fail retrieve string arrays in SOAP message?
Just in case someone else may want to know my lesson here. It turns out this is happening because I always return a array whose last item is null - I was paranoid before I dig into Axis C++ and afraid of it won't know the size of the array so that that null is put in as boundary indicator. However, nicely the Axis C++ does return the array size; but fail to cope with my "null" boundary indicator and thought error has happened. This does raise a question though: why Axis C++ can't handle a "null" item? the java version process this nicely by the way. cheers, Tao Tao Yang wrote: Oops, I forget to say. Even the valid response is observed through the SOAPMonitor, the c++ client code is always reporting: "result.size = 0" What could be preventing it extract the strings from the message? Thanks, Tao
Re: AxisC++ 1.5 fail retrieve string arrays in SOAP message?
Oops, I forget to say. Even the valid response is observed through the SOAPMonitor, the c++ client code is always reporting: "result.size = 0" What could be preventing it extract the strings from the message? Thanks, Tao Tao Yang wrote: Hi, Again with my Axis C++ 1.5 client running against the Axis JAVA 1.3 server experiment: I have a webservice has interface : String[] search(String getIgnored) the java client handle it perfectly by the way. My c++ client is a bit funky though. The stub generated has following code (I add some debuging output): xsd__string_Array Search::search(xsd__string Value0) { xsd__string_Array RetArray = {NULL, 0}; const char* pcCmplxFaultName; try { if (AXIS_SUCCESS != m_pCall->initialize(CPP_RPC_PROVIDER)) return RetArray; if (NULL==m_pCall->getTransportProperty("SOAPAction",false)) { m_pCall->setTransportProperty(SOAPACTION_HEADER , ""); } m_pCall->setSOAPVersion(SOAP_VER_1_1); m_pCall->setOperation("search", "http://ws.search.simdesk.com";); applyUserPreferences(); m_pCall->addParameter((void*)Value0, "criteria", XSD_STRING); if (AXIS_SUCCESS == m_pCall->invoke()) { if(AXIS_SUCCESS == m_pCall->checkMessage("searchResponse", "http://ws.search.simdesk.com";)) { // tyang changed following line - it complains about type conversion is invalid //RetArray = (xsd__string_Array&)m_pCall->getBasicArray(XSD_STRING, "searchReturn", 0); Axis_Array arr = m_pCall->getBasicArray(XSD_STRING, "searchReturn", 0); xsd__string_Array sarr = { (xsd__string *) arr.m_Array, arr.m_Size }; RetArray.m_Array = (xsd__string *) arr.m_Array; RetArray.m_Size = arr.m_Size; std::cout << "result.size = " << RetArray.m_Size << endl; std::cout << "result: "; for (int i = 0; i < RetArray.m_Size; i++) { std::cout << RetArray.m_Array[i] << "; ";std::cout << endl; } } m_pCall->unInitialize(); return RetArray; } catch(AxisException& e) { int iExceptionCode = e.getExceptionCode(); if(AXISC_NODE_VALUE_MISMATCH_EXCEPTION != iExceptionCode) { throw SoapFaultException(e); } ISoapFault* pSoapFault = (ISoapFault*) m_pCall->checkFault("Fault","http://172.16.53.33:8080/simdesk/services/Search"; ); if(pSoapFault) { m_pCall->unInitialize(); throw SoapFaultException(e); } else throw; } } Plus, the SOAPMonitor reporting following request: xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"; xmlns:xsd="http://www.w3.org/2001/XMLSchema"; xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";> http://ws.search.simdesk.com";> asdr And following response: xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"; xmlns:xsd="http://www.w3.org/2001/XMLSchema"; xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";> soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"; xmlns:ns1="http://ws.search.simdesk.com";> xsi:type="soapenc:Array" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/";> eqre.pdf another.txt ~/blah.h asdf What have I done wrong? :-( Thanks for any help or advice in advance! Tao
AxisC++ 1.5 fail retrieve string arrays in SOAP message?
Hi, Again with my Axis C++ 1.5 client running against the Axis JAVA 1.3 server experiment: I have a webservice has interface : String[] search(String getIgnored) the java client handle it perfectly by the way. My c++ client is a bit funky though. The stub generated has following code (I add some debuging output): xsd__string_Array Search::search(xsd__string Value0) { xsd__string_Array RetArray = {NULL, 0}; const char* pcCmplxFaultName; try { if (AXIS_SUCCESS != m_pCall->initialize(CPP_RPC_PROVIDER)) return RetArray; if (NULL==m_pCall->getTransportProperty("SOAPAction",false)) { m_pCall->setTransportProperty(SOAPACTION_HEADER , ""); } m_pCall->setSOAPVersion(SOAP_VER_1_1); m_pCall->setOperation("search", "http://ws.search.simdesk.com";); applyUserPreferences(); m_pCall->addParameter((void*)Value0, "criteria", XSD_STRING); if (AXIS_SUCCESS == m_pCall->invoke()) { if(AXIS_SUCCESS == m_pCall->checkMessage("searchResponse", "http://ws.search.simdesk.com";)) { // tyang changed following line - it complains about type conversion is invalid //RetArray = (xsd__string_Array&)m_pCall->getBasicArray(XSD_STRING, "searchReturn", 0); Axis_Array arr = m_pCall->getBasicArray(XSD_STRING, "searchReturn", 0); xsd__string_Array sarr = { (xsd__string *) arr.m_Array, arr.m_Size }; RetArray.m_Array = (xsd__string *) arr.m_Array; RetArray.m_Size = arr.m_Size; std::cout << "result.size = " << RetArray.m_Size << endl; std::cout << "result: "; for (int i = 0; i < RetArray.m_Size; i++) { std::cout << RetArray.m_Array[i] << "; ";std::cout << endl; } } m_pCall->unInitialize(); return RetArray; } catch(AxisException& e) { int iExceptionCode = e.getExceptionCode(); if(AXISC_NODE_VALUE_MISMATCH_EXCEPTION != iExceptionCode) { throw SoapFaultException(e); } ISoapFault* pSoapFault = (ISoapFault*) m_pCall->checkFault("Fault","http://172.16.53.33:8080/simdesk/services/Search"; ); if(pSoapFault) { m_pCall->unInitialize(); throw SoapFaultException(e); } else throw; } } Plus, the SOAPMonitor reporting following request: xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"; xmlns:xsd="http://www.w3.org/2001/XMLSchema"; xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";> http://ws.search.simdesk.com";> asdr And following response: xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"; xmlns:xsd="http://www.w3.org/2001/XMLSchema"; xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";> soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"; xmlns:ns1="http://ws.search.simdesk.com";> xsi:type="soapenc:Array" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/";> eqre.pdf another.txt ~/blah.h asdf What have I done wrong? :-( Thanks for any help or advice in advance! Tao
RE: SSL Client
Hi Iwan, Did you get SSL working? Also, you should not be downloading the Axis code from CVS repository as this abandoned months ago and the new Axis repository is now in SVN (it should all be on the Apache web site :-) ). From your code snippets, it looks like you are using quite an old version of the code and it could be that some of your problems have already been resolved when you try the latest code extracted from SVN repository :-) Regards, Fred Preston. Iwan Tomlow <[EMAIL PROTECTED]> 21/02/2006 07:57 Please respond to "Apache AXIS C User List" To: "'Apache AXIS C User List'" cc: "'axis-c-dev@ws.apache.org'" Subject: RE: SSL Client One thing I forgot to mention: to prevent the crash, I also had to change the following in xml\XMLParserXerces.cpp: Ln 79: const AnyElement* XMLParserXerces::next(bool isCharData) { bool bCanParseMore = false; if(!m_bFirstParsed) { - m_pParser->parseFirst(*m_pInputSource, m_ScanToken); - m_bFirstParsed = TRUE; + m_bFirstParsed = m_pParser->parseFirst(*m_pInputSource, m_ScanToken); + if (!m_bFirstParsed) + return NULL; } Kind regards, Iwan Tomlow -Original Message- From: Iwan Tomlow [mailto:[EMAIL PROTECTED] Sent: dinsdag 21 februari 2006 8:53 To: 'Apache AXIS C User List' Cc: 'axis-c-dev@ws.apache.org' Subject: RE: SSL Client Hello, Just to let you know I managed to get the SSL configured using vc\transport\Axis3\HTTPSSLChannel. However, I think I stumbled over a bug in the transport layer, because the Axis-client was always crashing when using SSL. Can't seem to access the CVS-sources at the moment, so I don't know if it has been noticed and fixed already, so I'll post it here. Debugging showed the Xerces-parser was using bogus data to throw a UTF8FormatException, so the following code in ClientAxisEngine.cpp failed: Ln 223: int nSoapVersion = m_pDZ->getVersion (); if (nSoapVersion == VERSION_LAST) /* version not supported */ { Status = AXIS_FAIL; // return AXIS_FAIL; The status was indeed AXIS_FAIL, but because the return-statement is commented out, the subsequent call to "m_pDZ->getHeader ();" caused a crash in the Xerces parser. I finally tracked it down to what I think is a bug in the getBytes() in axis3/HTTPTransport.cpp (Ln 588). Probably because of using SSL, what I was receiving after the HTTP-header was always a first chunk containing *only* the chunk size + CRLF, nothing more. This caused the following code to never execute extra reads to really get any of the chunk data: //There might be chunk extensions in there too but we may not need them unsigned int endOfChunkData = m_strReceived.find( "\r\n"); // make sure we have read at least some part of the message if ( endOfChunkData == std::string::npos) { endOfChunkData was 3 in this case (data was "4db\r\n"), and data was never read. I tried to fix it like this, which worked for me (not at all sure that this is a complete and trustworhty fix); this should make sure at least some of the actual chunk data is read before continuing: // make sure we have read at least some part of the message - if( endOfChunkData == std::string::npos) + std::string::size_type nLen = m_strReceived.length (); + if ( endOfChunkData == std::string::npos || + endOfChunkData + 2 >= nLen ) { iIterationCountdown = 100; do { m_pszRxBuffer [0] = '\0'; *m_pActiveChannel >> m_pszRxBuffer; if( strlen( m_pszRxBuffer) == 0)
Re: Re: SIGABRT on Axis C++ client
Hi, It sounds like you also need to ensure Xerces-C (v2.2.0 if using binary package) is available on the system path You will find full instructions on setting up the client here: http://ws.apache.org/axis/cpp/install-guide.html#Installing_Client Regards, Adrian ___ Adrian Dick ([EMAIL PROTECTED]) Tao Yang <[EMAIL PROTECTED]> wrote on 21/02/2006 14:47:54: > Hi, > > But I am only using the client lib - my code is talking to a Axis JAVA > server deployed in tomcat. > Or do you mean even one uses only the client, he has to provide the > server dploy description? If so, what it should contain? I tried add > one, still same crash though. > > BTW, I also changed the XMLParser to use the one in axiscpp's lib > directory, no hlep neither. :-( > > But still thanks for reply. > Tao > > >Hi, > > > > your configuration file axiscpp.conf file is not right plese check your > >axiscpp.conf file. > >this file must have the following entry.. > > LogPath:/home/Axis/log/server.log > > WSDDFilePath:/home/Axis/etc/server.wsdd > > Transport_http:/home/Axis/lib/libhttp_transport.so > > XMLParser:/home/Axis/lib/libaxis_xerces.so > > Channel_HTTP:/home/Axis/lib/libhttp_channel.so > > > > > >Thanks > >Arashad Ahamad > > > > > >
Re: Re: Re: SIGABRT on Axis C++ client
Just to clarify - I found the problem. The binary distribution from apache site is not compatible with my local linux installation though I do installed the compact-libstdc++ stuff. I recompile and now it seems I did climb over that hurdle. But still thanks for taking a look. :-) and hope my ignorance experience could help latters. cheers, Tao
Re: Problem communicating strings with Apache Axis 1.3 toolkit
Just in case - you do remember to convert that string from UTF8 encoding to what ever appropriate before you pass it to std::out, right? since you are using a Java server which would encoding all string in UTF8 in my understanding. Hope your problem has been solved. cheers, Tao
Re: Re: SIGABRT on Axis C++ client
Hi, But I am only using the client lib - my code is talking to a Axis JAVA server deployed in tomcat. Or do you mean even one uses only the client, he has to provide the server dploy description? If so, what it should contain? I tried add one, still same crash though. BTW, I also changed the XMLParser to use the one in axiscpp's lib directory, no hlep neither. :-( But still thanks for reply. Tao Hi, your configuration file axiscpp.conf file is not right plese check your axiscpp.conf file. this file must have the following entry.. LogPath:/home/Axis/log/server.log WSDDFilePath:/home/Axis/etc/server.wsdd Transport_http:/home/Axis/lib/libhttp_transport.so XMLParser:/home/Axis/lib/libaxis_xerces.so Channel_HTTP:/home/Axis/lib/libhttp_channel.so Thanks Arashad Ahamad