• brad4d
  • NEWBIE
  • 0 Points
  • Member since 2008

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 2
    Questions
  • 11
    Replies
I'm having some trouble navigating relationships within a SOQL query.  The following query works:
    "Select Id, (Select Duration__c From PayCodeEdits__r) from Worker__c"

where as this one doesn't:

SELECT id, PayCodeEdits__r.Duration__c FROM Worker__c


problem is that I need to be able to filter the output on the relationship thusly:

SELECT id, PayCodeEdits__r.Duration__c FROM Worker__c Where PayCodeEdits__r.Duration__c = 4

that doesn't work and I can't figure out how to make that filter appear in the working syntax
  • February 06, 2008
  • Like
  • 0
    I am using the following wsdl:
Code:
  <—xml version="1.0" encoding="UTF-8" –> 
- <!--  Published by JAX-WS RI at http://jax-ws.dev.java.net. RI's version is JAX-WS RI 2.1.2-b05-RC1. 
  --> 
- <definitions xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns="http://schemas.xmlsoap.org/wsdl/" xmlns:tns="urn:specific_calculator-services-kronos-com:specific_calculator" xmlns:xs="http://www.w3.org/2001/XMLSchema" targetNamespace="urn:specific_calculator-services-kronos-com:specific_calculator" name="SpecificCalculatorService">
- <types>
- <xs:schema xmlns="http://www.w3.org/2001/XMLSchema" targetNamespace="urn:specific_calculator-services-kronos-com:specific_calculator" elementFormDefault="unqualified" attributeFormDefault="unqualified">
- <!--  a name value pair used to add custom attributes to punches, pay code edits, scheduled_shifts, and others. These values assist the rules to make their decisions.
  --> 
- <xs:complexType name="TagType">
- <xs:sequence>
- <!--  categorization for tags. e.g. pay_category, pay_code, cost_center, exception
  --> 
  <xs:element name="name" type="xs:string" /> 
- <!--  tag value. e.g. regular, break, lunch, deli, late_in, very_late_out
  --> 
  <xs:element name="value" type="xs:string" /> 
  </xs:sequence>
  </xs:complexType>
- <!--  A quantity and units. (aka value). This typically denotes the duration for a block of time. Also the quantity for a total
  --> 
- <xs:complexType name="QuantityType">
- <xs:sequence>
- <!--  numerical value
  --> 
  <xs:element name="amount" type="xs:double" /> 
- <!--  change back to unitsType
  --> 
  <xs:element name="units" type="xs:string" minOccurs="0" maxOccurs="1" /> 
  </xs:sequence>
  </xs:complexType>
- <!--  
The Engine assigns values denoting quantities of time. e.g. Regular=5 hrs, Late=5 times to a pay category.
These are typically the durations for a particular scheduled block of time or period block of time.

  --> 
- <xs:complexType name="TotalType">
- <xs:sequence>
- <!--  Effective date. change back to date
  --> 
  <xs:element name="effective_date" type="xs:dateTime" /> 
- <!--  actual, scheduled, or projected. change back to total_type
  --> 
  <xs:element name="total_type" type="xs:string" /> 
- <!--  type of pay for employee
  --> 
  <xs:element name="pay_code" type="xs:string" /> 
- <!--  total value. (has amount and units)
  --> 
  <xs:element name="quantity" type="tns:QuantityType" /> 
  </xs:sequence>
  </xs:complexType>
- <!--  
punches in the clock or modified by the manager

  --> 
- <xs:complexType name="PunchType">
- <xs:sequence>
  <xs:element name="id" type="xs:string" /> 
  <xs:element name="effective_date" type="xs:dateTime" /> 
- <!--  change back to punch_direction
  --> 
  <xs:element name="punch_direction" type="xs:string" /> 
  </xs:sequence>
  </xs:complexType>
- <!--  
Work that was actually done.

  --> 
- <xs:complexType name="PayCodeEditType">
- <xs:sequence>
  <xs:element name="id" type="xs:string" /> 
  <xs:element name="pay_code_category" type="xs:string" minOccurs="0" maxOccurs="1" /> 
  <xs:element name="pay_code" type="xs:string" minOccurs="0" maxOccurs="1" /> 
- <!--  start time. typically populated
  --> 
  <xs:element name="start_date" type="xs:dateTime" minOccurs="0" maxOccurs="1" /> 
- <!--  end time. typically populated or duration
  --> 
  <xs:element name="end_date" type="xs:dateTime" minOccurs="0" maxOccurs="1" /> 
- <!--  length of this pay_code_edit
  --> 
  <xs:element name="duration" type="tns:QuantityType" minOccurs="0" maxOccurs="1" /> 
  </xs:sequence>
  </xs:complexType>
- <xs:complexType name="BreaksType">
- <xs:sequence>
  <xs:element name="id" type="xs:string" /> 
  <xs:element name="pay_code" type="xs:string" minOccurs="0" maxOccurs="1" /> 
- <!--  start time. typically populated
  --> 
  <xs:element name="start_date" type="xs:dateTime" minOccurs="0" maxOccurs="1" /> 
