Topic
  • 7 replies
  • Latest Post - ‏2009-03-27T20:14:15Z by DGawron
abhishek198
abhishek198
17 Posts

Pinned topic How can i change the service call dynamically

‏2009-03-18T06:16:36Z |
Hi,
How can i change the web service that is being called based on a parameter (say organisation name).
I saw profiled web service builder, but couldn't make out much from it.
The list of services from where i have to choose is dynamic.
Regards
Abhishek Jain
Updated on 2009-03-27T20:14:15Z at 2009-03-27T20:14:15Z by DGawron
  • SystemAdmin
    SystemAdmin
    801 Posts

    Re: How can i change the service call dynamically

    ‏2009-03-18T13:30:44Z  
    You could try to profile the service URL, and expose it to its Customizer so that you could change the URL at runtime.
  • DGawron
    DGawron
    34 Posts

    Re: How can i change the service call dynamically

    ‏2009-03-18T15:21:10Z  
    Depends upon what you mean by "change". Are you trying to change the endpoint URL of the service, or are you trying to change the whole definition of the WSDL that defines the service? Service Call builder allows you to override parts of the endpoint URL and other aspects of the HTTP transport used to invoke the service.

    On the other hand, if the change you are talking about means that the WSDL is different at runtime (different operations, different schema types and elements), then there is little if anything the Service Call builders can do to help. These builders need to know the definition of the service (that is, the WSDL) at regen-time so that code can be generated to invoke the service operations and display the related data. If you don't even know what WSDL will be used then the builders cannot be used.

    Please describe in detail what you need to change about the services and at what point in time you have access to the data that tells you what service to invoke.
  • abhishek198
    abhishek198
    17 Posts

    Re: How can i change the service call dynamically

    ‏2009-03-19T07:07:59Z  
    • DGawron
    • ‏2009-03-18T15:21:10Z
    Depends upon what you mean by "change". Are you trying to change the endpoint URL of the service, or are you trying to change the whole definition of the WSDL that defines the service? Service Call builder allows you to override parts of the endpoint URL and other aspects of the HTTP transport used to invoke the service.

    On the other hand, if the change you are talking about means that the WSDL is different at runtime (different operations, different schema types and elements), then there is little if anything the Service Call builders can do to help. These builders need to know the definition of the service (that is, the WSDL) at regen-time so that code can be generated to invoke the service operations and display the related data. If you don't even know what WSDL will be used then the builders cannot be used.

    Please describe in detail what you need to change about the services and at what point in time you have access to the data that tells you what service to invoke.
    Hi,
    What we are trying to do here is that based on a given parameter .. we have to call a different
    service all together (different wsdl + different operation).
    The choice of wsdl and operation name has to be made dynamically, based on a list which we have locally with us.

    The wsdl files can be stored locally if required, so that we dont have to access remote wsdl everytime.
    Regards
    Abhishek Jain
  • bosox
    bosox
    10 Posts

    Re: How can i change the service call dynamically

    ‏2009-03-19T17:26:27Z  
    Hi,
    What we are trying to do here is that based on a given parameter .. we have to call a different
    service all together (different wsdl + different operation).
    The choice of wsdl and operation name has to be made dynamically, based on a list which we have locally with us.

    The wsdl files can be stored locally if required, so that we dont have to access remote wsdl everytime.
    Regards
    Abhishek Jain
    Since you want to call different service operations and these operations have different WSDL, I think you would need to have these operations defined in your provider and then perhaps in your consumer you can reference the different operations based on a parameter.

    The hard part here is that I don't think hat WPF will be able to handle the different data structures when building the UI. For example, you can profile the variable that data page displays and that should work, but then it makes it difficult if not impossible to apply other builders such as DataColumn modifier. You might be able to use a Rich Data Definition file that contains data definitions for the various schemas, but I haven't tried that out.
  • DGawron
    DGawron
    34 Posts

    Re: How can i change the service call dynamically

    ‏2009-03-19T22:47:00Z  
    Hi,
    What we are trying to do here is that based on a given parameter .. we have to call a different
    service all together (different wsdl + different operation).
    The choice of wsdl and operation name has to be made dynamically, based on a list which we have locally with us.

    The wsdl files can be stored locally if required, so that we dont have to access remote wsdl everytime.
    Regards
    Abhishek Jain
    The difficulty isn't with the location of the WSDLs. If you know the complete set of WSDLs and the set is reasonably small, then one way to tackle this is to create a service provider model and to it add a Web Service Multi Op builder per WSDL. Then in your service consumer model(s) you'd implement the set of UIs that correspond to the various operations available in the WSDLs. Finally, you'd profile your consumer model(s) using the data that determines what WSDL / UI should be applied for a user. In that way you can simulate the dynamic selection of the WSDL but still leverage all of WPF's regen-time niceness around UI development. Admittedly, I've describing this all at a very high level, but that's one of the approaches I'd first evaluate. Hopefully your requirement doesn't also involve the possibility of the selected WSDL changing within the scope of a user's session. If that's the case, then your job is a bit more difficult.
  • abhishek198
    abhishek198
    17 Posts

    Re: How can i change the service call dynamically

    ‏2009-03-22T07:12:25Z  
    • DGawron
    • ‏2009-03-19T22:47:00Z
    The difficulty isn't with the location of the WSDLs. If you know the complete set of WSDLs and the set is reasonably small, then one way to tackle this is to create a service provider model and to it add a Web Service Multi Op builder per WSDL. Then in your service consumer model(s) you'd implement the set of UIs that correspond to the various operations available in the WSDLs. Finally, you'd profile your consumer model(s) using the data that determines what WSDL / UI should be applied for a user. In that way you can simulate the dynamic selection of the WSDL but still leverage all of WPF's regen-time niceness around UI development. Admittedly, I've describing this all at a very high level, but that's one of the approaches I'd first evaluate. Hopefully your requirement doesn't also involve the possibility of the selected WSDL changing within the scope of a user's session. If that's the case, then your job is a bit more difficult.
    The thing is that the number of wsdls is not small (somewhere around 100) ..
    and it would increase whenever i add a new organisation.

    The idea is whenever i want to add a new organisation (which is why i need different wsdls) .. the admin
    should be able to do it through some kind of UI .. where he just specifies the path of the wsdl .. assuming here that the operations and their parameters would be same. If i pick the path of the wsdl dynamically the admin wont have to create a new provider model for the same.

    Next time i open that organisation's site .. the model should pick the path of the wsdl dynamically.
    Regards
    Abhishek Jain
  • DGawron
    DGawron
    34 Posts

    Re: How can i change the service call dynamically

    ‏2009-03-27T20:14:15Z  
    The thing is that the number of wsdls is not small (somewhere around 100) ..
    and it would increase whenever i add a new organisation.

    The idea is whenever i want to add a new organisation (which is why i need different wsdls) .. the admin
    should be able to do it through some kind of UI .. where he just specifies the path of the wsdl .. assuming here that the operations and their parameters would be same. If i pick the path of the wsdl dynamically the admin wont have to create a new provider model for the same.

    Next time i open that organisation's site .. the model should pick the path of the wsdl dynamically.
    Regards
    Abhishek Jain
    All of the operations and parameters being the same is a good . Are all of the results the same as are the namespaces in the WSDL? What I'm getting at is that if the only thing that actually changes per organization is the end-point URL, then the Web Service Call builder has advanced inputs that lets you override various parts of the end-point. You can have a single WSDL and only vary the end-point.