Topic
  • 8 replies
  • Latest Post - ‏2013-02-11T13:47:22Z by mburati
SystemAdmin
SystemAdmin
9029 Posts

Pinned topic WPF Webservice autocreate variable-generates in alphabetical order

‏2013-02-08T12:39:03Z |
Hi,

We are using webservice provider/consumer builder to invoke webservices hosted in ESB, via datapower.
We have strict validation enabled in ESB/DP for request and response variables. This causes the validation error while invoking the ws.

In the web service call builder, we are using AutoCreate Input vars checkbox, this generates the request/response variables in alphabetical order even though request XSDs in the wsdl are in different sequence.

Ex: xsd contains the restriction with sequence such as
<xsd:complexType name="something">
<xsd:sequence>
<xsd:element name="Input3">
</xsd:element>
<xsd:element name="Input2">
</xsd:element>
<xsd:element name="Alpha1">
</xsd:element>
<xsd:element name="Alpha2">
</xsd:element>
<xsd:element name="beta1">
</xsd:element>
</xsd:sequence>
</xsd:complexType>

but the request parameter input variables generated in WPF

goes as <Alpha1></Alpha1>
<Alpha2></Alpha2>
<beta1></beta1>
<Input2></Input2>
<Input3></Input3>

And at runtime SOAP message also formated in the same order as what portlet factory generated order instead of actual xsd definintion.
This causes the validation error at dp/esb end.

We are using WPF v6.1.5.2
Portal V6.1.5.x
WAS v7.0.0.x

Any recommendations and inputs will be thankful ? as we are close to production launch, so upgrading portlet factory to a newer version may not be feasible.