- <!--  end time. typically populated or duration
  --> 
  <xs:element name="end_date" type="xs:dateTime" minOccurs="0" maxOccurs="1" /> 
- <!--  length of this shift
  --> 
  <xs:element name="duration" type="tns:QuantityType" minOccurs="0" maxOccurs="1" /> 
  </xs:sequence>
  </xs:complexType>
- <xs:complexType name="ExceptionType">
- <xs:sequence>
  <xs:element name="rule_id" type="xs:string" /> 
- <!--  id into resource bundle
  --> 
  <xs:element name="resource_name" type="xs:string" /> 
  </xs:sequence>
  </xs:complexType>
- <xs:complexType name="ScheduledShiftType">
- <xs:sequence>
  <xs:element name="id" type="xs:string" minOccurs="0" maxOccurs="1" /> 
  <xs:element name="pay_code_category" type="xs:string" minOccurs="0" maxOccurs="1" /> 
  <xs:element name="pay_code" type="xs:string" minOccurs="0" maxOccurs="1" /> 
- <!--  start time. typically populated
  --> 
  <xs:element name="start_date" type="xs:dateTime" minOccurs="0" maxOccurs="1" /> 
- <!--  end time. typically populated or duration
  --> 
  <xs:element name="end_date" type="xs:dateTime" minOccurs="0" maxOccurs="1" /> 
- <!--  length of this shift.
  --> 
  <xs:element name="duration" type="tns:QuantityType" minOccurs="0" maxOccurs="1" /> 
- <!--  breaks during this shift
  --> 
  <xs:element name="breaks" type="tns:BreaksType" minOccurs="0" maxOccurs="unbounded" /> 
  </xs:sequence>
  </xs:complexType>
- <xs:complexType name="ComputedPunchType">
- <xs:sequence>
  <xs:element name="id" type="xs:string" /> 
- <!--  exceptions on this punch
  --> 
  <xs:element name="exceptions" type="tns:ExceptionType" minOccurs="0" maxOccurs="unbounded" /> 
  </xs:sequence>
  </xs:complexType>
- <xs:complexType name="ComputedPayCodeEditType">
- <xs:sequence>
  <xs:element name="id" type="xs:string" /> 
- <!--  exceptions on this pay_code_edit
  --> 
  <xs:element name="exceptions" type="tns:ExceptionType" minOccurs="0" maxOccurs="unbounded" /> 
  </xs:sequence>
  </xs:complexType>
- <xs:complexType name="ComputedBreakType">
- <xs:sequence>
  <xs:element name="id" type="xs:string" /> 
  <xs:element name="pay_code" type="xs:string" minOccurs="0" maxOccurs="1" /> 
- <!--  computed start time. populated if break taken
  --> 
  <xs:element name="start_date" type="xs:dateTime" minOccurs="0" maxOccurs="1" /> 
- <!--  computed end time. populated if taken (no duration)
  --> 
  <xs:element name="end_date" type="xs:dateTime" minOccurs="0" maxOccurs="1" /> 
- <!--  punch that starts this break
  --> 
  <xs:element name="start_punch" type="tns:ComputedPunchType" minOccurs="0" maxOccurs="1" /> 
- <!--  punch that ends this break
  --> 
  <xs:element name="end_punch" type="tns:ComputedPunchType" minOccurs="0" maxOccurs="1" /> 
- <!--  exceptions on this break.
  --> 
  <xs:element name="exceptions" type="tns:ExceptionType" minOccurs="0" maxOccurs="unbounded" /> 
- <!--  
The Engine assigns values denoting quantities of time. e.g. Regular=5 hrs, Late=5 times to a pay category.
These are typically the durations for a particular scheduled block of time or period block of time.

  --> 
  <xs:element name="totals" type="tns:TotalType" minOccurs="0" maxOccurs="unbounded" /> 
  </xs:sequence>
  </xs:complexType>
- <!--   The schedule blocks of time that are populated with exceptions, flags (containing pay categories), actuals, and all sorts of entries.
Possibly contains newly created blocks of time that are not scheduled.

  --> 
- <xs:complexType name="ComputedShiftType">
- <xs:sequence>
  <xs:element name="id" type="xs:string" /> 
  <xs:element name="pay_code_category" type="xs:string" minOccurs="0" maxOccurs="1" /> 
  <xs:element name="pay_code" type="xs:string" minOccurs="0" maxOccurs="1" /> 
- <!--  date to assign this shift. this used day divide. change back to date
  --> 
  <xs:element name="effective_date" type="xs:dateTime" /> 
- <!--  computed start time. typically populated
  --> 
  <xs:element name="start_date" type="xs:dateTime" minOccurs="0" maxOccurs="1" /> 
- <!--  computed end time. typically populated or duration
  --> 
  <xs:element name="end_date" type="xs:dateTime" minOccurs="0" maxOccurs="1" /> 
- <!--  computed length of this shift. populated for some pay code edits.
  --> 
  <xs:element name="duration" type="tns:QuantityType" minOccurs="0" maxOccurs="1" /> 
