SOAP Newbie Help

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Trying to figure out how to create the proper SOAP request for WSDL.  Below
is the definition from generateProxyCode().  Can't figure out how to create
$basket parameter.  Any help would be appreciated.

    function &getExchangeQuote($merchantAccessCode, $sessionID, $basket) {
        // basket is a ComplexType Basket,
        //refer to wsdl for more info
        $basket =& new
SOAP_Value('basket','{http://www.themindelectric.com/package/com.borderfree.
api.client/}Basket',$basket);
        return $this->call("getExchangeQuote",
                        $v =
array("merchantAccessCode"=>$merchantAccessCode, "sessionID"=>$sessionID,
"basket"=>$basket),
                        array('namespace'=>'http://www.borderfree.com',
                            'soapaction'=>'getExchangeQuote',
                            'style'=>'rpc',
                            'use'=>'encoded' ));
    }


WSDL definition:

- <xsd:complexType name="Basket">
- <xsd:all>
  <xsd:element name="countryOfPurchase" nillable="true" type="xsd:string" />
  <xsd:element name="countryOfDestination" nillable="true" type="xsd:string"
/>
  <xsd:element name="merchantWebRefNum" nillable="true" type="xsd:string" />
  <xsd:element name="taxes" nillable="true" type="n10:ArrayOfTax" />
  <xsd:element name="discounts" nillable="true" type="n10:ArrayOfDiscount"
/>
  <xsd:element name="items" nillable="true" type="n10:ArrayOfBasketItem" />
  <xsd:element name="orderValue" type="xsd:decimal" />
  </xsd:all>
  </xsd:complexType>
- <xsd:complexType name="Tax">
- <xsd:all>
  <xsd:element name="type" nillable="true" type="xsd:string" />
  <xsd:element name="name" nillable="true" type="xsd:string" />
  <xsd:element name="location" nillable="true" type="xsd:string" />
  <xsd:element name="value" type="xsd:decimal" />
  </xsd:all>
  </xsd:complexType>
- <xsd:complexType name="ArrayOfTax">
- <xsd:complexContent>
- <xsd:restriction base="soapenc:Array">
  <xsd:attribute ref="soapenc:arrayType" wsdl:arrayType="n10:Tax[]" />
  </xsd:restriction>
  </xsd:complexContent>
  </xsd:complexType>
- <xsd:complexType name="Discount">
- <xsd:all>
  <xsd:element name="type" nillable="true" type="xsd:string" />
  <xsd:element name="name" nillable="true" type="xsd:string" />
  <xsd:element name="discount" type="xsd:decimal" />
  </xsd:all>
  </xsd:complexType>
- <xsd:complexType name="ArrayOfDiscount">
- <xsd:complexContent>
- <xsd:restriction base="soapenc:Array">
  <xsd:attribute ref="soapenc:arrayType" wsdl:arrayType="n10:Discount[]" />
  </xsd:restriction>
  </xsd:complexContent>
  </xsd:complexType>
- <xsd:complexType name="BasketItem">
- <xsd:all>
  <xsd:element name="lineNumber" nillable="true" type="soapenc:int" />
  <xsd:element name="id" nillable="true" type="xsd:string" />
  <xsd:element name="linkedID" nillable="true" type="xsd:string" />
  <xsd:element name="name" nillable="true" type="xsd:string" />
  <xsd:element name="url" nillable="true" type="xsd:string" />
  <xsd:element name="description" nillable="true" type="xsd:string" />
  <xsd:element name="categoryID" nillable="true" type="xsd:string" />
  <xsd:element name="type" nillable="true" type="xsd:string" />
  <xsd:element name="additionalShipping" type="xsd:decimal" />
  <xsd:element name="additionalHandling" type="xsd:decimal" />
  <xsd:element name="unitPrice" type="xsd:decimal" />
  <xsd:element name="discount" type="xsd:decimal" />
  <xsd:element name="size" nillable="true" type="xsd:string" />
  <xsd:element name="color" nillable="true" type="xsd:string" />
  <xsd:element name="attributes" nillable="true" type="n11:Hashtable" />
  </xsd:all>
  </xsd:complexType>
- <xsd:complexType name="ArrayOfBasketItem">
- <xsd:complexContent>
- <xsd:restriction base="soapenc:Array">
  <xsd:attribute ref="soapenc:arrayType" wsdl:arrayType="n10:BasketItem[]"
/>
  </xsd:restriction>
  </xsd:complexContent>
  </xsd:complexType>

Thanks,
Roger Ferber

-- 
PHP Soap Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [PHP Users]     [Kernel Newbies]     [PHP Database]     [Yosemite]

  Powered by Linux