I just received this ASP.NET Atlas question via direct email, so thought I'd answer it publically:
I have a web project that has a AutoCompleteExtender textbox. Everything works fine if my .asmx file is in the same project.
<atlas:AutoCompleteExtender runat="server" ID="CustomerList"> <atlas:AutoCompleteProperties Enabled="true" MinimumPrefixLength="1" ServicePath="NorthwindService.asmx" ServiceMethod="AutoCompleteCustomerList" TargetControlID="customer"/> </atlas:AutoCompleteExtender>
But as soon as I move the .asmx file to another project and add a web reference to the web project the WebMethod isn't being fired.
<atlas:AutoCompleteExtender runat="server" ID="CustomerList"> <atlas:AutoCompleteProperties Enabled="true" MinimumPrefixLength="1" ServicePath="http://server2/App/NorthwindService.asmx" ServiceMethod="AutoCompleteCustomerList" TargetControlID="customer"/> </atlas:AutoCompleteExtender>
Same Host but Different Applications
If the web service you're attempting to hit is on the same host (eg http://localhost/App1/MyPage.aspx calling http://localhost/App2/MyService.asmx) then your issue most likely revolves around the proxy generation.
If the web service you're attempting to hit is not on the same host (eg http://server1/MyPage.aspx calling http://server2/MyService.asmx) then your issue is the result of a security restriction:
Other than linking to external resource files (for example, image files, CSS files, script files, and so on), browser applications are restricted to accessing resources available on their home server. However, there is a great variety of Web services available on the Web, and the restriction to a home server limits what can be returned within the scope of a browser application.
To circumvent this restriction (in a secure way) you need to use an Atlas bridge, as documented here:
7 thoughts on “Calling external web services in ASP.NET Atlas”
I knew that If I searched your name you would have a blog!! He he…
I was a littly confused though with the Title and paragraph.
Same host, different applications.
“If the web service you’re attempting to hit is on the same host (eg http://localhost/App1/MyPage.aspx calling http://localhost/App2/MyService.asmx) then your issue most likely revolves around the proxy generation.”
I think it should be
Same hosts, different Atlas applications.
As even if you have the same host but one application is an Atlas web application and the other is a Web Service application (non-atlas) then the web method will never be called.
@Clayton – The title/paragraph refers to different ASP.NET applications on the same box … and how it wouldn’t work unless they were both Atlas applications because of the lack of proxy generation hooks.
I have an atlas app and a web service running on the same host but are different applications. I have read your explanation and tried your example. My question is: How do I take a look at the proxy atlas creates? I can find no file with a /js suffix. Also, where do I put the reference to the webservice file? I tried putting it in the
Can anyone tell me how to create my own proxy. Is there an example out there?
I have 2 computer in LAN. C1 is 192.168.1.2 and C2 is 192.168.1.3. Both use WindowXP and IIS. A webservice called DemoWS1 is built on C1 (ex: Hello world). I want to invoke that webservice from C2. When I add “web references”, I inputed the URL below: http://192.168.1.2/DemoWS1/Service1.asmx.
But it hasn’t found that page.
What happen? Please help… I want to know how to call external webservice?
Comments are closed.