- <!--  punch that starts this shift
  --> 
  <xs:element name="start_punch" type="tns:ComputedPunchType" minOccurs="0" maxOccurs="1" /> 
- <!--  punch that ends this shift
  --> 
  <xs:element name="end_punch" type="tns:ComputedPunchType" minOccurs="0" maxOccurs="1" /> 
- <!--  paycode edit id that was used to create this shift
  --> 
  <xs:element name="pay_code_edit" type="tns:ComputedPayCodeEditType" minOccurs="0" maxOccurs="1" /> 
- <!--  exceptions on this shift. (all exceptions˜ summary™)
  --> 
  <xs:element name="exceptions" type="tns:ExceptionType" minOccurs="0" maxOccurs="unbounded" /> 
- <!--  breaks during this shift
  --> 
  <xs:element name="computed_breaks" type="tns:ComputedBreakType" minOccurs="0" maxOccurs="unbounded" /> 
- <!--  
The Engine assigns values denoting quantities of time. e.g. Regular=5 hrs, Late=5 times to a pay category.
These are typically the durations for a particular scheduled block of time or period block of time.

  --> 
  <xs:element name="totals" type="tns:TotalType" minOccurs="0" maxOccurs="unbounded" /> 
  </xs:sequence>
  </xs:complexType>
- <!--  
units used for Block of Time amount.
'COUNT' denotes a units of quantity rather than units of time.

  --> 
- <xs:simpleType name="UnitsTypeEnum">
- <xs:restriction base="xs:string">
  <xs:enumeration value="SECONDS" /> 
  <xs:enumeration value="MINUTES" /> 
  <xs:enumeration value="HOURS" /> 
  <xs:enumeration value="DAYS" /> 
  <xs:enumeration value="WEEKS" /> 
  <xs:enumeration value="MONTHS" /> 
  <xs:enumeration value="QUARTERS" /> 
  <xs:enumeration value="YEARS" /> 
  <xs:enumeration value="COUNT" /> 
  </xs:restriction>
  </xs:simpleType>
- <xs:simpleType name="TotalTypeEnum">
- <xs:restriction base="xs:string">
  <xs:enumeration value="ACTUAL" /> 
  <xs:enumeration value="SCHEDULED" /> 
  <xs:enumeration value="PROJECTED" /> 
  </xs:restriction>
  </xs:simpleType>
- <xs:simpleType name="PunchDirectionEnum">
- <xs:restriction base="xs:string">
  <xs:enumeration value="IN" /> 
  <xs:enumeration value="OUT" /> 
  </xs:restriction>
  </xs:simpleType>
- <!--  method request, responses 
  --> 
- <xs:element name="CalculateRequest">
- <xs:complexType>
- <xs:sequence>
- <!--  start of period window. change to date?
  --> 
  <xs:element name="start_date" type="xs:dateTime" /> 
- <!--  end of period window. change to date?
  --> 
  <xs:element name="end_date" type="xs:dateTime" /> 
- <!--  current point in window
  --> 
  <xs:element name="now" type="xs:dateTime" /> 
- <!--  
punches in the clock or modified by the manager

  --> 
  <xs:element name="PunchType" type="tns:PunchType" minOccurs="0" maxOccurs="unbounded" /> 
- <!--  
Work that was actually done.

  --> 
  <xs:element name="pay_code_edits" type="tns:PayCodeEditType" minOccurs="0" maxOccurs="unbounded" /> 
  <xs:element name="scheduled_shifts" type="tns:ScheduledShiftType" minOccurs="0" maxOccurs="unbounded" /> 
  </xs:sequence>
  </xs:complexType>
  </xs:element>
- <xs:element name="CalculateResponse">
- <xs:complexType>
- <xs:sequence>
- <!--   The schedule blocks of time that are populated with exceptions, flags (containing pay categories), actuals, and all sorts of entries.
Possibly contains newly created blocks of time that are not scheduled.

  --> 
  <xs:element name="computed_shifts" type="tns:ComputedShiftType" minOccurs="0" maxOccurs="unbounded" /> 
  </xs:sequence>
  </xs:complexType>
  </xs:element>
- <!--  faults 
  --> 
- <xs:element name="BadInputFault">
- <xs:complexType>
- <xs:sequence>
  <xs:element name="code" type="xs:string" /> 
  <xs:element name="message" type="xs:string" /> 
  </xs:sequence>
  </xs:complexType>
  </xs:element>
  </xs:schema>
  </types>
- <!--  messages 
  --> 
- <message name="CalculateRequest">
  <part name="parameters" element="tns:CalculateRequest" /> 
  </message>
- <message name="CalculateResponse">
  <part name="parameters" element="tns:CalculateResponse" /> 
  </message>
- <message name="BadInputFault">
  <part name="fault" element="tns:BadInputFault" /> 
  </message>
- <!--  port 
  --> 
- <portType name="SpecificCalculatorPortType">
- <operation name="calculate">
  <input message="tns:CalculateRequest" /> 
  <output message="tns:CalculateResponse" /> 
  <fault name="BadInputFault" message="tns:BadInputFault" /> 
  </operation>
  </portType>
