Calling Web Services Dynamically - Help Urgently needed

Ask a Question related to ASP.NET Web Services, Design and Development.

  1. #1

    Default Calling Web Services Dynamically - Help Urgently needed

    We have 2 web services:

    Payments: Allows uses to pay using ACH (ACHDebit.asmx) or Credit Cards (CCDebit.asmx), and it has adminstration functions (Administrations.asmx). This resides on our internal web farm and is not accessible to anyone outside.

    Payment Router: This is a single web service that basically take the payment type and and XML payload that has all the necessary payment information. Right now we are looking up the payment type and getting the URL (example: [url]http://mysite.com/Payment_Router/Router.asmx/BeginTransaction[/url]). We then take this URL and the payload and create a web request and do a post to the appropriate paymnet web service (ACHDebit.asmx - ACHDebitTrans() or CCDebit.asmx - CCDebitTrans). We just upgraded to version 1.1 of the framework and I want to use a SOAP call to the internal services instead of a POST so I can disable POST and GETS to the Payments web service. We need to keep using the database to look up which web service to direct the call to because for most payments we have a production payment (call web service on production servers) and a test payment (call web services on QA servers). We do this so that customers have a way to test their calls to the web services without habing to have a QA environment within our external DMZ.

    Below is code that I have written and from the testing I've done it seems to work. The thing I don't like about it is that I have to create a web reference for each payment type (setting the URLBehavior to Dynamic) so I can write the code to call the funcition that relates the the payment type being made. Is this the only way to do this with .Net or am I missing something? If there is a better way, can someone send me and example of the better way of doing this?

    Dim wsACHDebit As New PaymentEngine_Router.ACH.ACHDebit
    Dim umbACHReturn As New PaymentEngine_Router.ACH.UMBError
    Dim wsCCDebit As New PaymentEngine_Router.CC.CCDebit
    Dim umbCCReturn As New PaymentEngine_Router.CC.UMBError

    'Strip off function call for URL that is stored in database, since it is setup to do a post.
    'this won't be needed it I update the database field to only store the URL without the function call
    sURL = sURL.Substring(0, sURL.LastIndexOf("/"))
    If PaymentType.ToUpper = "ACH DEBIT" Or PaymentType.ToUpper = "ACH DEBIT TEST" Then
    wsACHDebit.Url = sURL

    umbACHReturn = wsACHDebit.CreateACHDebitTransaction(Payload)
    umbeTemp.Description = umbACHReturn.Description
    umbeTemp.IsError = umbACHReturn.IsError
    umbeTemp.IsValidation = umbACHReturn.IsValidation
    umbeTemp.Message = umbACHReturn.Message
    ElseIf PaymentType.ToUpper = "VIAKLIX_CC" Or PaymentType.ToUpper = "VIAKLIX_CC TEST" Then
    wsCCDebit.Url = sURL

    umbCCReturn = wsCCDebit.CreateCCDebitTransaction(Payload)
    umbeTemp.Description = umbCCReturn.Description
    umbeTemp.IsError = umbCCReturn.IsError
    umbeTemp.IsValidation = umbCCReturn.IsValidation
    umbeTemp.Message = umbCCReturn.Message
    End If

    Soemone also suggested I use the WCE.Router functionality in 1.0 of WCE. I am willing to do this but I spent most of the day trying to figure out how to do this using the WCE. The project that needs this is on a pretty tight timeline so I cannot waste to much more time trying to figure out how to use WCE to do this. If someone can give me sample code that will show me what I need to do, a WCE solution would also be appreciated.

    Thanks in advance for all the help,
    S. Shawn Mehaffie


    Shawn & Jo-an Mehaffie Guest

  2. Similar Questions and Discussions

    1. cfloop help urgently needed!!!
      how do i output a loop with a dash and and a sequence. for example 1010-1, 1010-2, 1010-3, 1010-4, 1010-5 .......1010-99, 1010-100.
    2. Brush Advice Needed Urgently!
      Does anyone have any quick advice on how to do a brush that looks realistically like a ballpoint pen? (ie: generally even weight but with small,...
    3. help needed urgently!!!
      if you know something about flashMX2004 and the trial version could you go to my other post in general discussion please??? I really nadly need help,...
    4. Socket programming help needed urgently
      "sridhar" <gsridhar78@yahoo.com>wrote: .... snipped out .... big parts snipped out ...... Hi sridhar,
  3. #2

    Default Re: Calling Web Services Dynamically - Help Urgently needed

    Shawn,

    I might be missing the point of your problem here, however, I'll try to help. You don't need to set a web reference to each payment type. Why not have just one web service and put all the methods you need in there?

    In our project, we have over 37 servers across the US controlled by a single server in the home office using web services to push and pull data. Most of our business layer methods are exposed by a thin interface in a single web service for each method. We are doing what you are doing, creating a dynamic proxy and then feeding it the location. So, I think it is up to you how to slice and dice your services. If they are on the same box why have two services?

    Mike

    "Shawn & Jo-an Mehaffie" <ssm_jgm@hotmail.com> wrote in message news:uxasmBlUDHA.2284@TK2MSFTNGP11.phx.gbl...
    We have 2 web services:

    Payments: Allows uses to pay using ACH (ACHDebit.asmx) or Credit Cards (CCDebit.asmx), and it has adminstration functions (Administrations.asmx). This resides on our internal web farm and is not accessible to anyone outside.

    Payment Router: This is a single web service that basically take the payment type and and XML payload that has all the necessary payment information. Right now we are looking up the payment type and getting the URL (example: [url]http://mysite.com/Payment_Router/Router.asmx/BeginTransaction[/url]). We then take this URL and the payload and create a web request and do a post to the appropriate paymnet web service (ACHDebit.asmx - ACHDebitTrans() or CCDebit.asmx - CCDebitTrans). We just upgraded to version 1.1 of the framework and I want to use a SOAP call to the internal services instead of a POST so I can disable POST and GETS to the Payments web service. We need to keep using the database to look up which web service to direct the call to because for most payments we have a production payment (call web service on production servers) and a test payment (call web services on QA servers). We do this so that customers have a way to test their calls to the web services without habing to have a QA environment within our external DMZ.

    Below is code that I have written and from the testing I've done it seems to work. The thing I don't like about it is that I have to create a web reference for each payment type (setting the URLBehavior to Dynamic) so I can write the code to call the funcition that relates the the payment type being made. Is this the only way to do this with .Net or am I missing something? If there is a better way, can someone send me and example of the better way of doing this?

    Dim wsACHDebit As New PaymentEngine_Router.ACH.ACHDebit
    Dim umbACHReturn As New PaymentEngine_Router.ACH.UMBError
    Dim wsCCDebit As New PaymentEngine_Router.CC.CCDebit
    Dim umbCCReturn As New PaymentEngine_Router.CC.UMBError

    'Strip off function call for URL that is stored in database, since it is setup to do a post.
    'this won't be needed it I update the database field to only store the URL without the function call
    sURL = sURL.Substring(0, sURL.LastIndexOf("/"))
    If PaymentType.ToUpper = "ACH DEBIT" Or PaymentType.ToUpper = "ACH DEBIT TEST" Then
    wsACHDebit.Url = sURL

    umbACHReturn = wsACHDebit.CreateACHDebitTransaction(Payload)
    umbeTemp.Description = umbACHReturn.Description
    umbeTemp.IsError = umbACHReturn.IsError
    umbeTemp.IsValidation = umbACHReturn.IsValidation
    umbeTemp.Message = umbACHReturn.Message
    ElseIf PaymentType.ToUpper = "VIAKLIX_CC" Or PaymentType.ToUpper = "VIAKLIX_CC TEST" Then
    wsCCDebit.Url = sURL

    umbCCReturn = wsCCDebit.CreateCCDebitTransaction(Payload)
    umbeTemp.Description = umbCCReturn.Description
    umbeTemp.IsError = umbCCReturn.IsError
    umbeTemp.IsValidation = umbCCReturn.IsValidation
    umbeTemp.Message = umbCCReturn.Message
    End If

    Soemone also suggested I use the WCE.Router functionality in 1.0 of WCE. I am willing to do this but I spent most of the day trying to figure out how to do this using the WCE. The project that needs this is on a pretty tight timeline so I cannot waste to much more time trying to figure out how to use WCE to do this. If someone can give me sample code that will show me what I need to do, a WCE solution would also be appreciated.

    Thanks in advance for all the help,
    S. Shawn Mehaffie


    Mike Malter Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139