locked
Web Service getting url and soap data - Design question RRS feed

  • Question

  • User1050528043 posted

    Hi

    I'm currently updating an old (over 5 years) web Service (can't do much about the consumer side as that is fixated).

    The Service has the following layout for one of its methods:

    public string ServiceProc(string programName, string code, string requestcode, int datalength, short timeout)
    
    

    Inside that method parts of the URL itself were decoded and include a user id and some other data (userId, nextUrl, Codepage).

    Back then  WebService.Server.UrlDecode was used to decode the Url itself.

    Now what I'm not so sure about is how it Looks These days. Do I still have to use those old design methods (and classes), or is there any way to use a more modern Approach like MVC 4 there?

    (MVC I've seen for URL only things already, but in this case ist a bit of a mix between URL and Soap data Transfer, so I'm not sure if ist possible at all that way or not)

    Tuesday, December 5, 2017 11:50 AM

All replies

  • User475983607 posted

    Now what I'm not so sure about is how it Looks These days. Do I still have to use those old design methods (and classes), or is there any way to use a more modern Approach like MVC 4 there?

    HTTP allows data in the URL and data in the message body.  It seems that the SOAP service mentioned above used the URL to send data as well as the message body to send SOAP.  While arguably a bad practice in SOAP services, it is fine and a normal practice in web applications like MVC.

    (MVC I've seen for URL only things already, but in this case ist a bit of a mix between URL and Soap data Transfer, so I'm not sure if ist possible at all that way or not)

    SOAP is a protocol (Simple Object Access Protocol) which defines how the HTTP message formatted (not how the URL is formatted).  The formatting is defined by the WSDL (Web Service Definition Language) which means a client can parse the WSDL to find the methods, inputs, and outputs available in the SOAP service.  

    MVC does not use SOAP.  MVC uses HTTP form posts and it is common to see JSON formatting messages.  If you want SOAP services you'll need to add a SOAP service (ASMX or WCF) to the project. 

    Tuesday, December 5, 2017 12:25 PM
  • User1050528043 posted

    From trying a bit in the past I know that WCF can be a bit tricky (in Terms of configuration mostly). Is ASMX there any easier to use?

    Tuesday, December 5, 2017 12:28 PM
  • User475983607 posted

    From trying a bit in the past I know that WCF can be a bit tricky (in Terms of configuration mostly). Is ASMX there any easier to use?

    Yes, WCF is far more complex than ASMX. 

    These days services are moving to a REST style.  

    Tuesday, December 5, 2017 12:31 PM
  • User-335504541 posted

    Hi Thomas7805,

    Now what I'm not so sure about is how it Looks These days. Do I still have to use those old design methods (and classes), or is there any way to use a more modern Approach like MVC 4 there?

    Do you want to consume soap service in <g class="gr_ gr_33 gr-alert gr_spell gr_inline_cards gr_disable_anim_appear ContextualSpelling ins-del multiReplace" id="33" data-gr-id="33">mvc</g>?

    You could <g class="gr_ gr_86 gr-alert gr_spell gr_inline_cards gr_run_anim ContextualSpelling ins-del multiReplace" id="86" data-gr-id="86">right click</g> the References node in your <g class="gr_ gr_105 gr-alert gr_spell gr_inline_cards gr_run_anim ContextualSpelling ins-del multiReplace" id="105" data-gr-id="105">mvc</g> project and click use add service reference.

    Then input <g class="gr_ gr_174 gr-alert gr_gramm gr_inline_cards gr_run_anim Grammar only-del replaceWithoutSep" id="174" data-gr-id="174">the your</g> web service <g class="gr_ gr_163 gr-alert gr_spell gr_inline_cards gr_run_anim ContextualSpelling ins-del multiReplace" id="163" data-gr-id="163">url</g> to add the reference.

    You could refer to the links below for more information:

    http://www.c-sharpcorner.com/article/consuming-web-service-in-asp-net-mvc/

    http://www.c-sharpcorner.com/UploadFile/d13d20/creating-aspnet-mvc-app-with-wcf-service-docx/

    http://www.c-sharpcorner.com/UploadFile/krishnasarala/accessing-wcf-service-in-Asp-Net-mvc-application/

    Best Regards,

    Billy

    Wednesday, December 6, 2017 8:52 AM