- <!--  binding 
  --> 
- <binding name="SpecificCalculatorBinding" type="tns:SpecificCalculatorPortType">
  <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http" /> 
- <operation name="calculate">
  <soap:operation soapAction="/calculate" style="document" /> 
- <input>
  <soap:body use="literal" /> 
  </input>
- <output>
  <soap:body use="literal" /> 
  </output>
- <fault name="BadInputFault">
  <soap:fault name="BadInputFault" use="literal" /> 
  </fault>
  </operation>
  </binding>
- <!--  service 
  --> 
- <service name="SpecificCalculatorService">
- <port name="SpecificCalculatorPort" binding="tns:SpecificCalculatorBinding">
  <soap:address location="http://ec2-67-202-9-24.compute-1.amazonaws.com:8180/calculator/services/SpecificCalculatorService" /> 
  </port>
  </service>
  </definitions>

 
  • February 05, 2008
  • Like
  • 0
I'm having some trouble navigating relationships within a SOQL query.  The following query works:
    "Select Id, (Select Duration__c From PayCodeEdits__r) from Worker__c"

where as this one doesn't:

SELECT id, PayCodeEdits__r.Duration__c FROM Worker__c


problem is that I need to be able to filter the output on the relationship thusly:

SELECT id, PayCodeEdits__r.Duration__c FROM Worker__c Where PayCodeEdits__r.Duration__c = 4

that doesn't work and I can't figure out how to make that filter appear in the working syntax
  • February 06, 2008
  • Like
  • 0
    I am using the following wsdl:
Code:
  <—xml version="1.0" encoding="UTF-8" –> 
- <!--  Published by JAX-WS RI at http://jax-ws.dev.java.net. RI's version is JAX-WS RI 2.1.2-b05-RC1. 
  --> 
- <definitions xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns="http://schemas.xmlsoap.org/wsdl/" xmlns:tns="urn:specific_calculator-services-kronos-com:specific_calculator" xmlns:xs="http://www.w3.org/2001/XMLSchema" targetNamespace="urn:specific_calculator-services-kronos-com:specific_calculator" name="SpecificCalculatorService">
- <types>
- <xs:schema xmlns="http://www.w3.org/2001/XMLSchema" targetNamespace="urn:specific_calculator-services-kronos-com:specific_calculator" elementFormDefault="unqualified" attributeFormDefault="unqualified">
- <!--  a name value pair used to add custom attributes to punches, pay code edits, scheduled_shifts, and others. These values assist the rules to make their decisions.
  --> 
- <xs:complexType name="TagType">
- <xs:sequence>
- <!--  categorization for tags. e.g. pay_category, pay_code, cost_center, exception
  --> 
  <xs:element name="name" type="xs:string" /> 
- <!--  tag value. e.g. regular, break, lunch, deli, late_in, very_late_out
  --> 
  <xs:element name="value" type="xs:string" /> 
  </xs:sequence>
  </xs:complexType>
- <!--  A quantity and units. (aka value). This typically denotes the duration for a block of time. Also the quantity for a total
  --> 
- <xs:complexType name="QuantityType">
- <xs:sequence>
- <!--  numerical value
  --> 
  <xs:element name="amount" type="xs:double" /> 
- <!--  change back to unitsType
  --> 
  <xs:element name="units" type="xs:string" minOccurs="0" maxOccurs="1" /> 
  </xs:sequence>
  </xs:complexType>
- <!--  
The Engine assigns values denoting quantities of time. e.g. Regular=5 hrs, Late=5 times to a pay category.
These are typically the durations for a particular scheduled block of time or period block of time.

  --> 
- <xs:complexType name="TotalType">
- <xs:sequence>
- <!--  Effective date. change back to date
  --> 
  <xs:element name="effective_date" type="xs:dateTime" /> 
- <!--  actual, scheduled, or projected. change back to total_type
  --> 
  <xs:element name="total_type" type="xs:string" /> 
- <!--  type of pay for employee
  --> 
  <xs:element name="pay_code" type="xs:string" /> 
- <!--  total value. (has amount and units)
  --> 
  <xs:element name="quantity" type="tns:QuantityType" /> 
  </xs:sequence>
  </xs:complexType>
- <!--  
punches in the clock or modified by the manager

  --> 
- <xs:complexType name="PunchType">
- <xs:sequence>
  <xs:element name="id" type="xs:string" /> 
  <xs:element name="effective_date" type="xs:dateTime" /> 
- <!--  change back to punch_direction
  --> 
  <xs:element name="punch_direction" type="xs:string" /> 
  </xs:sequence>
  </xs:complexType>
- <!--  
Work that was actually done.

  --> 
- <xs:complexType name="PayCodeEditType">
- <xs:sequence>
  <xs:element name="id" type="xs:string" /> 
  <xs:element name="pay_code_category" type="xs:string" minOccurs="0" maxOccurs="1" /> 
  <xs:element name="pay_code" type="xs:string" minOccurs="0" maxOccurs="1" /> 
- <!--  start time. typically populated
  --> 
  <xs:element name="start_date" type="xs:dateTime" minOccurs="0" maxOccurs="1" /> 
