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: Transport buffer is empty???
Date Mon, 12 Jul 2004 15:11:41 GMT
Hi all

I haven´t still solved that mysterious problem.
I get sometimes the following error and sometimes I get the right result. 
Exception : AxisTransportException:Transport buffer is empty Code error: 46

I´m using MSVC 6.0 ide and try to connect with my c++ client to a java
service.
I use also the latest version of axis c++ 1.2.

I checked my soap monitor and everything seems to be okay.
Does anybody have any hints??? Or is this a bug of axis???

I´d appreciate any help. 
Thanks Phil


my soap messages looks as follow:

POST /axis/services/xxx HTTP/1.1 Host: 127.0.0.1 Content-Type: text/xml;
charset=UTF-8 SOAPAction: "" Content-Length: 400  <?xml version='1.0'
encoding='utf-8' ?>
   <SOAP-ENV:Envelope
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">
      <SOAP-ENV:Body>
         <ns1:login xmlns:ns1="service:xxx">
            <user>user</user>
            <password>passwd</password>
            <languageID>EN</languageID>
         </ns1:login>
      </SOAP-ENV:Body>
   </SOAP-ENV:Envelope>


HTTP/1.1 200 OK Content-Type: text/xml; charset=utf-8 Transfer-Encoding:
chunked Date: Mon, 12 Jul 2004 12:51:51 GMT Server: Apache Coyote/1.0  

1f7 
<?xml version="1.0" encoding="UTF-8"?>
   <soapenv:Envelope
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:Body>  
         <ns1:loginResponse
soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:ns1="service:xxx">   
            <ns1:loginReturn
xsi:type="xsd:string">Successful</ns1:loginReturn>  
         </ns1:loginResponse> 
      </soapenv:Body>
   </soapenv:Envelope> 
0  


AND my c++ code looks as follow:

#include <axis/client/Stub.h>
#include <axis/ISoapFault.h>
#include "AxisClientException.h"

class PDMWebConnector  :public Stub
{
public:
	PDMWebConnector(const char* pchEndpointUri, AXIS_PROTOCOL_TYPE
eProtocol=APTHTTP);
	PDMWebConnector();
public:
	virtual ~PDMWebConnector();
public: 
	xsd__string login(xsd__string Value0,xsd__string Value1,xsd__string
Value2);
	xsd__string logout();
};

#endif


xsd__string xxx::login(xsd__string Value0, xsd__string Value1, xsd__string
Value2)
{
	xsd__string Ret;
	const char* pcCmplxFaultName;
	try
	{	if (AXIS_SUCCESS != m_pCall->initialize(CPP_DOC_PROVIDER,
NORMAL_CHANNEL)) return Ret;
		m_pCall->setTransportProperty(SOAPACTION_HEADER , "");
	m_pCall->setSOAPVersion(SOAP_VER_1_1);
	m_pCall->setOperation("login", "service:xxx");
	applyUserPreferences();
	m_pCall->addParameter((void*)&Value0, "user", XSD_STRING);
	m_pCall->addParameter((void*)&Value1, "password", XSD_STRING);
	m_pCall->addParameter((void*)&Value2, "languageID", XSD_STRING);

	printf("add params \n %s \n %s \n %s \n", Value0, Value1, Value2);
	if (AXIS_SUCCESS == m_pCall->invoke())
	{
		if(AXIS_SUCCESS == m_pCall->checkMessage("loginResponse",
"service:xxx"))
		{
			Ret = m_pCall->getElementAsString("loginReturn", 0);
		}
	}
	m_pCall->unInitialize();
	return Ret;
	}
	catch(AxisException& e)
	{
		int iExceptionCode = e.getExceptionCode();
		if(AXISC_NODE_VALUE_MISMATCH_EXCEPTION != iExceptionCode)
		{
			throw;
		}
		ISoapFault* pSoapFault = (ISoapFault*)
m_pCall->checkFault("Fault",endpoint );
		if(pSoapFault)
		{
			m_pCall->unInitialize();
			throw AxisClientException(pSoapFault);
		}
		else throw;
	}
}

My main client:

 xxx ws;
	
	try{
        char* Result; 		       
        
        char* username = strdup("user");   
		char* passwd   = strdup("passwd");  
        char* language = strdup("EN");
  		
   	  printf("ergebnis ist %s", ws.login(username, passwd, language));

    }
    catch(AxisException& e)
        {		
            printf("Exception : %s \n %i", e.what(), e.getExceptionCode());
        }
    catch(exception& e)
        {		
            printf("Unknown exception has occured\n", e.what());
        }
	catch(...)
        {
            printf("Unknown exception has occured\n" );
        }















-----Ursprüngliche Nachricht-----
Von: Bochnak Filip [mailto:Filip.Bochnak@edmb.debis.com]
Gesendet: Freitag, 9. Juli 2004 11:42
An: 'Apache AXIS C User List'
Betreff: AW: Transport buffer is empty???


I can´t follow you...
What I mentioned was that I get an empty buffer from the server.
My question was, how I can prevent this error? 

-----Ursprüngliche Nachricht-----
Von: Samisa Abeysinghe [mailto:samisa_abeysinghe@yahoo.com]
Gesendet: Freitag, 9. Juli 2004 11:08
An: Apache AXIS C User List; Sergej Srepfler
Betreff: Re: Transport buffer is empty???


 
> Can you help me? I am looking for example how to read SOAPHeader
> fields.
 
Support to read incomming headers is not yet implemented.
You can only set outgoing headers.

 



		
__________________________________
Do you Yahoo!?
New and Improved Yahoo! Mail - Send 10MB messages!
http://promotions.yahoo.com/new_mail 

Mime
View raw message