Unable to load propery order "orderDetails"

Oct 19, 2009 at 6:13 PM

Attempting to load orderDetails for an order fails. The generated query
with orderId=1 fails but works when manually issued with orderId=1L.

I would apprecate any suggestions, Thanks, Vince...


--> The following line works and generates the request : GET /vvvvRestSVT2/vvvNorthwindSVTDataService.svc/Customer(customerId='VP1')/orders HTTP/1.1
    $proxy->LoadProperty($customer, "orders")
    foreach($customer->orders as $order) {
------> The following line generates the follwing request which fails : GET /vvvRestSVT2/vvvNorthwindSVTDataService.svc/Order(customerId='VP1',orderId=1)/orderDetails HTTP/1.1
------> When I manually issue request with orderID as long L it works : GET /vvvRestSVT2/vvvNorthwindSVTDataService.svc/Order(customerId='VP1',orderId=1L)/orderDetails HTTP/1.1
        $proxy->LoadProperty($order, "orderDetails");

The metadata shows orderID as a long Type="Edm.Int64"

- <EntityType Name="Order">
- <Key>
  <PropertyRef Name="customerId" />
  <PropertyRef Name="orderId" />
  </Key>
  <Property Name="customerId" Type="Edm.String" Nullable="false" MaxLength="254" Unicode="false" FixedLength="false" />
  <Property Name="orderId" Type="Edm.Int64" Nullable="false" />
  <Property Name="orderDate" Type="Edm.DateTime" Nullable="true" />
  <Property Name="shipCity" Type="Edm.String" Nullable="true" MaxLength="254" Unicode="false" FixedLength="false" />
  <Property Name="shipCountry" Type="Edm.String" Nullable="true" MaxLength="254" Unicode="false" FixedLength="false" />
  <Property Name="version" Type="Edm.Int32" Nullable="true" />
  <NavigationProperty Name="customer" Relationship="NWSVTModel.CustomerOrder" FromRole="Order" ToRole="Customer" />
  <NavigationProperty Name="orderDetails" Relationship="NWSVTModel.OrderOrderDetail" FromRole="Order" ToRole="OrderDetail" />
  </EntityType>

- <EntityType Name="OrderDetail">
- <Key>
  <PropertyRef Name="order_customerId" />
  <PropertyRef Name="order_orderId" />
  <PropertyRef Name="productId" />
  </Key>
  <Property Name="order_customerId" Type="Edm.String" Nullable="false" MaxLength="254" Unicode="false" FixedLength="false" />
  <Property Name="order_orderId" Type="Edm.Int64" Nullable="false" />
  <Property Name="productId" Type="Edm.Int32" Nullable="false" />
  <Property Name="categoryId" Type="Edm.Int32" Nullable="true" />
  <Property Name="discount" Type="Edm.Single" Nullable="true" />
  <Property Name="quantity" Type="Edm.Int16" Nullable="true" />
  <Property Name="unitPrice" Type="Edm.Double" Nullable="true" />
  <Property Name="version" Type="Edm.Int32" Nullable="true" />
  <NavigationProperty Name="order" Relationship="NWSVTModel.OrderOrderDetail" FromRole="OrderDetail" ToRole="Order" />
  </EntityType>

Oct 19, 2009 at 7:30 PM

Looking at the original Northwinds Data Service I see that the OrderID was Type="Edm.Int32".
In the service I am using I see that it is Type="Edm.Int64". Peeking at
adodotnetservcesphp\Contect\ObjectContext.php LoadProperty() function I see that it is
really generating a query.  I have been able to workaround the support issue of int vs long
by generating my own query and working with the result.  Is this something that will be
supported in the future?

   //$proxy->LoadProperty($order, "orderDetails");
   $orderDetailResult = $proxy->ExecuteQuery("Order(customerId='".$customerId."',orderId=".$order->orderId."L)/orderDetails");