axis-c-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Gudbrand Hegge <gudbr...@hegge.no>
Subject newbie document literal help.
Date Mon, 06 Nov 2006 21:29:22 GMT
Hi.

Using axis-c-1.6b-Win32-trace-bin on win xp with visual studio 6.

I have problem using the generated code for document literal style -  
and yes I have checked the samples. The samples uses mostly function  
style like Calculator.add(int, int, response); but my generated code  
have no input or output values. I have tried to add parameter by  
using m_pCall->addParameter() but the service does not like it.

If someone could point to a sample using code like the attached or  
tell me what I am doing wrong I wold be thankfull.

Thanks in advance.
Gudbrand
---

Some more details;

The code is generated using these parameters; ...WSDL2Ws   
StraffesakService.wsdl -osrc/soap -sclient -lc++

The wsdl look like this;
<?xml version = '1.0' encoding = 'UTF-8'?>
<definitions xmlns="http://schemas.xmlsoap.org/wsdl/"  
xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/"  
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:xsd="http:// 
www.w3.org/2001/XMLSchema" xmlns:ns1="http:// 
service.straffesak.justisdepartementet.no/types/" xmlns:mime="http:// 
schemas.xmlsoap.org/wsdl/mime/" xmlns:tns="http:// 
service.straffesak.justisdepartementet.no/" name="StraffesakService"  
targetNamespace="http://service.straffesak.justisdepartementet.no/">
     <types>
         <schema xmlns="http://www.w3.org/2001/XMLSchema"  
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:xsi="http:// 
www.w3.org/2001/XMLSchema-instance" xmlns:soap11-enc="http:// 
schemas.xmlsoap.org/soap/encoding/" xmlns:tns="http:// 
service.straffesak.justisdepartementet.no/types/"  
targetNamespace="http://service.straffesak.justisdepartementet.no/ 
types/" elementFormDefault="qualified">
             <element name="getStraffesakInfoElement" type="string"  
nillable="true"/>
             <element name="getStraffesakInfoResponseElement"  
type="string" nillable="true"/>
         </schema>
     </types>
     <message name="StraffesakService_getStraffesakInfo">
         <part name="foresporsel"  
element="ns1:getStraffesakInfoElement"/>
     </message>
     <message name="StraffesakService_getStraffesakInfoResponse">
         <part name="svar"  
element="ns1:getStraffesakInfoResponseElement"/>
     </message>
     <portType name="StraffesakService">
         <operation name="getStraffesakInfo">
             <input message="tns:StraffesakService_getStraffesakInfo"/>
             <output  
message="tns:StraffesakService_getStraffesakInfoResponse"/>
         </operation>
     </portType>
     <binding name="StraffesakServiceSoapHttp"  
type="tns:StraffesakService">
         <soap:binding style="document" transport="http:// 
schemas.xmlsoap.org/soap/http"/>
         <operation name="getStraffesakInfo">
             <soap:operation soapAction="http:// 
service.straffesak.justisdepartementet.no//getStraffesakInfo"/>
             <input>
                 <soap:body use="literal" parts="foresporsel"/>
             </input>
             <output>
                 <soap:body use="literal" parts="svar"/>
             </output>
         </operation>
     </binding>
     <service name="StraffesakService">
         <port name="StraffesakServiceSoapHttpPort"  
binding="tns:StraffesakServiceSoapHttp">
             <soap:address location="http://vx66puapid01h:8891/ 
StraffesakService-context-root/StraffesakServiceSoapHttpPort"/>
         </port>
     </service>
</definitions>




And the generated method to call the operation is like this;

/*
  * This method wrap the service methodgetStraffesakInfo
  */
void StraffesakService::getStraffesakInfo()
{
	const char* pcCmplxFaultName;
	pcCmplxFaultName = NULL;
	try
	{	if (AXIS_SUCCESS != m_pCall->initialize(CPP_DOC_PROVIDER)) return ;
	if (NULL==m_pCall->getTransportProperty("SOAPAction",false))
	{
		m_pCall->setTransportProperty(SOAPACTION_HEADER , "http:// 
service.straffesak.justisdepartementet.no//getStraffesakInfo");
	}
	m_pCall->setSOAPVersion(SOAP_VER_1_1);
	m_pCall->setOperation("getStraffesakInfoElement", "http:// 
service.straffesak.justisdepartementet.no/types/");
	includeSecure();
	applyUserPreferences();
	if (AXIS_SUCCESS == m_pCall->invoke())
	{
		if(AXIS_SUCCESS == m_pCall->checkMessage 
("getStraffesakInfoResponseElement", "http:// 
service.straffesak.justisdepartementet.no/types/"))
		{
			/*not successful*/
		}
	}
	m_pCall->unInitialize();
	}
	catch(AxisException& e)
	{
		//removed
	}
}




Mime
View raw message