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 "Jairam, Roopnaraine" <Ro...@ca.com> on 2004/09/27 23:30:38 UTC
c++ Axis client -> java Axis webservice
Hi:
I'm trying to build a c++ client to talk to my java webservice, I used
the java2wsdl tool to generate the wsdl. I then used wsdl2java tool to
generate my server side code. Now I am trying to use wsdl2ws tool to
create the client side code and I get the following error
C:\LicenseSystem\client>Java org.apache.axis.wsdl.wsdl2ws.WSDL2Ws
abc.wsdl -o./ClientOut -lc++ -sclient -verbose
log4j:WARN No appenders could be found for logger
(org.apache.axis.i18n.ProjectResourceBundle).
log4j:WARN Please initialize the log4j system properly.
Exception in thread "main" java.lang.NoSuchMethodError:
org.apache.axis.wsdl.symbolTable.ElementDecl.getMinOccrs()I
at
org.apache.axis.wsdl.wsdl2ws.WSDL2Ws.createTypeInfo(WSDL2Ws.java:689)
at
org.apache.axis.wsdl.wsdl2ws.WSDL2Ws.getTypeInfo(WSDL2Ws.java:426)
at
org.apache.axis.wsdl.wsdl2ws.WSDL2Ws.genarateWrappers(WSDL2Ws.java:463)
at org.apache.axis.wsdl.wsdl2ws.WSDL2Ws.main(WSDL2Ws.java:796)
I was able to use the tool to build Calculator.wsdl client but not my
own code. I have attached the wsdl file for reference. My file using
complex types not sure if this is supported in axis c++.
<?xml version="1.0" encoding="UTF-8"?>
<wsdl:definitions targetNamespace="urn:ca"
xmlns="http://schemas.xmlsoap.org/wsdl/"
xmlns:apachesoap="http://xml.apache.org/xml-soap" xmlns:impl="urn:ca"
xmlns:intf="urn:ca"
xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:tns2="http://objects.ca"
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<wsdl:types>
<schema targetNamespace="http://objects.ca"
xmlns="http://www.w3.org/2001/XMLSchema">
<import namespace="http://schemas.xmlsoap.org/soap/encoding/"/>
<complexType name="KeyTableRecord">
<sequence>
<element name="nodes" type="xsd:int"/>
<element name="startDate" nillable="true" type="xsd:date"/>
<element name="vendorName" nillable="true" type="xsd:string"/>
<element name="clientID" nillable="true" type="xsd:string"/>
<element name="regDate" nillable="true" type="xsd:date"/>
<element name="componentCode" nillable="true" type="xsd:string"/>
<element name="oemKey" nillable="true" type="xsd:string"/>
<element name="expired" type="xsd:boolean"/>
<element name="key" nillable="true" type="xsd:string"/>
<element name="days" type="xsd:int"/>
<element name="companyName" nillable="true" type="xsd:string"/>
</sequence>
</complexType>
<complexType name="ProductTableRecord">
<sequence>
<element name="productBuild" type="xsd:int"/>
<element name="nodeCount" type="xsd:int"/>
<element name="os" nillable="true" type="xsd:string"/>
<element name="language" nillable="true" type="xsd:string"/>
<element name="clientID" nillable="true" type="xsd:string"/>
<element name="productVersion" type="xsd:int"/>
<element name="productName" nillable="true" type="xsd:string"/>
<element name="productCode" nillable="true" type="xsd:string"/>
</sequence>
</complexType>
<complexType name="ClientTableRecord">
<sequence>
<element name="state" nillable="true" type="xsd:string"/>
<element name="address2" nillable="true" type="xsd:string"/>
<element name="address1" nillable="true" type="xsd:string"/>
<element name="country" nillable="true" type="xsd:string"/>
<element name="vendorName" nillable="true" type="xsd:string"/>
<element name="vendorCode" nillable="true" type="xsd:string"/>
<element name="city" nillable="true" type="xsd:string"/>
<element name="clientID" nillable="true" type="xsd:string"/>
<element name="email" nillable="true" type="xsd:string"/>
<element name="zip2" nillable="true" type="xsd:string"/>
<element name="zip1" nillable="true" type="xsd:string"/>
<element name="companyName" nillable="true" type="xsd:string"/>
</sequence>
</complexType>
</schema>
<schema targetNamespace="urn:ca"
xmlns="http://www.w3.org/2001/XMLSchema">
<import namespace="http://schemas.xmlsoap.org/soap/encoding/"/>
<complexType name="LicenseRegistration">
<sequence>
<element name="keyTblRec" nillable="true"
type="tns2:KeyTableRecord"/>
<element name="productTblRec" nillable="true"
type="tns2:ProductTableRecord"/>
<element name="clientTblRec" nillable="true"
type="tns2:ClientTableRecord"/>
</sequence>
</complexType>
<complexType name="RegistrationResults">
<sequence>
<element name="status" type="xsd:int"/>
<element name="timeStamp" type="xsd:int"/>
<element name="key" nillable="true" type="xsd:string"/>
<element name="days" type="xsd:int"/>
<element name="clientID" nillable="true" type="xsd:string"/>
</sequence>
</complexType>
</schema>
</wsdl:types>
<wsdl:message name="registerLicenseRequest">
<wsdl:part name="in0" type="impl:LicenseRegistration"/>
</wsdl:message>
<wsdl:message name="registerLicenseResponse">
<wsdl:part name="registerLicenseReturn"
type="impl:RegistrationResults"/>
</wsdl:message>
<wsdl:portType name="LicenseSystem">
<wsdl:operation name="registerLicense" parameterOrder="in0">
<wsdl:input message="impl:registerLicenseRequest"
name="registerLicenseRequest"/>
<wsdl:output message="impl:registerLicenseResponse"
name="registerLicenseResponse"/>
</wsdl:operation>
</wsdl:portType>
<wsdl:binding name="LicenseSystemSoapBinding"
type="impl:LicenseSystem">
<wsdlsoap:binding style="rpc"
transport="http://schemas.xmlsoap.org/soap/http"/>
<wsdl:operation name="registerLicense">
<wsdlsoap:operation soapAction=""/>
<wsdl:input name="registerLicenseRequest">
<wsdlsoap:body
encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
namespace="urn:ca" use="encoded"/>
</wsdl:input>
<wsdl:output name="registerLicenseResponse">
<wsdlsoap:body
encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
namespace="urn:ca" use="encoded"/>
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
<wsdl:service name="LicenseSystemService">
<wsdl:port binding="impl:LicenseSystemSoapBinding"
name="LicenseSystem">
<wsdlsoap:address
location="http://fries/axis/services/LicenseSystem"/>
</wsdl:port>
</wsdl:service>
</wsdl:definitions>
Thanks in advance.
Re: c++ Axis client -> java Axis webservice
Posted by John Hawkins <HA...@uk.ibm.com>.
Hi,
I think this is our problem with incorrect classpath (must document -
sorry!)
Can you make sure that your axis java jar is 1.2 and that your wsdl2ws jar
file comes before it in the classpath.
John Hawkins
"Jairam,
Roopnaraine"
<Roopnaraine.Jair To
am@ca.com> <ax...@ws.apache.org>
cc
27/09/2004 22:30
Subject
c++ Axis client -> java Axis
Please respond to webservice
"Apache AXIS C
User List"
Hi:
I’m trying to build a c++ client to talk to my java webservice, I used the
java2wsdl tool to generate the wsdl. I then used wsdl2java tool to generate
my server side code. Now I am trying to use wsdl2ws tool to create the
client side code and I get the following error
|--------------------------------------------------------------------------|
|C:\LicenseSystem\client>Java org.apache.axis.wsdl.wsdl2ws.WSDL2Ws abc.wsdl|
|-o./ClientOut -lc++ -sclient -verbose |
|log4j:WARN No appenders could be found for logger |
|(org.apache.axis.i18n.ProjectResourceBundle). |
|log4j:WARN Please initialize the log4j system properly. |
|Exception in thread "main" java.lang.NoSuchMethodError: |
|org.apache.axis.wsdl.symbolTable.ElementDecl.getMinOccrs()I |
| at |
|org.apache.axis.wsdl.wsdl2ws.WSDL2Ws.createTypeInfo(WSDL2Ws.java:689) |
| at |
|org.apache.axis.wsdl.wsdl2ws.WSDL2Ws.getTypeInfo(WSDL2Ws.java:426) |
| at |
|org.apache.axis.wsdl.wsdl2ws.WSDL2Ws.genarateWrappers(WSDL2Ws.java:463) |
| at org.apache.axis.wsdl.wsdl2ws.WSDL2Ws.main(WSDL2Ws.java:796) |
|--------------------------------------------------------------------------|
I was able to use the tool to build Calculator.wsdl client but not my own
code. I have attached the wsdl file for reference. My file using complex
types not sure if this is supported in axis c++.
|--------------------------------------------------------------------------|
|<?xml version="1.0" encoding="UTF-8"?> |
|<wsdl:definitions targetNamespace="urn:ca" xmlns=" |
|http://schemas.xmlsoap.org/wsdl/" xmlns:apachesoap=" |
|http://xml.apache.org/xml-soap" xmlns:impl="urn:ca" xmlns:intf="urn:ca" |
|xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:tns2=" |
|http://objects.ca" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" |
|xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:xsd=" |
|http://www.w3.org/2001/XMLSchema"> |
| <wsdl:types> |
| <schema targetNamespace="http://objects.ca" xmlns=" |
|http://www.w3.org/2001/XMLSchema"> |
| <import namespace="http://schemas.xmlsoap.org/soap/encoding/"/> |
| <complexType name="KeyTableRecord"> |
| <sequence> |
| <element name="nodes" type="xsd:int"/> |
| <element name="startDate" nillable="true" type="xsd:date"/> |
| <element name="vendorName" nillable="true" type="xsd:string"/> |
| <element name="clientID" nillable="true" type="xsd:string"/> |
| <element name="regDate" nillable="true" type="xsd:date"/> |
| <element name="componentCode" nillable="true" type="xsd:string"/> |
| <element name="oemKey" nillable="true" type="xsd:string"/> |
| <element name="expired" type="xsd:boolean"/> |
| <element name="key" nillable="true" type="xsd:string"/> |
| <element name="days" type="xsd:int"/> |
| <element name="companyName" nillable="true" type="xsd:string"/> |
| </sequence> |
| </complexType> |
| <complexType name="ProductTableRecord"> |
| <sequence> |
| <element name="productBuild" type="xsd:int"/> |
| <element name="nodeCount" type="xsd:int"/> |
| <element name="os" nillable="true" type="xsd:string"/> |
| <element name="language" nillable="true" type="xsd:string"/> |
| <element name="clientID" nillable="true" type="xsd:string"/> |
| <element name="productVersion" type="xsd:int"/> |
| <element name="productName" nillable="true" type="xsd:string"/> |
| <element name="productCode" nillable="true" type="xsd:string"/> |
| </sequence> |
| </complexType> |
| <complexType name="ClientTableRecord"> |
| <sequence> |
| <element name="state" nillable="true" type="xsd:string"/> |
| <element name="address2" nillable="true" type="xsd:string"/> |
| <element name="address1" nillable="true" type="xsd:string"/> |
| <element name="country" nillable="true" type="xsd:string"/> |
| <element name="vendorName" nillable="true" type="xsd:string"/> |
| <element name="vendorCode" nillable="true" type="xsd:string"/> |
| <element name="city" nillable="true" type="xsd:string"/> |
| <element name="clientID" nillable="true" type="xsd:string"/> |
| <element name="email" nillable="true" type="xsd:string"/> |
| <element name="zip2" nillable="true" type="xsd:string"/> |
| <element name="zip1" nillable="true" type="xsd:string"/> |
| <element name="companyName" nillable="true" type="xsd:string"/> |
| </sequence> |
| </complexType> |
| </schema> |
| <schema targetNamespace="urn:ca" xmlns="http://www.w3.org/2001/XMLSchema|
|"> |
| <import namespace="http://schemas.xmlsoap.org/soap/encoding/"/> |
| <complexType name="LicenseRegistration"> |
| <sequence> |
| <element name="keyTblRec" nillable="true" |
|type="tns2:KeyTableRecord"/> |
| <element name="productTblRec" nillable="true" |
|type="tns2:ProductTableRecord"/> |
| <element name="clientTblRec" nillable="true" |
|type="tns2:ClientTableRecord"/> |
| </sequence> |
| </complexType> |
| <complexType name="RegistrationResults"> |
| <sequence> |
| <element name="status" type="xsd:int"/> |
| <element name="timeStamp" type="xsd:int"/> |
| <element name="key" nillable="true" type="xsd:string"/> |
| <element name="days" type="xsd:int"/> |
| <element name="clientID" nillable="true" type="xsd:string"/> |
| </sequence> |
| </complexType> |
| </schema> |
| </wsdl:types> |
| |
| <wsdl:message name="registerLicenseRequest"> |
| |
| <wsdl:part name="in0" type="impl:LicenseRegistration"/> |
| |
| </wsdl:message> |
| |
| <wsdl:message name="registerLicenseResponse"> |
| |
| <wsdl:part name="registerLicenseReturn" |
|type="impl:RegistrationResults"/> |
| |
| </wsdl:message> |
| |
| <wsdl:portType name="LicenseSystem"> |
| |
| <wsdl:operation name="registerLicense" parameterOrder="in0"> |
| |
| <wsdl:input message="impl:registerLicenseRequest" |
|name="registerLicenseRequest"/> |
| |
| <wsdl:output message="impl:registerLicenseResponse" |
|name="registerLicenseResponse"/> |
| |
| </wsdl:operation> |
| |
| </wsdl:portType> |
| |
| <wsdl:binding name="LicenseSystemSoapBinding" |
|type="impl:LicenseSystem"> |
| |
| <wsdlsoap:binding style="rpc" transport=" |
|http://schemas.xmlsoap.org/soap/http"/> |
| |
| <wsdl:operation name="registerLicense"> |
| |
| <wsdlsoap:operation soapAction=""/> |
| |
| <wsdl:input name="registerLicenseRequest"> |
| |
| <wsdlsoap:body encodingStyle=" |
|http://schemas.xmlsoap.org/soap/encoding/" namespace="urn:ca" |
|use="encoded"/> |
| |
| </wsdl:input> |
| |
| <wsdl:output name="registerLicenseResponse"> |
| |
| <wsdlsoap:body encodingStyle=" |
|http://schemas.xmlsoap.org/soap/encoding/" namespace="urn:ca" |
|use="encoded"/> |
| |
| </wsdl:output> |
| |
| </wsdl:operation> |
| |
| </wsdl:binding> |
| |
| <wsdl:service name="LicenseSystemService"> |
| |
| <wsdl:port binding="impl:LicenseSystemSoapBinding" |
|name="LicenseSystem"> |
| |
| <wsdlsoap:address location=" |
|http://fries/axis/services/LicenseSystem"/> |
| |
| </wsdl:port> |
| |
| </wsdl:service> |
| |
|</wsdl:definitions> |
|--------------------------------------------------------------------------|
Thanks in advance.(See attached file: abc.wsdl)