i understand a part of issue ..... cant initialize a class because of abstract but was able to do in webforms
i need to initialize it to set credentials , timeout etc of web service so i could further use other functions like i did in webforms
lm.Credentials = new System.Net.NetworkCredential("username", "password");
lm.Timeout = -1; // never timeout
// Those two lines below are needed to NOT waste one extra connection EACH request
lm.PreAuthenticate = true;
lm.UnsafeAuthenticatedConnectionSharing = false;
newbiefreak
Member
468 Points
214 Posts
MVC 3 and managing 3rd party WebService SOAP API
Dec 21, 2012 08:27 AM|LINK
hi,
i am new in MVC3 and working on a project in which i have integrate 3rd party SOAP API and its functionality
i am having trouble with it and dont know how to handle it in MVC 3.
where should i code functions related to API ? in controller or model ?
also i had tried to create and initialize API in controller it gives error
Error 1 Cannot create an instance of the abstract class or interface
please give me some guidelines for it
ignatandrei
All-Star
134973 Points
21638 Posts
Moderator
MVP
Re: MVC 3 and managing 3rd party WebService SOAP API
Dec 21, 2012 08:57 AM|LINK
In the Model, as possible.
What error? What API ? Did you discuss with
authors?newbiefreak
Member
468 Points
214 Posts
Re: MVC 3 and managing 3rd party WebService SOAP API
Dec 21, 2012 08:59 AM|LINK
error is
Error 1 Cannot create an instance of the abstract class or interface
SOAP API of
ListManager 11.2
newbiefreak
Member
468 Points
214 Posts
Re: MVC 3 and managing 3rd party WebService SOAP API
Dec 21, 2012 09:25 AM|LINK
i was successfully implemented it in WebForms but having problem in MVC
in webform i had simple created a object in the beginner with the namespace and class name and start using it
by that object i could get reference to all the function of WebService
but having trouble in managing in MVC
newbiefreak
Member
468 Points
214 Posts
Re: MVC 3 and managing 3rd party WebService SOAP API
Dec 21, 2012 10:16 AM|LINK
i understand a part of issue ..... cant initialize a class because of abstract but was able to do in webforms
i need to initialize it to set credentials , timeout etc of web service so i could further use other functions like i did in webforms
lm.Credentials = new System.Net.NetworkCredential("username", "password"); lm.Timeout = -1; // never timeout // Those two lines below are needed to NOT waste one extra connection EACH request lm.PreAuthenticate = true; lm.UnsafeAuthenticatedConnectionSharing = false;newbiefreak
Member
468 Points
214 Posts
Re: MVC 3 and managing 3rd party WebService SOAP API
Dec 21, 2012 10:55 AM|LINK
found the problem i was adding web service reference as service referenec in project because of it i was having problem
after adding the reference as web reference now i am able to intiailze object ...
see this link too for more information
http://markfreedman.com/index.php/2010/10/13/web-reference-vs-service-reference/
ignatandrei
All-Star
134973 Points
21638 Posts
Moderator
MVP
Re: MVC 3 and managing 3rd party WebService SOAP API
Dec 21, 2012 10:56 AM|LINK
Make this way: put the code into a dll. Modify WebForms to read data from a function in a dll that calls the 3rd party API. Assure that works.
In MVC make reference to the same function. Assure that works. If not, come back with a question.
ignatandrei
All-Star
134973 Points
21638 Posts
Moderator
MVP
Re: MVC 3 and managing 3rd party WebService SOAP API
Dec 21, 2012 10:57 AM|LINK
so you did not make the same as in the WebForms project...