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]

Reply via email to