- <!--  end time. typically populated or duration
  --> 
  <xs:element name="end_date" type="xs:dateTime" minOccurs="0" maxOccurs="1" /> 
- <!--  length of this pay_code_edit
  --> 
  <xs:element name="duration" type="tns:QuantityType" minOccurs="0" maxOccurs="1" /> 
  </xs:sequence>
  </xs:complexType>
- <xs:complexType name="BreaksType">
- <xs:sequence>
  <xs:element name="id" type="xs:string" /> 
  <xs:element name="pay_code" type="xs:string" minOccurs="0" maxOccurs="1" /> 
- <!--  start time. typically populated
  --> 
  <xs:element name="start_date" type="xs:dateTime" minOccurs="0" maxOccurs="1" /> 
- <!--  end time. typically populated or duration
  --> 
  <xs:element name="end_date" type="xs:dateTime" minOccurs="0" maxOccurs="1" /> 
- <!--  length of this shift
  --> 
  <xs:element name="duration" type="tns:QuantityType" minOccurs="0" maxOccurs="1" /> 
  </xs:sequence>
  </xs:complexType>
- <xs:complexType name="ExceptionType">
- <xs:sequence>
  <xs:element name="rule_id" type="xs:string" /> 
- <!--  id into resource bundle
  --> 
  <xs:element name="resource_name" type="xs:string" /> 
  </xs:sequence>
  </xs:complexType>
- <xs:complexType name="ScheduledShiftType">
- <xs:sequence>
  <xs:element name="id" type="xs:string" minOccurs="0" maxOccurs="1" /> 
  <xs:element name="pay_code_category" type="xs:string" minOccurs="0" maxOccurs="1" /> 
  <xs:element name="pay_code" type="xs:string" minOccurs="0" maxOccurs="1" /> 
- <!--  start time. typically populated
  --> 
  <xs:element name="start_date" type="xs:dateTime" minOccurs="0" maxOccurs="1" /> 
- <!--  end time. typically populated or duration
  --> 
  <xs:element name="end_date" type="xs:dateTime" minOccurs="0" maxOccurs="1" /> 
- <!--  length of this shift.
  --> 
  <xs:element name="duration" type="tns:QuantityType" minOccurs="0" maxOccurs="1" /> 
- <!--  breaks during this shift
  --> 
  <xs:element name="breaks" type="tns:BreaksType" minOccurs="0" maxOccurs="unbounded" /> 
  </xs:sequence>
  </xs:complexType>
- <xs:complexType name="ComputedPunchType">
- <xs:sequence>
  <xs:element name="id" type="xs:string" /> 
- <!--  exceptions on this punch
  --> 
  <xs:element name="exceptions" type="tns:ExceptionType" minOccurs="0" maxOccurs="unbounded" /> 
  </xs:sequence>
  </xs:complexType>
- <xs:complexType name="ComputedPayCodeEditType">
- <xs:sequence>
  <xs:element name="id" type="xs:string" /> 
- <!--  exceptions on this pay_code_edit
  --> 
  <xs:element name="exceptions" type="tns:ExceptionType" minOccurs="0" maxOccurs="unbounded" /> 
  </xs:sequence>
  </xs:complexType>
- <xs:complexType name="ComputedBreakType">
- <xs:sequence>
  <xs:element name="id" type="xs:string" /> 
  <xs:element name="pay_code" type="xs:string" minOccurs="0" maxOccurs="1" /> 
- <!--  computed start time. populated if break taken
  --> 
  <xs:element name="start_date" type="xs:dateTime" minOccurs="0" maxOccurs="1" /> 
- <!--  computed end time. populated if taken (no duration)
  --> 
  <xs:element name="end_date" type="xs:dateTime" minOccurs="0" maxOccurs="1" /> 
- <!--  punch that starts this break
  --> 
  <xs:element name="start_punch" type="tns:ComputedPunchType" minOccurs="0" maxOccurs="1" /> 
- <!--  punch that ends this break
  --> 
  <xs:element name="end_punch" type="tns:ComputedPunchType" minOccurs="0" maxOccurs="1" /> 
- <!--  exceptions on this break.
  --> 
  <xs:element name="exceptions" type="tns:ExceptionType" minOccurs="0" maxOccurs="unbounded" /> 
- <!--  
The Engine assigns values denoting quantities of time. e.g. Regular=5 hrs, Late=5 times to a pay category.
These are typically the durations for a particular scheduled block of time or period block of time.

  --> 
  <xs:element name="totals" type="tns:TotalType" minOccurs="0" maxOccurs="unbounded" /> 
  </xs:sequence>
  </xs:complexType>
- <!--   The schedule blocks of time that are populated with exceptions, flags (containing pay categories), actuals, and all sorts of entries.
Possibly contains newly created blocks of time that are not scheduled.

  --> 
- <xs:complexType name="ComputedShiftType">
- <xs:sequence>
  <xs:element name="id" type="xs:string" /> 
  <xs:element name="pay_code_category" type="xs:string" minOccurs="0" maxOccurs="1" /> 
  <xs:element name="pay_code" type="xs:string" minOccurs="0" maxOccurs="1" /> 
