You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ofbiz.apache.org by RolandH <ro...@redvision.de> on 2008/06/20 14:55:33 UTC

WSDL generation problem

Hi all,

after playing a bit with services, I found a small WSDL problem, I tried 
to fix, but I can't find the real source, so maybe someone can give me a 
hint:

- create a service, using e.g.
<auto-attributes "PostalAddress" include="all" optional="true">
<override name="address1" optional="false">

- export this service, open WSDL in webbrowser, look at the 
'serviceNameRequest' Part:
[...]
<wsdl:part name="address1" type="xsd:string"/>
<wsdl:part name="address2" type="xsd:string"/>
<wsdl:part name="directions" type="xsd:string"/>
<wsdl:part name="city" type="xsd:string"/>
[... lots of attributes deleted ...]
<wsdl:part name="address1" type="xsd:string"/>
[...]

now, I looked through the code, and found:
framework/service/src/org/ofbiz/service/ModelService.java:
ModelService.getWSDL calls this.getParameterNames(IN_PARAM, true, false)
which returns all parameters including optionals (second parameter), 
excluding internal parameters (third param)

changing that to return only required parameters, lists address1 two 
times, too.
removing the override xml tag, removes the duplicate address1.

Any hints, where this may go wrong?

Thanks,
Roland


Re: WSDL generation problem

Posted by RolandH <ro...@redvision.de>.
Hi Scott,

thanks for the idea about webtools!
at least I have now a 'works for me' patch:
https://issues.apache.org/jira/browse/OFBIZ-1848

Greetings,
Roland

Scott Gray wrote:
> Line 1100 &  1117 ModelService.java
>
> There's probably another method that will give you a better list of
> parameters but you'd need to search for it.  A good approach might be to dig
> in to webtools and see how the service def screens get the parameter list
> without repeating overridden auto-parameters.
>
> Regards
> Scott
>
> 2008/6/24 RolandH <ro...@redvision.de>:
>
>   
>> On Monday 23 June 2008 23:58, BJ Freeman wrote:
>>     
>>> are you using the trunk version?
>>> though what you say is true there is more code that effects the output.
>>>       
>> Yes, it's r670705.
>> any hint where to look for internals of the service engine would be
>> appreciated.
>>
>> Thanks,
>> Roland
>>
>>
>>     
>>> RolandH sent the following on 6/20/2008 5:55 AM:
>>>       
>>>> Hi all,
>>>>
>>>> after playing a bit with services, I found a small WSDL problem, I
>>>>         
>> tried
>>     
>>>> to fix, but I can't find the real source, so maybe someone can give me
>>>>         
>> a
>>     
>>>> hint:
>>>>
>>>> - create a service, using e.g.
>>>> <auto-attributes "PostalAddress" include="all" optional="true">
>>>> <override name="address1" optional="false">
>>>>
>>>> - export this service, open WSDL in webbrowser, look at the
>>>> 'serviceNameRequest' Part:
>>>> [...]
>>>> <wsdl:part name="address1" type="xsd:string"/>
>>>> <wsdl:part name="address2" type="xsd:string"/>
>>>> <wsdl:part name="directions" type="xsd:string"/>
>>>> <wsdl:part name="city" type="xsd:string"/>
>>>> [... lots of attributes deleted ...]
>>>> <wsdl:part name="address1" type="xsd:string"/>
>>>> [...]
>>>>
>>>> now, I looked through the code, and found:
>>>> framework/service/src/org/ofbiz/service/ModelService.java:
>>>> ModelService.getWSDL calls this.getParameterNames(IN_PARAM, true,
>>>>         
>> false)
>>     
>>>> which returns all parameters including optionals (second parameter),
>>>> excluding internal parameters (third param)
>>>>
>>>> changing that to return only required parameters, lists address1 two
>>>> times, too.
>>>> removing the override xml tag, removes the duplicate address1.
>>>>
>>>> Any hints, where this may go wrong?
>>>>         
>>     
>
>   


Re: WSDL generation problem

Posted by Scott Gray <le...@gmail.com>.
Line 1100 &  1117 ModelService.java

There's probably another method that will give you a better list of
parameters but you'd need to search for it.  A good approach might be to dig
in to webtools and see how the service def screens get the parameter list
without repeating overridden auto-parameters.

Regards
Scott

2008/6/24 RolandH <ro...@redvision.de>:

