Hi all,
I'm trying to make a C client to connect to a SOAP Server by generating
code using the WSDL2C tool.
But I'm having some problems :)
I get the following exception when running
java org.apache.axis2.wsdl.WSDL2C -uri sipxcallresolver.wsdl
:
Exception in thread "main"
org.apache.axis2.wsdl.codegen.CodeGenerationException: Error parsing WSDL
at
org.apache.axis2.wsdl.codegen.CodeGenerationEngine.<init>(CodeGenerationEngine.java:147)
at org.apache.axis2.wsdl.WSDL2Code.main(WSDL2Code.java:35)
at org.apache.axis2.wsdl.WSDL2C.main(WSDL2C.java:31)
Caused by: org.apache.axis2.AxisFault: Encoded use is not supported
at org.apache.axis2.AxisFault.makeFault(AxisFault.java:417)
at
org.apache.axis2.description.WSDL11ToAxisServiceBuilder.populateService(WSDL11ToAxisServiceBuilder.java:291)
at
org.apache.axis2.description.WSDL11ToAllAxisServicesBuilder.populateAllServices(WSDL11ToAllAxisServicesBuilder.java:109)
at
org.apache.axis2.wsdl.codegen.CodeGenerationEngine.<init>(CodeGenerationEngine.java:141)
... 2 more
Caused by:
org.apache.axis2.description.WSDL11ToAxisServiceBuilder$WSDLProcessingException:
Encoded use is not supported
at
org.apache.axis2.description.WSDL11ToAxisServiceBuilder.getPartsListFromSoapBody(WSDL11ToAxisServiceBuilder.java:1777)
at
org.apache.axis2.description.WSDL11ToAxisServiceBuilder.createSchemaForPorttype(WSDL11ToAxisServiceBuilder.java:1528)
at
org.apache.axis2.description.WSDL11ToAxisServiceBuilder.generateWrapperSchema(WSDL11ToAxisServiceBuilder.java:1431)
at
org.apache.axis2.description.WSDL11ToAxisServiceBuilder.populateService(WSDL11ToAxisServiceBuilder.java:255)
... 4 more
Apparently this exception is caused by the encoding of the file. But I
don't know how to get around this issue.
Maybe you can help.
I've attached the wsdl file to the e-mail (sipxcallresolver.wsdl).
I also want to tell that I'm new to WS. I just want to get some data
from the SOAP server to put in a net-snmp agent response.
I really have no background with this, so please be gentle :)
I also want to mention that another application uses axis(1) to generate
java code to connect to the same SOAP server and everything works fine.
I've also tried to generate C code with axis 1, but I get all kinds of
error. I've also attached the errors from compiling the axis 1 generated
files (errors.txt) along with my main program (testSOAP.c).
The SOAP server is implemented in ruby. You can find the server sources
here:
http://sipxecs.sipfoundry.org/rep/sipXecs/main/sipXproxy/src/cdr/lib/soap/
Thanks in advance,
Andrei
<?xml version="1.0"?>
<definitions xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:tns="urn:CdrService"
xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:si="http://soapinterop.org/xsd"
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
xmlns="http://schemas.xmlsoap.org/wsdl/" targetNamespace="urn:CdrService">
<types>
<xsd:schema targetNamespace="urn:CdrService">
<xsd:complexType name="ArrayOfActiveCalls">
<xsd:complexContent>
<xsd:restriction base="SOAP-ENC:Array">
<xsd:attribute ref="SOAP-ENC:arrayType" wsdl:arrayType="tns:ActiveCall[]" />
</xsd:restriction>
</xsd:complexContent>
</xsd:complexType>
<xsd:complexType name="ActiveCall">
<xsd:sequence>
<xsd:element name="from" type="xsd:string" minOccurs="1" maxOccurs="1" />
<xsd:element name="to" type="xsd:string" minOccurs="1" maxOccurs="1" />
<xsd:element name="duration" type="xsd:long" minOccurs="1" maxOccurs="1" />
<xsd:element name="start_time" type="xsd:dateTime" minOccurs="1" maxOccurs="1" />
</xsd:sequence>
</xsd:complexType>
</xsd:schema>
</types>
<message name="getActiveCallsResponse">
<part name="getActiveCallsResponse" type="tns:ArrayOfActiveCalls"></part>
</message>
<message name="getActiveCallsRequest"></message>
<portType name="CdrService">
<operation name="getActiveCalls">
<input message="tns:getActiveCallsRequest"></input>
<output message="tns:getActiveCallsResponse"></output>
</operation>
</portType>
<binding name="CdrBinding" type="tns:CdrService">
<soap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http" />
<operation name="getActiveCalls">
<soap:operation soapAction="urn:CdrService#getActiveCalls" style="rpc" />
<input>
<soap:body use="encoded" namespace="urn:CdrService"
encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" />
</input>
<output>
<soap:body use="encoded" namespace="urn:CdrService"
encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" />
</output>
</operation>
</binding>
<service name="CdrImplService">
<documentation>Realtime statistics of on-going calls as monitored by CDR resolver.</documentation>
<port name="CdrService" binding="tns:CdrBinding">
<soap:address location="http://localhost:2010/" />
</port>
</service>
</definitions>
testSOAP.c: In function âmainâ:
testSOAP.c:18: warning: initialization makes pointer from integer without a cast
CdrService.c:8: error: expected declaration specifiers or â...â before
âIWrapperSoapDeSerializerâ
CdrService.c:9: error: expected declaration specifiers or â...â before
âboolâ
CdrService.c:10: error: expected declaration specifiers or â...â before
âboolâ
CdrService.c:11: error: expected declaration specifiers or â...â before
âIWrapperSoapSerializerâ
CdrService.c:11: error: expected declaration specifiers or â...â before
âboolâ
CdrService.c: In function âget_CdrService_stubâ:
CdrService.c:17: error: âAPTHTTP1_1â undeclared (first use in this function)
CdrService.c:17: error: (Each undeclared identifier is reported only once
CdrService.c:17: error: for each function it appears in.)
CdrService.c:17: warning: return makes pointer from integer without a cast
CdrService.c:21: warning: return makes pointer from integer without a cast
CdrService.c: In function âget_CdrService_Statusâ:
CdrService.c:28: error: âCallâ undeclared (first use in this function)
CdrService.c:28: error: âpCallâ undeclared (first use in this function)
CdrService.c:28: error: expected expression before â)â token
CdrService.c:29: error: âAXIS_SUCCESSâ undeclared (first use in this
function)
CdrService.c: In function âgetActiveCallsâ:
CdrService.c:39: error: âCallâ undeclared (first use in this function)
CdrService.c:39: error: âpCallâ undeclared (first use in this function)
CdrService.c:39: error: expected expression before â)â token
CdrService.c:40: warning: excess elements in struct initializer
CdrService.c:40: warning: (near initialization for âRetArrayâ)
CdrService.c:41: error: âAxis_Arrayâ undeclared (first use in this function)
CdrService.c:41: error: expected â;â before âarrayâ
CdrService.c:43: error: âAXIS_SUCCESSâ undeclared (first use in this
function)
CdrService.c:44: error: âSOAPACTION_HEADERâ undeclared (first use in this
function)
CdrService.c:51: error: âarrayâ undeclared (first use in this function)
ActiveCall.c:37: error: expected declaration specifiers or â...â before
âIWrapperSoapSerializerâ
ActiveCall.c:37: error: expected declaration specifiers or â...â before
âboolâ
ActiveCall.c: In function âAxis_Serialize_ActiveCallâ:
ActiveCall.c:39: error: expected â=â, â,â, â;â, âasmâ or
â__attribute__â before â*â token
ActiveCall.c:39: error: âsPrefixâ undeclared (first use in this function)
ActiveCall.c:39: error: (Each undeclared identifier is reported only once
ActiveCall.c:39: error: for each function it appears in.)
ActiveCall.c:40: error: âbArrayâ undeclared (first use in this function)
ActiveCall.c:42: error: âpSZâ undeclared (first use in this function)
ActiveCall.c:56: error: âAXIS_SUCCESSâ undeclared (first use in this
function)
ActiveCall.c: At top level:
ActiveCall.c:62: error: expected declaration specifiers or â...â before
âIWrapperSoapDeSerializerâ
ActiveCall.c: In function âAxis_DeSerialize_ActiveCallâ:
ActiveCall.c:64: error: âpDZâ undeclared (first use in this function)
ActiveCall.c: At top level:
ActiveCall.c:70: error: expected declaration specifiers or â...â before
âboolâ
ActiveCall.c: In function âAxis_Create_ActiveCallâ:
ActiveCall.c:73: error: âbArrayâ undeclared (first use in this function)
ActiveCall.c: At top level:
ActiveCall.c:92: error: expected declaration specifiers or â...â before
âboolâ
ActiveCall.c: In function âAxis_Delete_ActiveCallâ:
ActiveCall.c:94: error: âbArrayâ undeclared (first use in this function)
#include <stdio.h>
#include <stdlib.h>
#include "CdrService.h"
#include "ActiveCall_Array.h"
#include "ActiveCall.h"
/*
extern AXISCHANDLE get_CdrService_stub(const char* pchEndPointUri);
extern void destroy_CdrService_stub(AXISCHANDLE pStub);
extern int get_CdrService_Status(AXISCHANDLE pStub);
extern ActiveCall_Array getActiveCalls(AXISCHANDLE pStub);
*/
int main(void)
{
AXISCHANDLE axch = getCdrService(NULL);
int status = get_CdrService_Status(axch);
printf("status = %d\n", status);
destroy_CdrService_stub(axch);
printf("exit\n");
}
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]