Wednesday, March 21, 2012

Declarative WebService call

Hi everybody

I just tried to call a method with MS-Ajax and the xml-script ... but in some way it doesn't work ...

This is the code:

-----------


<script type="text/xml-script">
<page xmlns="http://schemas.microsoft.com/xml-script/2005">
<components>
<label id="LbTest" /
<button id="BtTest">
<click>
<setPropertyAction target="LbTest" property="text" value="TestStarted" />
<invokeMethodAction target="CFCCall" method="invoke">
<parameters userContext="" />
</invokeMethodAction>
</click>
</button
<serviceMethodRequest id="CFCCall" url="Services/SCheck.asmx" methodName="Test.Web.CheckClass.Check">
<completed>
<setPropertyAction target="LbTest" property="text" value="TestCompleted" />
</completed>
<error>
<setPropertyAction target="LbTest" property="text" value="TestError" />
</error>
</serviceMethodRequest>
</components>
</page>
</script>

-----------

I got a check method in my checkclass in the webservice, which is in the namespace "Test.Web".

If I call this with JS directly, I'm getting my result - but if I'm doing it this way - I just get the "TestError" label-value. Any ideas?

Found the problem: It was the webservice - The webservice denies by default GET requests... does anyone know how I could switch the default method in xml-script to POST (i can't enable GET in the webservice, because I don't have access to it)... Or does someone know how I can call a Javascript in XML-script? Because with an JS I could make call and tell the call to use POST...

No comments:

Post a Comment