You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@axis.apache.org by Gagan Sinha <ga...@gmail.com> on 2007/06/07 21:57:03 UTC
AJAX code not able to get Response from WebService hosted in Axis 1.4
Hi
This is the First Web Service I have created. I have followed the following
Steps
1. Deployed the axis as a web application in Weblogic 8.1 sp2
2. Created a simple WebService called FirstWebService (appends Hello to
the passed String and returns the new String) and updated the
server-config.xml
3. Also Enabled the SoapMonitor for this webService.
4. The url
http://localhost:7001/7001/axis/services/FirstWebservice?wsdl returns me the
wsdl file and works fine the eclipse plugin which creates the SOAP request
and sends back the response using the wsdl file.
----------------------------------------------SOAP
REQUEST----------------------------------------------
<?xml version="1.0" encoding="ISO-8859-1"?>
<SOAP-ENV:Envelope
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:m="http://test.webservices.hrblock.com"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<SOAP-ENV:Body>
<sayHello xmlns="http://test.webservices.hrblock.com">
<poName xsi:type="xsd:string">Gagan
</poName>
</sayHello>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
---------------------------SOAP
RESPONSE--------------------------------------------------------------------
--
<?xml version="1.0" encoding="ISO-8859-1"?>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<soapenv:Body>
<ns1:sayHelloResponse
soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:ns1="http://test.webservices.hrblock.com">
<sayHelloReturn
xsi:type="xsd:string">HelloGagan</sayHelloReturn>
</ns1:sayHelloResponse>
</soapenv:Body>
</soapenv:Envelope>
But when I try to send the request using AJAX XMLHttpRequest it returned a
fault code "NoSOAPAction".
On Setting the setReqestHeader("SOAPAction","/") . It now Returns ..
<faultcode>soapenv:Server.userException</faultcode><faultstring>org.xml.sax.
SAXParseException: Element type "SOAP-ENV:Envelope" must be
followed by either attribute specifications, ">" or
"/>".</faultstring>
Any Suggestions on how to get it working.
Thanks in Advance
Regards
Gagan
Re: AJAX code not able to get Response from WebService hosted in Axis 1.4
Posted by Tugdual Grall <tu...@gmail.com>.
Hello Gagan,
Have you tried to send the SOAPAction as an HTTP Header?
Tugdual Grall
http://www.grallandco.com
On 6/7/07, Gagan Sinha <ga...@gmail.com> wrote:
>
> Hi
>
>
>
> This is the First Web Service I have created. I have followed the
> following Steps
>
>
>
> 1. Deployed the axis as a web application in Weblogic 8.1 sp2
> 2. Created a simple WebService called FirstWebService (appends Hello
> to the passed String and returns the new String) and updated the
> server-config.xml
> 3. Also Enabled the SoapMonitor for this webService.
> 4. The url
> http://localhost:7001/7001/axis/services/FirstWebservice?wsdlreturns me the wsdl file and works fine the eclipse plugin which creates the
> SOAP request and sends back the response using the wsdl file.
>
>
>
> ----------------------------------------------SOAP
> REQUEST----------------------------------------------
>
> <?xml version="1.0" encoding="ISO-8859-1"?>
>
> <SOAP-ENV:Envelope xmlns:SOAP-ENV="
> http://schemas.xmlsoap.org/soap/envelope/" xmlns:SOAP-ENC="
> http://schemas.xmlsoap.org/soap/encoding/" xmlns:m="
> http://test.webservices.hrblock.com" xmlns:xsi="
> http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="
> http://www.w3.org/2001/XMLSchema" SOAP-ENV:encodingStyle="
> http://schemas.xmlsoap.org/soap/encoding/">
>
> <SOAP-ENV:Body>
>
> <sayHello xmlns="http://test.webservices.hrblock.com">
>
> <poName xsi:type="xsd:string">Gagan
>
> </poName>
>
> </sayHello>
>
> </SOAP-ENV:Body>
>
> </SOAP-ENV:Envelope>
>
>
>
>
>
> ---------------------------SOAP
> RESPONSE----------------------------------------------------------------------
>
> <?xml version="1.0" encoding="ISO-8859-1"?>
>
> <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
> xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="
> http://www.w3.org/2001/XMLSchema-instance">
>
> <soapenv:Body>
>
> <ns1:sayHelloResponse soapenv:encodingStyle="
> http://schemas.xmlsoap.org/soap/encoding/" xmlns:ns1="
> http://test.webservices.hrblock.com">
>
> <sayHelloReturn xsi:type="xsd:string">HelloGagan
> </sayHelloReturn>
>
> </ns1:sayHelloResponse>
>
> </soapenv:Body>
>
> </soapenv:Envelope>
>
>
>
> But when I try to send the request using AJAX XMLHttpRequest it returned a
> fault code "NoSOAPAction".
>
>
>
> On Setting the setReqestHeader("SOAPAction","/") . It now Returns ..
>
>
>
> <faultcode>soapenv:Server.userException</faultcode><faultstring>
> org.xml.sax.SAXParseException: Element type "SOAP-ENV:Envelope"
> must be followed by either attribute specifications, ">" or
> "/>".</faultstring>
>
>
>
> Any Suggestions on how to get it working.
>
>
>
> Thanks in Advance
>
> Regards
>
> Gagan
>
>
>