> On Monday 23 June 2008 23:58, BJ Freeman wrote:
> > are you using the trunk version?
> > though what you say is true there is more code that effects the output.
>
> Yes, it's r670705.
> any hint where to look for internals of the service engine would be
> appreciated.
>
> Thanks,
> Roland
>
>
> > RolandH sent the following on 6/20/2008 5:55 AM:
> > > Hi all,
> > >
> > > after playing a bit with services, I found a small WSDL problem, I
> tried
> > > to fix, but I can't find the real source, so maybe someone can give me
> a
> > > hint:
> > >
> > > - create a service, using e.g.
> > > <auto-attributes "PostalAddress" include="all" optional="true">
> > > <override name="address1" optional="false">
> > >
> > > - export this service, open WSDL in webbrowser, look at the
> > > 'serviceNameRequest' Part:
> > > [...]
> > > <wsdl:part name="address1" type="xsd:string"/>
> > > <wsdl:part name="address2" type="xsd:string"/>
> > > <wsdl:part name="directions" type="xsd:string"/>
> > > <wsdl:part name="city" type="xsd:string"/>
> > > [... lots of attributes deleted ...]
> > > <wsdl:part name="address1" type="xsd:string"/>
> > > [...]
> > >
> > > now, I looked through the code, and found:
> > > framework/service/src/org/ofbiz/service/ModelService.java:
> > > ModelService.getWSDL calls this.getParameterNames(IN_PARAM, true,
> false)
> > > which returns all parameters including optionals (second parameter),
> > > excluding internal parameters (third param)
> > >
> > > changing that to return only required parameters, lists address1 two
> > > times, too.
> > > removing the override xml tag, removes the duplicate address1.
> > >
> > > Any hints, where this may go wrong?
>
>

Re: WSDL generation problem

Posted by RolandH <ro...@redvision.de>.
On Monday 23 June 2008 23:58, BJ Freeman wrote:
> are you using the trunk version?
> though what you say is true there is more code that effects the output.

Yes, it's r670705.
any hint where to look for internals of the service engine would be 
appreciated.

Thanks,
Roland


> RolandH sent the following on 6/20/2008 5:55 AM:
> > Hi all,
> >
> > after playing a bit with services, I found a small WSDL problem, I tried
> > to fix, but I can't find the real source, so maybe someone can give me a
> > hint:
> >
> > - create a service, using e.g.
> > <auto-attributes "PostalAddress" include="all" optional="true">
> > <override name="address1" optional="false">
> >
> > - export this service, open WSDL in webbrowser, look at the
> > 'serviceNameRequest' Part:
> > [...]
> > <wsdl:part name="address1" type="xsd:string"/>
> > <wsdl:part name="address2" type="xsd:string"/>
> > <wsdl:part name="directions" type="xsd:string"/>
> > <wsdl:part name="city" type="xsd:string"/>
> > [... lots of attributes deleted ...]
> > <wsdl:part name="address1" type="xsd:string"/>
> > [...]
> >
> > now, I looked through the code, and found:
> > framework/service/src/org/ofbiz/service/ModelService.java:
> > ModelService.getWSDL calls this.getParameterNames(IN_PARAM, true, false)
> > which returns all parameters including optionals (second parameter),
> > excluding internal parameters (third param)
> >
> > changing that to return only required parameters, lists address1 two
> > times, too.
> > removing the override xml tag, removes the duplicate address1.
> >
> > Any hints, where this may go wrong?


Re: WSDL generation problem

Posted by BJ Freeman <bj...@free-man.net>.
are you using the trunk version?
though what you say is true there is more code that effects the output.



RolandH sent the following on 6/20/2008 5:55 AM:
> Hi all,
> 
> after playing a bit with services, I found a small WSDL problem, I tried
> to fix, but I can't find the real source, so maybe someone can give me a
> hint:
> 
> - create a service, using e.g.
> <auto-attributes "PostalAddress" include="all" optional="true">
> <override name="address1" optional="false">
> 
> - export this service, open WSDL in webbrowser, look at the
> 'serviceNameRequest' Part:
> [...]
> <wsdl:part name="address1" type="xsd:string"/>
> <wsdl:part name="address2" type="xsd:string"/>
> <wsdl:part name="directions" type="xsd:string"/>
> <wsdl:part name="city" type="xsd:string"/>
> [... lots of attributes deleted ...]
> <wsdl:part name="address1" type="xsd:string"/>
> [...]
> 
> now, I looked through the code, and found:
> framework/service/src/org/ofbiz/service/ModelService.java:
> ModelService.getWSDL calls this.getParameterNames(IN_PARAM, true, false)
> which returns all parameters including optionals (second parameter),
> excluding internal parameters (third param)
> 
> changing that to return only required parameters, lists address1 two
> times, too.
> removing the override xml tag, removes the duplicate address1.
> 
> Any hints, where this may go wrong?
> 
> Thanks,
> Roland
> 
> 
> 
>