2

I'm calling a SAP PI web service via WCF.

I import the service reference, instance the data object and set all data, wich types are showing correctly.

But when i try to generate the SOAP envelope in the Test Client, none of the INT and DATE data fields are generated, so, i'm not sending none of this data types.

Here is a sample of the WSDL i'm consuming:

<wsdl:definitions name="itfGRHU_Dados_Candidatos_Out_Sync" targetNamespace="http://www.xxx.com/Vagas_to_SAP/Envio_Dados_Candidatos" xmlns:p1="http://www.xxx.com/Vagas_to_SAP/Envio_Dados_Candidatos" xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">
    <wsdl:documentation/>
    <wsdl:types>
        <xsd:complexType name="dtpGRHU_Dados_Candidatos_Campos">
            <xsd:annotation>
                <xsd:appinfo source="http://sap.com/xi/VersionID">5e84228c1f7111e1b60a0000125697d2</xsd:appinfo>
            </xsd:annotation>
            <xsd:sequence>
                <xsd:element name="IT4002_OBJID" minOccurs="0">
                    <xsd:annotation>
                        <xsd:appinfo source="http://sap.com/xi/TextID">643fdb0b1f5011e1c09c70f1a13bc69d</xsd:appinfo>
                        <xsd:documentation>Vaga</xsd:documentation>
                    </xsd:annotation>
                    <xsd:simpleType>
                        <xsd:restriction base="xsd:int">
                            <xsd:totalDigits value="8"/>
                        </xsd:restriction>
                    </xsd:simpleType>
                </xsd:element>
                <xsd:element name="IT0002_GBDAT" type="xsd:date" minOccurs="0">
                    <xsd:annotation>
                        <xsd:appinfo source="http://sap.com/xi/TextID">64402abe1f5011e1acf970f1a13bc69d</xsd:appinfo>
                        <xsd:documentation>Data de Nascimento</xsd:documentation>
                    </xsd:annotation>
                </xsd:element>
            </xsd:sequence>
        </xsd:complexType>
    </wsdl:types>
</wsdl:definitions>

Thanks.

Carlos ABS
  • 693
  • 9
  • 19
  • 1
    I remember having great issues with SAP schema and Biztalk. Every field is marked as optional ( minOccurs="0" ). Try altering the cardinality on your imported WSDL for the IT4002_OBJID and IT0002_GBDAT elements and see if that makes a difference – Robert Slaney Mar 15 '12 at 03:02
  • Can you show us the **generated class** in C# (or VB.NET) that you use to create this request?? – marc_s Mar 15 '12 at 06:09
  • @RobertSlaney that's the answer! Thanks! – Carlos ABS Mar 20 '12 at 12:18
  • See if http://stackoverflow.com/questions/7263232/web-service-not-returning-integer-data-in-an-object applies, even though it's about asmx. – John Saunders Mar 20 '12 at 12:41
  • Yes, same problem, there the solution was proposed in the code, here in the wsdl. http://stackoverflow.com/questions/1184245/vs2003-web-reference-for-a-wcf-service-has-extra-idspecified-parameter – Carlos ABS Mar 20 '12 at 12:49

1 Answers1

0

Changing the cardinality (minOccurs="0") on the imported WSDL, as suggested by @robertslaney, solved this issue.

Carlos ABS
  • 693
  • 9
  • 19