Re: [Jolie-devel] Webservice SOAP-XML handling
A service-oriented programming language.
Brought to you by:
fmontesi
From: Matthias D. W. <mwa...@ya...> - 2013-11-22 16:56:31
|
Hi Claudio, "any" does work too (beside "void"). I have made a mistake and posted the wrong error message (since I did some hack-patching before): the correct one refers to the fields and not the whole structure. Bye, Matthias Claudio Guidi schrieb: > Hi Matthias, > > the TypeChecking error you receive is about the native type of the root > GetCityWeatherByZIPResult and not about the subfields <Visibility/>< > WindChill/> and <Remarks/>. Thus I don't understand why it works if > you change > the types of those fields from string to void. > > Neverthless, at the present it is not possible to express in jolie > something like this: > > .mysubfield: string + void (which means a string or a void native type) > > We are planning to introduce such a kind of choice operator for types > in the near future. > Now, you could use native type *any* for expressing the possibility to > have both a string or a void. > > .mysubfield: any > > any means any kind of native type. > In your case it should be: > > > .WeatherID:int > > .Description?:string > > .State?:string > > .ResponseText?:string > > .RelativeHumidity?:string > > .WindChill?:any > > .Temperature?:string > > .Remarks?:any > > .Visibility?:any > > .Pressure?:string > > .Success:bool > > .WeatherStationCity?:string > > .Wind?:string > > .City?:string > > Let me know if it works, > Bye > Claudio > > > > > > > > -------------------------------------------------------------- > Claudio Guidi Ph.D. > italianaSoftware s.r.l. > via Coralli, 66 - 40026 Imola (BO), Italy > http://www.italianasoftware.com/ > http://www.jolie-lang.org <http://www.jolie-lang.org/> > Phone: +39 0542 788201 > Mobile: +39 347 0694065 > Fax: +39 0542 628048 > -------------------------------------------------------------- > > Nota di riservatezza: Il presente messaggio, corredato dei > relativi allegati, contiene informazioni da considerarsi strettamente > riservate, ed è destinato esclusivamente al destinatario sopra > indicato, il quale è l'unico autorizzato ad usarlo, copiarlo e, sotto > la propria responsabilità,diffonderlo. Chiunque ricevesse questo > messaggio per errore o comunque lo leggesse senza esserne legittimato > è avvertito che trattenerlo, copiarlo,divulgarlo, distribuirlo a > persone diverse dal destinatario è severamente proibito, ed è pregato > di rinviarlo immediatamente al mittente distruggendone l'originale. > > Grazie per la collaborazione. > > > 2013/11/22 Matthias Dieter Wallnöfer <mwa...@ya... > <mailto:mwa...@ya...>> > > Hi devs, > > I have another interesting issue in respect to SOAP. > > Webservice: http://wsf.cdyne.com/WeatherWS/Weather.asmx?WSDL > > The type declaration of "WeatherReturnType" (for call > GetCityWeatherByZIP()) determined by wsdl2jolie (which is correct > if you > have a look at the WSDL file - > http://wsf.cdyne.com/WeatherWS/Weather.asmx?WSDL! > <http://wsf.cdyne.com/WeatherWS/Weather.asmx?WSDL%21>): > > type WeatherReturnType:void { > > .WeatherID:int > > .Description?:string > > .State?:string > > .ResponseText?:string > > .RelativeHumidity?:string > > .WindChill?:string > > .Temperature?:string > > .Remarks?:string > > .Visibility?:string > > .Pressure?:string > > .Success:bool > > .WeatherStationCity?:string > > .Wind?:string > > .City?:string > > } > A possible result of GetCityWeatherByZIP(): > > <WeatherReturn><Success>true</Success><ResponseText>City > > Found</ResponseText><State>NY</State><City>New > > York</City><WeatherStationCity>White > > > Plains</WeatherStationCity><WeatherID>14</WeatherID><Description>Cloudy</Description><Temperature>46</Temperature><RelativeHumidity>89</RelativeHumidity><Wind>S3</Wind><Pressure>30.21F</Pressure><Visibility/><WindChill/><Remarks/></WeatherReturn> > Jolie blames about the <.../> since it recognizes them as VOIDs > not strings: > > WARNING: [weatherServiceCallerNYC.ol] Received message TypeMismatch > > (GetCityWeatherByZIP@WeatherSoap): Invalid native type for node > > #Message.GetCityWeatherByZIPResult: expected VOID, found > java.lang.String > I have tried to look into the code but there does not seem to be > an easy > solution. As a workaround I can change the datatype of the "<.../>" > fields in the type stucture to VOID - then everything works. > > Does there exist something different? > > Cheers, > Matthias > > > ------------------------------------------------------------------------------ > Shape the Mobile Experience: Free Subscription > Software experts and developers: Be at the forefront of tech > innovation. > Intel(R) Software Adrenaline delivers strategic insight and > game-changing > conversations that shape the rapidly evolving mobile landscape. > Sign up now. > http://pubads.g.doubleclick.net/gampad/clk?id=63431311&iu=/4140/ostg.clktrk > _______________________________________________ > Jolie-devel mailing list > Jol...@li... > <mailto:Jol...@li...> > https://lists.sourceforge.net/lists/listinfo/jolie-devel > > |