Send attributes to WSDL

Help
Nats
2012-03-22
2013-06-06
  • Nats
    Nats
    2012-03-22

    Hello,

    I'm new to Nusoap. I want to interract with a distant website which gave me its wsdl.
    I want to retrieve my orders from the website.
    Here's the method as describe in the wsdl

    <wsdl:operation name="RetrieveSellerOrder_2.0Op">
                <wsdl:input message="tns:RetrieveSellerOrderRequest_2.0"/>
                <wsdl:output message="tns:RetrieveSellerOrderResponse_2.0"/>
                <wsdl:fault name="fault1" message="tns:Fault_1.0"/>
            </wsdl:operation>
    

    Here are the attributes required for this operation as described in the wsdl too

    <xs:complexType name="Request">
                    <xs:attribute name="HubID" use="required">
                        <xs:annotation>
                            <xs:documentation xml:lang="en">Value fixed by La Redoute</xs:documentation>
                        </xs:annotation>
                        <xs:simpleType>
                            <xs:restriction base="xs:string">
                                <xs:maxLength value="8"/>
                                <xs:minLength value="1"/>
                                <xs:pattern value="([0-9])+"/>
                            </xs:restriction>
                        </xs:simpleType>
                    </xs:attribute>
                    <xs:attribute name="MessageDate" use="required" type="xs:dateTime">
                        <xs:annotation>
                            <xs:documentation xml:lang="en">Date and time of the message</xs:documentation>
                        </xs:annotation>
                    </xs:attribute>
                    <xs:attribute name="MessageRelease" fixed="2.0" use="required" type="xs:string">
                        <xs:annotation>
                            <xs:documentation>Version number of the message</xs:documentation>
                        </xs:annotation>
                    </xs:attribute>
                    <xs:attribute name="SellerID" use="required">
                        <xs:annotation>
                            <xs:documentation>Value fixed by La Redoute</xs:documentation>
                        </xs:annotation>
                        <xs:simpleType>
                            <xs:restriction base="xs:string">
                                <xs:minLength value="1"/>
                                <xs:maxLength value="8"/>
                                <xs:pattern value="([0-9])+"/>
                            </xs:restriction>
                        </xs:simpleType>
                    </xs:attribute>
                </xs:complexType>
    

    This what I do to use this action

    $now = date('Y-m-d\TH:i:s');
    $client = new nusoap_client_mime('laredoute-order.wsdl', true);
    $client->soap_defencoding = 'utf-8';
    $params = array(
        'HubID' => '5',
        'SellerID' => $e_user_id,
        'MessageDate' => $now,
        'MessageRelease' => '2.0',
        'OrderID' => $orderId,
    );
    $result = $client->call('RetrieveSellerOrder_2.0Op', $params);
    

    Here's a part of my message error

    caused by: org.xml.sax.SAXException: validation error: attribute "HubID" is required   ({com.tibco.xml.validation}COMPLEX_E_MISSING_ATTRIBUTE) at /{http://Redcats/Order/SellerOrder/2.0}RetrieveSellerOrderRequest_2.0[1]/parameters[1]/RetrieveSellerOrderRequest_2.0[1]
    com.tibco.xml.validation.exception.MissingAttributesException: attribute "HubID" is required
    

    Telling me HubID attribute is required whereas I sent it .

    Could you tell me what i do wrong?

    Thanks in advance