Sign In| Join
Get Help:Ask a Question in our Forums|Report a Bug|More Help Resources
Member
3 Points
5 Posts
May 21, 2012 06:53 AM|LINK
Im trying to seaparate Application Logic into different class libraries (reusability)
I have all data access logic in one clas slibrary, business logic in another etc.
Now I want the webServices in their own class library...not in the Web Application Project/ UI Frontend.
I Tried the Following
Adding a Service Reference to my Web App project....this created a Proxy in the web.config...GREAT!
<system.serviceModel> <bindings> <basicHttpBinding> <binding name="ObjectManagerSoap" closeTimeout="00:01:00" openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00" allowCookies="false" bypassProxyOnLocal="false" hostNameComparisonMode="StrongWildcard" maxBufferSize="65536" maxBufferPoolSize="524288" maxReceivedMessageSize="65536" messageEncoding="Text" textEncoding="utf-8" transferMode="Buffered" useDefaultWebProxy="true"> <readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384" maxBytesPerRead="4096" maxNameTableCharCount="16384" /> <security mode="None"> <transport clientCredentialType="None" proxyCredentialType="None" realm="" /> <message clientCredentialType="UserName" algorithmSuite="Default" /> </security> </binding> </basicHttpBinding> </bindings> <client> <endpoint address="http://localhost:5839/ObjectManager.asmx" binding="basicHttpBinding" bindingConfiguration="ObjectManagerSoap" contract="ServiceReference1.ObjectManagerSoap" name="ObjectManagerSoap" /> </client> </system.serviceModel>
Now I try to use the following Jquery to consume it
function Greeting() { $.ajax({ url: "http://localhost:5839/ObjectManager.asmx/HelloWorld", type: "POST", data: "{}", dataType: "xml", success: Success, error: ajaxFailed }); }
Function Ajax Failed returns
0 Error
function ajaxFailed(xmlRequest) { alert(xmlRequest.status + ' \n\r ' + xmlRequest.statusText + '\n\r' + xmlRequest.responseText); }
Ive moved the exact same WebService into the Web Application Project...and it works Once I move it to a Class Library outisde...I cant seem to reference it / find it.
nischal.bach...
Member
3 Points
5 Posts
Re: Is it Possible to call .asmx from separate class library in Web Application Solution
May 21, 2012 06:53 AM|LINK
Im trying to seaparate Application Logic into different class libraries (reusability)
I have all data access logic in one clas slibrary, business logic in another etc.
Now I want the webServices in their own class library...not in the Web Application Project/ UI Frontend.
I Tried the Following
Adding a Service Reference to my Web App project....this created a Proxy in the web.config...GREAT!
<system.serviceModel> <bindings> <basicHttpBinding> <binding name="ObjectManagerSoap" closeTimeout="00:01:00" openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00" allowCookies="false" bypassProxyOnLocal="false" hostNameComparisonMode="StrongWildcard" maxBufferSize="65536" maxBufferPoolSize="524288" maxReceivedMessageSize="65536" messageEncoding="Text" textEncoding="utf-8" transferMode="Buffered" useDefaultWebProxy="true"> <readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384" maxBytesPerRead="4096" maxNameTableCharCount="16384" /> <security mode="None"> <transport clientCredentialType="None" proxyCredentialType="None" realm="" /> <message clientCredentialType="UserName" algorithmSuite="Default" /> </security> </binding> </basicHttpBinding> </bindings> <client> <endpoint address="http://localhost:5839/ObjectManager.asmx" binding="basicHttpBinding" bindingConfiguration="ObjectManagerSoap" contract="ServiceReference1.ObjectManagerSoap" name="ObjectManagerSoap" /> </client> </system.serviceModel>Now I try to use the following Jquery to consume it
function Greeting() { $.ajax({ url: "http://localhost:5839/ObjectManager.asmx/HelloWorld", type: "POST", data: "{}", dataType: "xml", success: Success, error: ajaxFailed }); }Function Ajax Failed returns
0 Error
function ajaxFailed(xmlRequest) { alert(xmlRequest.status + ' \n\r ' + xmlRequest.statusText + '\n\r' + xmlRequest.responseText); }Ive moved the exact same WebService into the Web Application Project...and it works
Once I move it to a Class Library outisde...I cant seem to reference it / find it.