Thanks and Regards
Selva
Updated on 2013-02-11T13:47:22Z at 2013-02-11T13:47:22Z by mburati
  • DGawron
    DGawron
    580 Posts

    Re: WPF Webservice autocreate variable-generates in alphabetical order

    ‏2013-02-08T16:09:32Z  
    This may be something that your model is doing unintentionally. When you auto create input variables all that does is create an XML variable with a top-level element; none of the children of that element will be present. I suspect that you may be using an Action List to assign values into the XML variable and the action list assignments are ordered alphabetically. As I recall Action List will add children in the order of assignment rather than the order specified by the schema. If this isn't what you find in the models, then please post a sample that recreates the issue so we can look at it in detail.
  • SystemAdmin
    SystemAdmin
    9029 Posts

    Re: WPF Webservice autocreate variable-generates in alphabetical order

    ‏2013-02-08T16:35:48Z  
    • DGawron
    • ‏2013-02-08T16:09:32Z
    This may be something that your model is doing unintentionally. When you auto create input variables all that does is create an XML variable with a top-level element; none of the children of that element will be present. I suspect that you may be using an Action List to assign values into the XML variable and the action list assignments are ordered alphabetically. As I recall Action List will add children in the order of assignment rather than the order specified by the schema. If this isn't what you find in the models, then please post a sample that recreates the issue so we can look at it in detail.
    Hi,
    Thanks for the reply.

    We are not using any action list to assign the variable.

    We have our local variables which are mapped to the request parameters using the service consumer builder under the section overridden inputs.

    It is not the custom action list is doing this for sure, as i can see the variable created in alphabetical order in all the builder input's variable picker sections. (choose reference -> variables -> webserviceInputs, choose reference -> Data services - > webservicecallName -> operationName -> serviceInputXML -> individualFields)

    and the same order is reflecting in the service consumer builder's overridden inputs section also.

    note:As of now i dont have sample model to upload, as our dev network dont have internet access. I will update asap.

    Thanks
    Selva
  • mburati
    mburati
    2560 Posts

    Re: WPF Webservice autocreate variable-generates in alphabetical order

    ‏2013-02-08T17:19:49Z  
    Hi,
    Thanks for the reply.

    We are not using any action list to assign the variable.

    We have our local variables which are mapped to the request parameters using the service consumer builder under the section overridden inputs.

    It is not the custom action list is doing this for sure, as i can see the variable created in alphabetical order in all the builder input's variable picker sections. (choose reference -> variables -> webserviceInputs, choose reference -> Data services - > webservicecallName -> operationName -> serviceInputXML -> individualFields)

    and the same order is reflecting in the service consumer builder's overridden inputs section also.

    note:As of now i dont have sample model to upload, as our dev network dont have internet access. I will update asap.

    Thanks
    Selva
    It's possible the service override list is contributing to this. I believe that section was really for an individual override you need to apply to existing inputs coming from the consumer, not for the primary means of specifying inputs to an operation. If your input structure is not coming from a Page Automation generated form, then you could try creating an XML Variable in the consumer associated with that schema, generating sample data from the schema with that XML Variable and then assigning into those paths with an action list or possibly with the overrides, to see if that helps.

    I hope that info helps,
    ..Mike Burati
    http://www-10.lotus.com/ldd/pfwiki.nsf/
    The postings on this site are my own and do not necessarily represent the positions, strategies, or opinions of IBM.
  • SystemAdmin
    SystemAdmin
    9029 Posts

    Re: WPF Webservice autocreate variable-generates in alphabetical order

    ‏2013-02-08T17:28:50Z  
    • mburati
    • ‏2013-02-08T17:19:49Z
    It's possible the service override list is contributing to this. I believe that section was really for an individual override you need to apply to existing inputs coming from the consumer, not for the primary means of specifying inputs to an operation. If your input structure is not coming from a Page Automation generated form, then you could try creating an XML Variable in the consumer associated with that schema, generating sample data from the schema with that XML Variable and then assigning into those paths with an action list or possibly with the overrides, to see if that helps.

    I hope that info helps,
    ..Mike Burati
    http://www-10.lotus.com/ldd/pfwiki.nsf/
    The postings on this site are my own and do not necessarily represent the positions, strategies, or opinions of IBM.
    Hi Mike,

    We are doing exactly the same way you have suggested in the second portion of your reply, having separate XML variable and mapping them to consumer builder.

    Since the variables were generated in different order(by webservice call builder) than the schema mentioned in the xsd, we were mapping the individual fields(sometimes a sub tree of an xml) to the service inputs using consumer builder.

    Thanks
    Selva
  • SystemAdmin
    SystemAdmin
    9029 Posts

    Re: WPF Webservice autocreate variable-generates in alphabetical order

    ‏2013-02-08T17:57:18Z  
    Hi Mike,

    We are doing exactly the same way you have suggested in the second portion of your reply, having separate XML variable and mapping them to consumer builder.

    Since the variables were generated in different order(by webservice call builder) than the schema mentioned in the xsd, we were mapping the individual fields(sometimes a sub tree of an xml) to the service inputs using consumer builder.

    Thanks
    Selva
    I have one query, Is it not the webservice engine forming the SOAP message from the java beans.

    I have dealt with java based webservice clients, I never noticed, order of the invocation affecting the runtime SOAP message format. it always matches the xsd or wsdl definition. I was in believe that webservice engine will honour the xsd schema at runtime.

    Mapping of variables used in the consumer builder is going to generate some kind of BO getter and setter invocation. Isnt it? in that case why the generated sample variable input structure is affecting the runtime soap message?
  • SystemAdmin
    SystemAdmin
    9029 Posts

    Re: WPF Webservice autocreate variable-generates in alphabetical order

    ‏2013-02-11T12:27:02Z  
    I have one query, Is it not the webservice engine forming the SOAP message from the java beans.

    I have dealt with java based webservice clients, I never noticed, order of the invocation affecting the runtime SOAP message format. it always matches the xsd or wsdl definition. I was in believe that webservice engine will honour the xsd schema at runtime.

    Mapping of variables used in the consumer builder is going to generate some kind of BO getter and setter invocation. Isnt it? in that case why the generated sample variable input structure is affecting the runtime soap message?
    We are using our custom variables generated from xsds. And we are using override inputs section to map this custom variables to the request variables. Some of the services were working fine and some were failing.so i went through all our applications to identify the any symptoms..

    Initially i thought, working services were using no override inputs. But it is not so. All the services we are using override inputs. (We were using so to avoid empty tags getting passed to service. in our implementation empty tags and no tags has two different meaning. While using full xml mapping service consumer builder was passing empty tags. so to avoid that we were mapping those fields which will create empty tags issue)

    All the working services(where request is similar to xsd) we were using web service multiple operation. and when i investigated the variables via input picker, variables created by Webservices multiple operation generates as per xsd and web service call builder does in alphabetical order.

    So i feel it is a code bug in webservice call builder rather than action list setting or override inputs.

    Mike could you clarify why webservice multiple operation works and webservice call builder not so?

    Thanks
    Selva
  • mburati
    mburati
    2560 Posts

    Re: WPF Webservice autocreate variable-generates in alphabetical order

    ‏2013-02-11T13:45:17Z  
    I have one query, Is it not the webservice engine forming the SOAP message from the java beans.

    I have dealt with java based webservice clients, I never noticed, order of the invocation affecting the runtime SOAP message format. it always matches the xsd or wsdl definition. I was in believe that webservice engine will honour the xsd schema at runtime.

    Mapping of variables used in the consumer builder is going to generate some kind of BO getter and setter invocation. Isnt it? in that case why the generated sample variable input structure is affecting the runtime soap message?
    • On the overrides, if it's just overriding XML supplied by something else, then I would expect it to retain order, I was more worried about whether all the inputs were being specified by override without initially being passed into the consumer builder's code.

    - Web Service MultiOperation is built on top of the Web Service Call support, so that is a bit surprising to me that you would find a difference like that - it could be a difference in the inputs passed to it? I'll ask an expert on the internals of those builders if he has an idea what would trigger that in one and not the other.

    If you post a sample (with no confidential info or intellectual property) reproducing the issue, it might make it easier for someone to quickly spot what's wrong with it.

    I hope that info helps,
    ..Mike Burati
    http://www-10.lotus.com/ldd/pfwiki.nsf/
    The postings on this site are my own and do not necessarily represent the positions, strategies, or opinions of IBM.
  • mburati
    mburati
    2560 Posts

    Re: WPF Webservice autocreate variable-generates in alphabetical order

    ‏2013-02-11T13:47:22Z  
    • mburati
    • ‏2013-02-11T13:45:17Z
    • On the overrides, if it's just overriding XML supplied by something else, then I would expect it to retain order, I was more worried about whether all the inputs were being specified by override without initially being passed into the consumer builder's code.

    - Web Service MultiOperation is built on top of the Web Service Call support, so that is a bit surprising to me that you would find a difference like that - it could be a difference in the inputs passed to it? I'll ask an expert on the internals of those builders if he has an idea what would trigger that in one and not the other.

    If you post a sample (with no confidential info or intellectual property) reproducing the issue, it might make it easier for someone to quickly spot what's wrong with it.

    I hope that info helps,
    ..Mike Burati
    http://www-10.lotus.com/ldd/pfwiki.nsf/
    The postings on this site are my own and do not necessarily represent the positions, strategies, or opinions of IBM.
    I forgot to mention, wrt the other question about above beans, since WEF uses schema described XML from the front end HTML UI generation all the way back to the back end services, it skips the extra steps that some web frameworks do of deserializing to Java objects and back to XML, and leverages the XML generated by page automation all the way back to the JAX-WS layer that the WS call builders use (older WPF used AXIS in a similar way).

    I hope that info helps,
    ..Mike Burati
    http://www-10.lotus.com/ldd/pfwiki.nsf/
    The postings on this site are my own and do not necessarily represent the positions, strategies, or opinions of IBM.