• Bernard Farrell
  • NEWBIE
  • 0 Points
  • Member since 2008

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 3
    Questions
  • 5
    Replies
I'm trying to call an external web service from Apex.

The web service call returns an array of objects. So the generated Apex definition for the call is something like:

public class testWsdl {

    public class CalculationPort {

        public testWsdl.ComputedType[] calculate(DateTime start,DateTime end_x,DateTime now)
        ...

When I invoke it, I use the following code (declarations omitted for clarity):

  testWsdl.CalculationPort stub = new testWsdl.CalculationPort();
  testWsdl.ComputedType[] results = stub.calculate( start, end_x, now);

I get the following error on the second line:
  Non-void method might not return a value

I have no idea what this means. I've also tried the following code:
  testWsdl.ComputedType[] results = testWsdl.ComputedType[0];
  results = stub.calculate( start, end_x, now);

And I get exactly the same error.

I think I understand what the error means, that the variable results may be null after the call has completed.

My question is, how do I get rid of the error?

We have the Translation Workbench features enabled.

I'd like to download all translatable strings so we can have our localization people work on these. And then I'd like some way to upload the localized strings for a specific language.

I came across this cryptic note about mass translation, but it doesn't explain the structure of the Localized Value, or where and how to get the Translation or Translation User objects.

I've searched developer.salesforce.com, read the translation workbench docs, and even used Google but I've had no success.

Can anyone provide me with some instructions on how to do this?

I have an application where I want to tie Worker objects to Address objects. The same address can be used by many workers and each worker can be located at many addresses.

I looked in the development area and saw a reference to a junction object. Is this just a simple object containing two Lookup fields or is there someway to automatically create a many-to-many relationship?

Would it work to simply have the Worker object contain a lookup field for the Address object and the Address object have a Lookup(Worker) field?
    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 trying to call an external web service from Apex.

The web service call returns an array of objects. So the generated Apex definition for the call is something like:

public class testWsdl {

    public class CalculationPort {

        public testWsdl.ComputedType[] calculate(DateTime start,DateTime end_x,DateTime now)
        ...

When I invoke it, I use the following code (declarations omitted for clarity):

  testWsdl.CalculationPort stub = new testWsdl.CalculationPort();
  testWsdl.ComputedType[] results = stub.calculate( start, end_x, now);

I get the following error on the second line:
  Non-void method might not return a value

I have no idea what this means. I've also tried the following code:
  testWsdl.ComputedType[] results = testWsdl.ComputedType[0];
  results = stub.calculate( start, end_x, now);

And I get exactly the same error.

I think I understand what the error means, that the variable results may be null after the call has completed.

My question is, how do I get rid of the error?

I have an application where I want to tie Worker objects to Address objects. The same address can be used by many workers and each worker can be located at many addresses.

I looked in the development area and saw a reference to a junction object. Is this just a simple object containing two Lookup fields or is there someway to automatically create a many-to-many relationship?

Would it work to simply have the Worker object contain a lookup field for the Address object and the Address object have a Lookup(Worker) field?
Can anyone tell me how to fix the following issue with Eclipse?

I get the error message:
Unable to load Scontrol Editor
FactoryException: No id found for filepath 'S-Controls/MyControl.scf'

This is happening ever since I installed the latest version of Eclipse (3.3/Europa) in order to get the Force.com toolkit.  I followed the Wiki to do a new install (this was recommended) even though I had an older version of Eclipse (3.2 I think) with all of my code there.  When I installed the new version that is called Java IDE as indicated on the Wiki, I get this error every time I try to open any of my scontrols.  When I installed the Europa (3.3) version of Eclipse it asked me where I wanted to have my workspace and I pointed it to where all of my old projects in the last version of Eclipse were...could this be the issue?  Please advise on how to proceed as I am stuck and need to do some Apex coding to update my app....

Thanks in advance for any help...