- <!--  date to assign this shift. this used day divide. change back to date
  --> 
  <xs:element name="effective_date" type="xs:dateTime" /> 
- <!--  computed start time. typically populated
  --> 
  <xs:element name="start_date" type="xs:dateTime" minOccurs="0" maxOccurs="1" /> 
- <!--  computed end time. typically populated or duration
  --> 
  <xs:element name="end_date" type="xs:dateTime" minOccurs="0" maxOccurs="1" /> 
- <!--  computed length of this shift. populated for some pay code edits.
  --> 
  <xs:element name="duration" type="tns:QuantityType" minOccurs="0" maxOccurs="1" /> 
- <!--  punch that starts this shift
  --> 
  <xs:element name="start_punch" type="tns:ComputedPunchType" minOccurs="0" maxOccurs="1" /> 
- <!--  punch that ends this shift
  --> 
  <xs:element name="end_punch" type="tns:ComputedPunchType" minOccurs="0" maxOccurs="1" /> 
- <!--  paycode edit id that was used to create this shift
  --> 
  <xs:element name="pay_code_edit" type="tns:ComputedPayCodeEditType" minOccurs="0" maxOccurs="1" /> 
- <!--  exceptions on this shift. (all exceptions˜ summary™)
  --> 
  <xs:element name="exceptions" type="tns:ExceptionType" minOccurs="0" maxOccurs="unbounded" /> 
- <!--  breaks during this shift
  --> 
  <xs:element name="computed_breaks" type="tns:ComputedBreakType" minOccurs="0" maxOccurs="unbounded" /> 
- <!--  
The Engine assigns values denoting quantities of time. e.g. Regular=5 hrs, Late=5 times to a pay category.
These are typically the durations for a particular scheduled block of time or period block of time.

  --> 
  <xs:element name="totals" type="tns:TotalType" minOccurs="0" maxOccurs="unbounded" /> 
  </xs:sequence>
  </xs:complexType>
- <!--  
units used for Block of Time amount.
'COUNT' denotes a units of quantity rather than units of time.

  --> 
- <xs:simpleType name="UnitsTypeEnum">
- <xs:restriction base="xs:string">
  <xs:enumeration value="SECONDS" /> 
  <xs:enumeration value="MINUTES" /> 
  <xs:enumeration value="HOURS" /> 
  <xs:enumeration value="DAYS" /> 
  <xs:enumeration value="WEEKS" /> 
  <xs:enumeration value="MONTHS" /> 
  <xs:enumeration value="QUARTERS" /> 
  <xs:enumeration value="YEARS" /> 
  <xs:enumeration value="COUNT" /> 
  </xs:restriction>
  </xs:simpleType>
- <xs:simpleType name="TotalTypeEnum">
- <xs:restriction base="xs:string">
  <xs:enumeration value="ACTUAL" /> 
  <xs:enumeration value="SCHEDULED" /> 
  <xs:enumeration value="PROJECTED" /> 
  </xs:restriction>
  </xs:simpleType>
- <xs:simpleType name="PunchDirectionEnum">
- <xs:restriction base="xs:string">
  <xs:enumeration value="IN" /> 
  <xs:enumeration value="OUT" /> 
  </xs:restriction>
  </xs:simpleType>
- <!--  method request, responses 
  --> 
- <xs:element name="CalculateRequest">
- <xs:complexType>
- <xs:sequence>
- <!--  start of period window. change to date?
  --> 
  <xs:element name="start_date" type="xs:dateTime" /> 
- <!--  end of period window. change to date?
  --> 
  <xs:element name="end_date" type="xs:dateTime" /> 
- <!--  current point in window
  --> 
  <xs:element name="now" type="xs:dateTime" /> 
- <!--  
punches in the clock or modified by the manager

  --> 
  <xs:element name="PunchType" type="tns:PunchType" minOccurs="0" maxOccurs="unbounded" /> 
- <!--  
Work that was actually done.

  --> 
  <xs:element name="pay_code_edits" type="tns:PayCodeEditType" minOccurs="0" maxOccurs="unbounded" /> 
  <xs:element name="scheduled_shifts" type="tns:ScheduledShiftType" minOccurs="0" maxOccurs="unbounded" /> 
  </xs:sequence>
  </xs:complexType>
  </xs:element>
- <xs:element name="CalculateResponse">
- <xs:complexType>
- <xs:sequence>
- <!--   The schedule blocks of time that are populated with exceptions, flags (containing pay categories), actuals, and all sorts of entries.
Possibly contains newly created blocks of time that are not scheduled.

  --> 
  <xs:element name="computed_shifts" type="tns:ComputedShiftType" minOccurs="0" maxOccurs="unbounded" /> 
  </xs:sequence>
  </xs:complexType>
  </xs:element>
- <!--  faults 
  --> 
- <xs:element name="BadInputFault">
- <xs:complexType>
- <xs:sequence>
  <xs:element name="code" type="xs:string" /> 
  <xs:element name="message" type="xs:string" /> 
  </xs:sequence>
  </xs:complexType>
  </xs:element>
  </xs:schema>
  </types>
