Showing posts with label services. Show all posts
Showing posts with label services. Show all posts

Wednesday, March 28, 2012

Accessing webservice over HTTPS with ajax

hey everyone, just an easy lil question to start me off into the world of ajax and web services :D

i have created a webservice that is located athttps://active.innerstruct.com/ausclans/webservices/ausclans.asmx

i've included it in the ScriptManager Services tag

but i'm still getting errors :(

do i have to create a web reference like the standard web services?

What is the exception?


FYI Cross Domain call is not allowed. The Web Service must exist in the same virtual directory/site.

Accessing Web Services that are external to my application.

Is it possible to use the <atlas:servicereference> to set a path to a web service that doesn't exist within the same application as the consuming aspx file?

All the samples and examples show the <atlas:servicereference path="" /> containing the path to an asmx file located within the same application as the consuming aspx file. How would I set a reference tohttp://somedomain/someapp/someservice.asmx ?

This can't easily be done because XmlHttp (the browser component used to make requests) disallow requests to other domain for security reasons. Note that youcan make requests to Atlas services in other apps, as long as they're in the samedomain. e.g. foo.mydomain.com can use bar.mydomain.com.

In the next build of Atlas (around march), we will allow a limited form of cross domain method calls to Atlas services (without using XmlHttp).


Thanks. I can just reference the external web services from with the one local to my application.
Yes, doing this is what we call 'bridging', and we will also have addition support for this is a later build. In the meantime, do whatever gets you going! :-)

Monday, March 26, 2012

Accessing ASP.NET Profile

Hi,

How can I update Profile propertys in my Atlas application? Since I don't use update panels, I call web services to make server requests. I know that I can access the Session by declaring [WebMethod(EnableSession=true)], but can I also enable Profiles there?

Or are there alternatives to web services?

In javascript, you access profile properties using something like:

Sys.Profile.properties["list"] = [1, 2, 3];

And then you want to call:

Sys.Profile.save();

To enable this feature, you do need to have a few things in config defined:

<configSections>
<section name="profileService" type="Microsoft.Web.Configuration.ProfileServiceSection" requirePermission="false" />
</sectionGroup>
</configSections>

<microsoft.web>
<profileService enabled="true" getProperties="*" setProperties="*" />
</microsoft.web>

This will enable atlas access to the Profile object, and let you get and set all properties, note you can lock down which propeties you want get/settable thru atlas using the get/setProperties in the profileService section.

Hope that helps,
-Hao


Thank's a lot. After your reply I searched the atlas docs again and now I have no clue, why I overlooked the profile topic before!Wink [;)]

This feature is so cool!Cool [cool] I love Atlas more everyday...

Access not running webservice methods with only wsdl file

Hello!

I'm new to web services. I'm using Visual Studio 2005, I'm developing a web app (c#). This application will use a java web service (hosted by tomcat) on the local machine. This webservice need some config to run, but on my developer machine i cannot make this configs.
My question: I cannot run the webservice, so I cannot add it to my "Web references", so I cannot insert the function calls into my code. BUT I have a wsdl file. So, is there any way to add a web reference to my code with this wsdl? (It will not work, but i can build my project)

Many thx

Hi,

Thank you for you post!

Here:

#Web Services Integrationhttp://msdn2.microsoft.com/en-us/library/aa478995.aspx

<quote>

In order to add a Web Reference to a .NET Framework-based Web service client, the target Web service must have a WSDL document available. Apache SOAP 2.2oes not contain any support for WSDL.

</quote>

Apache AXIS, also known as Apache SOAP 3.0, supported generating WSDL files.

We have just tested and VS can add web reference using a local WSDL file.

BTW,Wsdl.exe accepts the path to the wsdl file to generate a proxy.http://msdn2.microsoft.com/en-us/library/7h3ystb6(VS.80).aspx

If you have further questions,let me know.

Best Regards,


Hy!

Thanks for your answer. I solve it strange way: I put the wsdl file to my localhost, so i can add it to my web reference list. It did not work, but i could build my project.


Hi,

I told you in my last reply:

We have just tested and VS can add web reference using a local WSDL file.

So that is the answer:)

Happy coding.

Saturday, March 24, 2012

about itemView Databind

I'm sorry for my poor english :)

javascript:

function ShowEdit()
{
Sunlinks.WebOA.Web.Services.CommonCodeService.GetOne(onGetComplete);
}
function onGetComplete(result)
{
var templ= $('divcontent').control;
templ.set_data(result);

}

function onSaveComplete(result)
{
alert(result);
}
function savedatas()
{

var templ= $('divcontent').control;
var result=templ.get_data();
Sunlinks.WebOA.Web.Services.CommonCodeService.SaveCommonCode(result,onGetComplete);

}

html:

<input id="Button1" type="button" value="edit" onclick="ShowEdit();" />

<input id="Button2" type="button" onclick="savedatas();" value="button" />

<div id="divcontent" ></div>

<div id="detailsTemplate">
<input id="txtName" type="text" /><br />
<input id="txtFullName" type="text" /><br />
<input id="txtShortName" type="text" /><br />
<input id="txtCode" type="text" /><br />
<input id="txtOrder_num" type="text" /><br />
<input id="chkIsClose" type="checkbox" /><br />
</div>

<page xmlns:script="http://schemas.microsoft.com/xml-script/2005">
<components>


<itemView id="divcontent">
<itemTemplate>
<template layoutElement="detailsTemplate">
<textBox id="txtName">
<bindings>
<binding dataPath="Name" property="text" direction="InOut"/>
</bindings>
</textBox>
<textBox id="txtFullName">
<bindings>
<binding dataPath="FullName" property="text" direction="InOut"/>
</bindings>
</textBox>
</template>
</itemTemplate>
</itemView >
</components>
</page>

now the question:

tmpl.set_data(); work fine

but when txtFullName or txtName lost fouce then atlas throw a error

but when I change direction="In" ,it's no error

hello.

well, it looks like waht you0re trying to accomplish can only be done through a datasource:

http://atlas.asp.net/docs/atlas/doc/data/default.aspx#itemview

Thank USmile [:)]