This is Interesting: Free Magazines for Graphics designers and webmasters
Home > Archive > Mozilla XML > July 2005 > soap messages
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
|
|
| rami messiha 2005-07-21, 4:50 am |
| i am trying to use web services within a thunderbird extention. i
followed the tutorial at
http://www.oreillynet.com/pub/a/jav...llasoapapi.html
but i got a very strange error.
when i get a string response i could access it using result.value() as
in the tute. however when i try the same with anything else be it a
boolean or an integer i get nothing back. doing a result.type() gives
me the respective (and correct) type but result.value() is still a
blank. any ideas on what to o
| |
| Martin Honnen 2005-07-21, 7:37 pm |
|
rami messiha wrote:
> i am trying to use web services within a thunderbird extention. i
> followed the tutorial at
> http://www.oreillynet.com/pub/a/jav...llasoapapi.html
>
> but i got a very strange error.
>
> when i get a string response i could access it using result.value() as
> in the tute.
Where does the tutorial say that you should access
result.value()
? That would be a method call.
> however when i try the same with anything else be it a
> boolean or an integer i get nothing back. doing a result.type() gives
> me the respective (and correct) type but result.value() is still a
> blank. any ideas on what to o
You will need to post details about the web service you are trying to
access, a description of the methods you are trying to call, the (URL to
the) WSDL if there is one.
How is that service implemented? Do other web service clients work with
the service but Mozilla fails?
And then show us exactly which code you are using, where the result
variable is set for instance so that it is clear what you are doing.
--
Martin Honnen
http://JavaScript.FAQTs.com/
| |
| rami messiha 2005-07-23, 4:15 am |
|
Martin Honnen wrote:
> Where does the tutorial say that you should access
> result.value()
> ? That would be a method call.
sorry about that i meant the following code fragment
var num = new Object();
var params = result.getParameters(false,num);
var suggestion = params[0].value;
> You will need to post details about the web service you are trying to
> access, a description of the methods you are trying to call, the (URL to
> the) WSDL if there is one.
its a majer project i am working on for uni. this is the WSDL url
http://whale.ee.usyd.edu.au:8080/ax...let/AxisServlet
> How is that service implemented? Do other web service clients work with
> the service but Mozilla fails?
the service is implemented using .jws (java) on apatche tomcat
container i have the .jws file if needed
>
> And then show us exactly which code you are using, where the result
> variable is set for instance so that it is clear what you are doing.
>
this is the code i am using to connect to the web service
function callSoapService(method,params,callback)
{
try
{
netscape.security.PrivilegeManager.enablePrivilege("UniversalBrowserRead");
}
catch (e)
{
alert(e);
return false;
}
var soapCall = new SOAPCall();
soapCall.transportURI =
"http://whale.ee.usyd.edu.au:8080/axis/services/Awacate";
soapCall.encode(0, method, "awacate", 0, null, params.length, params);
soapCall.asyncInvoke(
function (response, soapcall, error)
{
var r = handleSOAPResponse(response,soapcall,error);
callback(r);
}
);
}
function handleSOAPResponse (response,call,error)
{
if (error != 0)
{
alert("Service failure");
return false;
}
else
{
var fault = response.fault;
if (fault != null) {
var code = fault.faultCode;
var msg = fault.faultString;
alert("SOAP Fault:\n\n" +
"Code: " + code +
"\n\nMessage: " + msg
);
return false;
} else
{
return response;
}
}
}
function createCategoriser(result)
{
if (result==false)
{
return;
}
var num = new Object();
var params = result.getParameters(false,num);
categoriserid = params[0].value;
...
}
and here is where i use it all
function getcategoriser()
{
...
var params = new Array();
callSoapService("createCategoriser2",params,createCategoriser);
}
thanks a lot any help will be great
| |
| rami messiha 2005-07-23, 4:15 am |
| i did a tcp session capture an had a look at both methodes apparently
the createcategoriser return the following
soapenv:Envelope
xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsd="http://www.w3.org/1999/XMLSchema"
xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance">
<soapenv:Body>
<ns1:createCategoriserResponse
soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:ns1="awacate">
<createCategoriserReturn href="#id0"/>
</ns1:createCategoriserResponse>
<multiRef id="id0" soapenc:root="0"
soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
xsi:type="ns2:int"
xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:ns2="http://www.w3.org/2001/XMLSchema">
31
</multiRef>
</soapenv:Body>
</soapenv:Envelope>
while createcategoriser2 return the following
<soapenv:Envelope
xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsd="http://www.w3.org/1999/XMLSchema"
xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance">
<soapenv:Body>
<ns1:createCategoriser2Response
soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:ns1="awacate">
<createCategoriser2Return xsi:type="ns2:string"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:ns2="http://www.w3.org/2001/XMLSchema">
30
</createCategoriser2Return>
</ns1:createCategoriser2Response>
</soapenv:Body>
</soapenv:Envelope>
its possible that i might need to create a custom de-serialiser, but i
am not sure. i need to look into it more; any feedback will be good.
|
|
|
| | Copyright 2003 - 2008 forum4designers.com Software forum Computer Hardware reviews |
|