- <!--  messages 
  --> 
- <message name="CalculateRequest">
  <part name="parameters" element="tns:CalculateRequest" /> 
  </message>
- <message name="CalculateResponse">
  <part name="parameters" element="tns:CalculateResponse" /> 
  </message>
- <message name="BadInputFault">
  <part name="fault" element="tns:BadInputFault" /> 
  </message>
- <!--  port 
  --> 
- <portType name="SpecificCalculatorPortType">
- <operation name="calculate">
  <input message="tns:CalculateRequest" /> 
  <output message="tns:CalculateResponse" /> 
  <fault name="BadInputFault" message="tns:BadInputFault" /> 
  </operation>
  </portType>
- <!--  binding 
  --> 
- <binding name="SpecificCalculatorBinding" type="tns:SpecificCalculatorPortType">
  <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http" /> 
- <operation name="calculate">
  <soap:operation soapAction="/calculate" style="document" /> 
- <input>
  <soap:body use="literal" /> 
  </input>
- <output>
  <soap:body use="literal" /> 
  </output>
- <fault name="BadInputFault">
  <soap:fault name="BadInputFault" use="literal" /> 
  </fault>
  </operation>
  </binding>
- <!--  service 
  --> 
- <service name="SpecificCalculatorService">
- <port name="SpecificCalculatorPort" binding="tns:SpecificCalculatorBinding">
  <soap:address location="http://ec2-67-202-9-24.compute-1.amazonaws.com:8180/calculator/services/SpecificCalculatorService" /> 
  </port>
  </service>
  </definitions>

 
  • February 05, 2008
  • Like
  • 0
Hi
I'm new to Apex development.
I'm trying to communicate from Apex to external Web Service.

I'm able to access the Web Service from some other Java client without any issues.
But while accessing the same Web Service from the Apex code, I'm getting the following error.

Web service callout failed: Unexpected element. Parser was expecting element 'http://schemas.xmlsoap.org/soap/envelope/:Envelope' but found ':html'

And I verified the SOAP request and response messages , they look good.
Here I'm copying them

SOAP Request
-----------------------------------------------------------------------------------------------
POST http://localhost:8080/Axis/services/SecondServiceSOAP HTTP/1.0

Content-Type: text/xml; charset=utf-8

