×

Discussion Board

Results 1 to 3 of 3
  1. #1
    Registered User
    Join Date
    Oct 2008
    Posts
    3

    WSDL-to-C++, complexType and ProcessOutgoingMessageLC()

    Hi,

    im trying to connect to a web service using the generated classes from the WSDL-to-C++ Wizard.
    The wsdl file describes many different elements of a complex type, that could occur in a request or response message (each is defined as minOccurs="0").
    So far it seems, I have to put all elements in a request message, even if they contain no values.
    Leaving out an element results in an error (-23654 KErrDataInvalidContent) in the Xsd::SenOps::ProcessOutgoingMessageLC() method.

    The following part of a wsdl file shows an example of the structure of the different elements.
    Code:
    <xs:element name="sayHelloWorldFrom">
     <xs:complexType>
      <xs:sequence>
       <xs:element minOccurs="0" name="from" type="fromType"/>
      </xs:sequence>
     </xs:complexType>
    </xs:element>
    
    <xs:complexType name="fromType">
     <xs:complexContent>
      <xs:sequence>
       <xs:element minOccurs="0" name="fromAnother" nillable="true" type="fromAnotherType"/>
      </xs:sequence>
     </xs:complexContent>
    </xs:complexType>
    
    <xs:complexType name="fromAnotherType">
     <xs:complexContent>
      <xs:sequence>
       <xs:element minOccurs="0" name="fromName" type="xs:string"/>
      </xs:sequence>
     </xs:complexContent>
    </xs:complexType>
    This is the code to set up the request.
    Code:
    HBufC* from = HBufC::NewL(20);
    *from = _L("Somebody");
    RSayHelloWorldFrom sayHello;
    sayHello.iFrom = Xsd::RNullablePtr<RFromType>(new (ELeave)RFromType());
    sayHello.iFrom->iFromAnother = Xsd::RNullablePtr<RFromAnotherType>(new (ELeave)RFromAnotherType());
    sayHello.iFrom->iFromAnother->iFromName = from;
    This is the resulting request message (looks good).
    Code:
    <S:Body>
    <xdb:sayHelloWorldFrom xmlns:xdb="http://fh-hannover.de/">
    <xdb:from>
    <xdb:fromAnother>
    <xdb:fromName>Somebody</xdb:fromName>
    </xdb:fromAnother>
    </xdb:from>
    </xdb:sayHelloWorldFrom>
    </S:Body>
    setting the iFromName to NULL, also works
    Code:
    sayHello.iFrom->iFromAnother->iFromName = NULL;
    this is the resulting request.
    Code:
    <S:Body>
    <xdb:sayHelloWorldFrom xmlns:xdb="http://fh-hannover.de/">
    <xdb:from>
    <xdb:fromAnother/>
    </xdb:from>
    </xdb:sayHelloWorldFrom>
    </S:Body>
    But I need to set up a request like this:
    Code:
    <S:Body>
    <xdb:sayHelloWorldFrom xmlns:xdb="http://fh-hannover.de/">
    <xdb:from/>
    </xdb:sayHelloWorldFrom>
    </S:Body>
    So I expected this code would work, but it results in the error KErrDataInvalidContent.
    Code:
    RSayHelloWorldFrom sayHello;
    sayHello.iFrom = Xsd::RNullablePtr<RFromType>(new (ELeave)RFromType());
    sayHello.iFrom->iFromAnother = NULL;
    For this example it is not a big problem to set up all elements in the request message, but I need to use a web service, which defines about 50 different elements, but only a few of them contain data in a request.
    So setting up all possible elements would result in a big overhead in the request message, as in the code.

    Why is it possible to set a NULL value for an element of a standard type (for example xs:string) but not for a complex type (e.g. fromAnotherType)?

    As the name RNullablePtr says, I would expect that this pointer could point to a NULL value, can anybody explain the RNullablePtr and the usage of the generated classes from the wizard more detailed?

    Thanks in advance.

  2. #2
    Registered User
    Join Date
    Aug 2008
    Posts
    64

    Re: WSDL-to-C++, complexType and ProcessOutgoingMessageLC()

    hi:
    do you find the solution? I encounted the same problem.can you give me some hint?thank you in advance!

    dai

  3. #3
    Registered User
    Join Date
    Oct 2008
    Posts
    3

    Re: WSDL-to-C++, complexType and ProcessOutgoingMessageLC()

    Hi,

    I did not find a solution, so I used gSOAP instead of the web service framework. In my case, this approach works without any problems.

    Hope I could help you.
    Jenne

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×