I'm using your Web Service inside a BPEL orchestration, to broadcast
weather-driven information to students inside academic institutions.
The contract I'm using is attached. In the 'GetForecastByCityCode'
repsonse message, you've basically defined the result type as an
'ArrayOfAnyType'.
> <s:complexType name="ArrayOfAnyType">
> <s:sequence>
> <s:element minOccurs="0" maxOccurs="unbounded" name="anyType" nillable="true" />
> </s:sequence>
> </s:complexType>
> <s:element name="GetForecastByCityCodeResponse">
> <s:complexType>
> <s:sequence>
> <s:element minOccurs="0" maxOccurs="1" name="GetForecastByCityCodeResult" type="tns:ArrayOfAnyType" />
> </s:sequence>
> </s:complexType>
> </s:element>
After some (easy) reverse engineering work, I've guessed that you were
basically returning an 'ArrayOfApiForecastData'. So, I decide to cast
each item of your returned ArrayOfAnytype as an ApiforecastData. And it
basically works ... excepting for the 'icon' element.
Apparently, you're never filling this field when invoking this method.
As BPEL language (industrial reference language to describes web
services based business processes) intensively relies on WSDL and XSD
description (assumed to be true), my process end in a faulty way
(throwing a 'selection failure' SOAP fault) when I try to access it. So
I have to 'hack' the Image field to retrieve the icon identifier.
I saw in your ApiForecastData data model definition that quasi all
elements are 'optionnal's (as minOccurs is set to 0).
> <s:complexType name="ApiForecastData">
> <s:sequence>
> <s:element minOccurs="0" maxOccurs="1" name="ConditionID" type="s:string" />
> <s:element minOccurs="0" maxOccurs="1" name="Description" type="s:string" />
> <s:element minOccurs="0" maxOccurs="1" name="Icon" type="s:string" />
> <s:element minOccurs="0" maxOccurs="1" name="Image" type="s:string" />
> <s:element minOccurs="1" maxOccurs="1" name="IsNight" type="s:boolean" />
> <s:element minOccurs="0" maxOccurs="1" name="Prediction" type="s:string" />
> <s:element minOccurs="0" maxOccurs="1" name="ShortPrediction" type="s:string" />
> <s:element minOccurs="0" maxOccurs="1" name="ShortTitle" type="s:string" />
> <s:element minOccurs="0" maxOccurs="1" name="TempHigh" type="s:string" />
> <s:element minOccurs="0" maxOccurs="1" name="TempLow" type="s:string" />
> <s:element minOccurs="0" maxOccurs="1" name="TempUnit" type="s:string" />
> <s:element minOccurs="0" maxOccurs="1" name="Title" type="s:string" />
> <s:element minOccurs="0" maxOccurs="1" name="WebUrl" type="s:string" />
> </s:sequence>
> </s:complexType>
Assuming this 'optionality' is a wanted feature of your system, do you
have some 'business rules' describing when you're filling it, and when
you're not using it ? It'll simplify our development process to knwo by
advance which data we can use when invoking the Web service.
Do not hesitate to contact me for further information.
Regards,
--
Sebastien Mosser
EPU Polytech'Nice - Sophia Antipolis, Bureau 314
CNRS / I3S / Modalis - http://rainbow.i3s.unice.fr/~mosser
> I suppose you are using older asmx page that's returning the ambiguous ArrayOfAnytype.
I was using the one I've downloaded at the begining of the year.
> We have recently created a newer one and linked it from http://api.wxbug.net/menu.aspx.
> That is more helpful as far as the return types are concerned.
Thanks for this news !! I've just downloaded the new version and
integrated it inside the BPEL process. It works fine, and avoid those
ugly casts ^_^.
> We are aware of the missing value in the icon element. The issue will be
> resolved in a couple of weeks. I can notify you once we have it up there.
the "weird" thing is that you're providing an element (which is empty)
in the 'LiveWeatherData' ('CurrIcon' element), but you're not providing
the 'Icon' element inside the ApiforecastData complex type.
> The business rule is simple. You are always supposed have data for each element
> in the structure below.
good news. So I guess I just have to wait ^_^. As you mention in the
previous paragrapgh, could you please notify me when you'll fix this issue ?