Accept: application/soap+xml, application/dime, multipart/related, text/*

User-Agent: Axis/1.3

Host: localhost:8080

Cache-Control: no-cache

Pragma: no-cache

SOAPAction: ""

Content-Length: 356

<?xml version="1.0" encoding="UTF-8"?>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<soapenv:Body>
<ns1:concatRequest xmlns:ns1="http://ttdev.com/ss">
<s1>abc</s1>
<s2>124</s2>
</ns1:concatRequest>
</soapenv:Body>
</soapenv:Envelope>
--------------------------------------------------------------------------------------------------------


SOAP Response
--------------------------------------------------------------------------------------------------------

HTTP/1.1 200 OK

Server: Apache-Coyote/1.1

Content-Type: text/xml;charset=utf-8

Date: Tue, 22 Jan 2008 22:38:14 GMT

Connection: close



<?xml version="1.0" encoding="utf-8"?>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<soapenv:Body>
<concatResponse xmlns="http://ttdev.com/ss">
<companyName xmlns="">abc124</companyName>
</concatResponse>
</soapenv:Body>
</soapenv:Envelope>
-----------------------------------------------------------------------------------------------------

I'm using Axis1.3 and Tomcat 5.5 on SalesForce 8.

The Apex version and the endpoint version are 11.1

Can you please help me in solving this issue at the earliest.

Thanks
Sarada


The Apex Developers Deployment guide has some psuedo code for generating an ApexService SessionHeader, but nothing specific. I've discovered that I can only generate valid SessionHeaders logging into the Org from which the WSDL was generated. Is there anything in the Apex.wsdl that binds the service to a particular Org end point, like an Enterprise WSDL does? Can Apex.wsdl be used by partners across multiple orgs? I'm guessing the ApexService.URL property perhaps needs setting? Thoughts? Suggestions? Thx
I created a simple webservice in C# for the purposes of processing some data to send emails. One of the parameters for a function of my webservice was called "from". I generated the WSDL for this webservice (and removed all SOAP 1.2 tags), then went to the sandbox to generate the Apex code from the WSDL. The code was generated, but there was an error (see the generated Apex class following this discussion). It took me quite a while to figure out what the problem was. Examining the Apex code revealed nothing, but then I read another post in this forum where someone noted that he/she was able to generate Apex code with reserved words as variable names, e.g. public String return; and this caused a problem. I suppose 'from' is one of those keywords in Apex, so I renamed the field in my code, rewrote the WSDL, then regenerated the Apex code from the WSDL and all was well. The error and the code that generated the error follows:


The following generated class(es) have compilation errors:

Error: TestingGeneration3

Error: unexpected token: String at 15:16

Code:
//Generated by wsdl2apex

public class TestingGeneration3 {
    public class Authenticate_element {
        public String username;
        public String password;
        private String[] username_type_info = new String[]{'username','http://www.w3.org/2001/XMLSchema','string','0','1','false'};
        private String[] password_type_info = new String[]{'password','http://www.w3.org/2001/XMLSchema','string','0','1','false'};
        private String[] apex_schema_type_info = new String[]{'http://www.example.com/WebServices/','true'};
        private String[] field_order_type_info = new String[]{'username','password'};
    }
    public class Send_element {
        public String toEmails;
        public String bccEmails;
        public String from;   // THE ERROR IS ON THIS LINE
        public String subject;
        public String body;
        private String[] toEmails_type_info = new String[]{'toEmails','http://www.w3.org/2001/XMLSchema','string','0','1','false'};
        private String[] bccEmails_type_info = new String[]{'bccEmails','http://www.w3.org/2001/XMLSchema','string','0','1','false'};
        private String[] from_type_info = new String[]{'from','http://www.w3.org/2001/XMLSchema','string','0','1','false'};
        private String[] subject_type_info = new String[]{'subject','http://www.w3.org/2001/XMLSchema','string','0','1','false'};
        private String[] body_type_info = new String[]{'body','http://www.w3.org/2001/XMLSchema','string','0','1','false'};
        private String[] apex_schema_type_info = new String[]{'http://www.example.com/WebServices/','true'};
        private String[] field_order_type_info = new String[]{'toEmails','bccEmails','from','subject','body'};
    }
    public class ConfirmationEmailSoap {
        public String endpoint_x = 'http://localhost:38851/ConfirmationEmail.asmx';
        private String[] ns_map_type_info = new String[]{'http://www.example.com/WebServices/', 'TestingGeneration3'};
        public Boolean Send(String toEmails,String bccEmails,String from,String subject,String body) {
            TestingGeneration3.Send_element request_x = new TestingGeneration3.Send_element();
            TestingGeneration3.SendResponse_element response_x;
            request_x.toEmails = toEmails;
            request_x.bccEmails = bccEmails;
            request_x.from = from;
            request_x.subject = subject;
            request_x.body = body;
            Map<String, TestingGeneration3.SendResponse_element> response_map_x = new Map<String, TestingGeneration3.SendResponse_element>();
            response_map_x.put('response_x', response_x);
            WebServiceCallout.invoke(
              this,
              request_x,
              response_map_x,
              new String[]{endpoint_x,
              'http://www.example.com/WebServices/Send',
              'http://www.example.com/WebServices/',
              'Send',
              'http://www.example.com/WebServices/',
              'SendResponse',
              'TestingGeneration3.SendResponse_element'}
            );
            response_x = response_map_x.get('response_x');
            return response_x.SendResult;
        }
        public String Authenticate(String username,String password) {
            TestingGeneration3.Authenticate_element request_x = new TestingGeneration3.Authenticate_element();
            TestingGeneration3.AuthenticateResponse_element response_x;
            request_x.username = username;
            request_x.password = password;
            Map<String, TestingGeneration3.AuthenticateResponse_element> response_map_x = new Map<String, TestingGeneration3.AuthenticateResponse_element>();
            response_map_x.put('response_x', response_x);
            WebServiceCallout.invoke(
              this,
              request_x,
              response_map_x,
              new String[]{endpoint_x,
              'http://www.example.com/WebServices/Authenticate',
              'http://www.example.com/WebServices/',
              'Authenticate',
              'http://www.example.com/WebServices/',
              'AuthenticateResponse',
              'TestingGeneration3.AuthenticateResponse_element'}
            );
            response_x = response_map_x.get('response_x');
            return response_x.AuthenticateResult;
        }
    }
    public class AuthenticateResponse_element {
        public String AuthenticateResult;
        private String[] AuthenticateResult_type_info = new String[]{'AuthenticateResult','http://www.w3.org/2001/XMLSchema','string','0','1','false'};
        private String[] apex_schema_type_info = new String[]{'http://www.example.com/WebServices/','true'};
        private String[] field_order_type_info = new String[]{'AuthenticateResult'};
    }
    public class SendResponse_element {
        public Boolean SendResult;
        private String[] SendResult_type_info = new String[]{'SendResult','http://www.w3.org/2001/XMLSchema','boolean','1','1','false'};
        private String[] apex_schema_type_info = new String[]{'http://www.example.com/WebServices/','true'};
        private String[] field_order_type_info = new String[]{'SendResult'};
    }
}

 

Message Edited by soma on 10-02-2007 12:47 AM

  • October 02, 2007
  • Like
  • 0
Given that queries in Apex code are performed differently, is it possible to make the fields requested from an object variable?  As the documentation implies, a "bind" expression cannot be used.  If this is not possible by some other approach, it would be a valuable enhancement/improvement.
 
Also, is there a way to investigate the fields on an object (akin to a DescribeSObject) when a trigger fires?  Ideally something like a .js 'for ... in ... ' loop:
for(thisField in thisAccount)
{
    //do something w/ thisField.name
}
 
Thanks!