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 Huy Nguyen <HN...@isabel.be> on 2004/11/12 11:58:46 UTC

WSDL with "document style" - Client Souce code generated with no parameter (via WSDL2Ws tool).


[Huy Nguyen]    


> Hi all,
> 
> I have a problem while trying to generate stubs code (in C++) fro a WSDL file.
> Mainly, my WSDL file use a "document/literal" style. When I try to generated the Cpp files from this WSDL (with the Axis WSDL2Ws tool), I get the Cpp files but the operation (method) generated does not contain the parameter.
> 
> Could somebody help me ? Thanks in advance.
> 
> The WSDL file is as follows:
> 
> 
> <?xml version="1.0" encoding="UTF-8"?>
> <wsdl:definitions name="PKIGatewayService" targetNamespace="http://ws.gateway.pki.isabel.be" 
> xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" 
> xmlns:xsd="http://www.w3.org/2001/XMLSchema" 
> xmlns:tns="http://ws.gateway.pki.isabel.be" 
> xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/">
> 
> 
>   <wsdl:types>
>     <xsd:schema elementFormDefault="qualified" targetNamespace="http://ws.gateway.pki.isabel.be" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
>           <xsd:element name="mainServiceRequestElem" type="xsd:string"/>
>           <xsd:element name="mainServiceResponseElem" type="xsd:string"/>
>       </xsd:schema>
>   </wsdl:types>
> 
> 
>   <wsdl:message name="mainServiceResponse">
>     <wsdl:part name="mainService_out" element="tns:mainServiceResponseElem"/>
>   </wsdl:message>
> 
>   <wsdl:message name="mainServiceRequest">
>     <wsdl:part name="mainService_in" element="tns:mainServiceRequestElem"/>
>   </wsdl:message>
> 
>   <wsdl:portType name="PKIGatewayServicePortType">
>     <wsdl:operation name="mainService" >
>       <wsdl:input name="mainServiceRequest" message="tns:mainServiceRequest"/>
>       <wsdl:output name="mainServiceResponse" message="tns:mainServiceResponse"/>
>     </wsdl:operation>
>   </wsdl:portType>
> 
>   <wsdl:binding name="PKIGatewayServicePortBinding" type="tns:PKIGatewayServicePortType">
>     <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
>     <wsdl:operation name="mainService">
>       <soap:operation soapAction="" style="document"/>
>       <wsdl:input name="mainServiceRequest">
>         <soap:body parts="mainService_in" use="literal"/>
>       </wsdl:input>
>       <wsdl:output name="mainServiceResponse">
>         <soap:body parts="mainService_out" use="literal"/>
>       </wsdl:output>
>     </wsdl:operation>
>   </wsdl:binding>
> 
>   <wsdl:service name="PKIGatewayService">
>     <wsdl:port name="PKIGatewayServicePort" binding="tns:PKIGatewayServicePortBinding">
>       <soap:address location="http://localhost:9080/PKIGatewayService/services/PKIGatewayServicePort"/>
>     </wsdl:port>
>   </wsdl:service>
> 
> </wsdl:definitions>
> 
> 
> 
> In this WSDL, the operation "mainService" uses a document/literal style and has ain input part "mainService" which is a string.
> 
> 
> When I generate the Client source files with the Axis WSDL2Ws:
> 
> java -classpath .\wsdl2ws.jar;.; org.apache.axis.wsdl.wsdl2ws.WSDL2Ws %1   -o./ClientOut -lc++ -sclient
> 
> I get the following files:
> PKIGatewayServicePortType.cpp
> PKIGatewayServicePortType.h
> PKIGatewayService_AxisClientException.cpp
> PKIGatewayService_AxisClientException.h
> 
> 
> The PKIGatewayServicePortType.h is as follows:
> 
> /*
>  * This file was auto-generated by the Axis C++ Web Service Generator (WSDL2Ws)
>  * This file contains Client Stub Class for remote web service 
>  */
> 
> #if !defined(__PKIGATEWAYSERVICEPORTTYPE_CLIENTSTUB_H__INCLUDED_)
> #define __PKIGATEWAYSERVICEPORTTYPE_CLIENTSTUB_H__INCLUDED_
> 
> #include <axis/client/Stub.h>
> #include <axis/ISoapFault.h>
> #include "PKIGatewayService_AxisClientException.h"
> 
> class PKIGatewayServicePortType  :public Stub
> {
> public:
>     PKIGatewayServicePortType(const char* pchEndpointUri, AXIS_PROTOCOL_TYPE eProtocol=APTHTTP);
>     PKIGatewayServicePortType();
> public:
>     virtual ~PKIGatewayServicePortType();
> public: 
>     void mainService();
> };
> 
> #endif /* !defined(__PKIGATEWAYSERVICEPORTTYPE_CLIENTSTUB_H__INCLUDED_)*/> 
> 
> 
> 
> We can see that the generated mainService() method does not contain any parameter.
> 
> Could somebody tell me the wrong thing in my WSDL or in the way I use WSDl2Ws?  Thank you.
> 
> Huy Nguyen
> 
> 
> 
> 
> 
>