Advertisement

06.11.2008 at 03:22AM PDT, ID: 23475147
[x]
Attachment Details
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

5.0

Help Needed with SOAP And Apache Axis

Asked by sandeep1984 in SOAP, Java Programming Language, Apache Tomcat Application Server

Tags: , ,

Hi.,
I am trying to develop a simple SOAP application using Axis.
I deployed axis in Apache Tomcat 6.
I have given server and client code in code snippet.


And when I try to execute the program I am getting this Exception in Tomcat Console

AxisFault
 faultCode: {http://xml.apache.org/axis/}Client.NoSOAPAction
 faultSubcode:
 faultString: no SOAPAction header!
 faultActor:
 faultNode:
 faultDetail:
        {http://xml.apache.org/axis/}stackTrace:no SOAPAction header!
        at org.apache.axis.transport.http.AxisServlet.getSoapAction(AxisServlet.java:1013)
        at org.apache.axis.transport.http.AxisServlet.doPost(AxisServlet.java:678)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:710)
        at org.apache.axis.transport.http.AxisServletBase.service(AxisServletBase.java:327)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
        at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
        at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
        at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
        at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
        at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
        at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:263)
        at org.apache.coyote.http11.Http11AprProcessor.process(Http11AprProcessor.java:852)
        at org.apache.coyote.http11.Http11AprProtocol$Http11ConnectionHandler.process(Http11AprProtocol.java:584)
        at org.apache.tomcat.util.net.AprEndpoint$Worker.run(AprEndpoint.java:1508)
        at java.lang.Thread.run(Unknown Source)
        {http://xml.apache.org/axis/}hostname:GSPCW046
no SOAPAction header!
        at org.apache.axis.transport.http.AxisServlet.getSoapAction(AxisServlet.java:1013)
        at org.apache.axis.transport.http.AxisServlet.doPost(AxisServlet.java:678)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:710)
        at org.apache.axis.transport.http.AxisServletBase.service(AxisServletBase.java:327)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
        at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
        at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
        at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
        at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
        at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
        at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:263)
        at org.apache.coyote.http11.Http11AprProcessor.process(Http11AprProcessor.java:852)
        at org.apache.coyote.http11.Http11AprProtocol$Http11ConnectionHandler.process(Http11AprProtocol.java:584)
        at org.apache.tomcat.util.net.AprEndpoint$Worker.run(AprEndpoint.java:1508)
        at java.lang.Thread.run(Unknown Source)

Thanks.Start Free Trial
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:
43:
44:
45:
46:
47:
48:
49:
50:
51:
52:
53:
54:
55:
56:
57:
58:
59:
60:
61:
62:
63:
64:
65:
66:
67:
68:
69:
70:
71:
72:
73:
74:
75:
76:
77:
78:
79:
80:
81:
82:
83:
84:
85:
86:
87:
88:
89:
90:
91:
My Server code is : MessageService.jws
(I have copied this file in CATALIA_HOME\webapps\axis folder).
import org.w3c.dom.Element;
import javax.xml.soap.SOAPEnvelope;
import javax.xml.soap.Name;
import javax.xml.soap.SOAPBody;
import javax.xml.soap.SOAPBodyElement;
import javax.xml.soap.SOAPHeader;
import javax.xml.soap.SOAPElement;
 
public class MessageService
{
    public Element[] echoElements(Element [] elems)
    {
        return elems;
    }
   
    public void process(SOAPEnvelope req, SOAPEnvelope resp) throws javax.xml.soap.SOAPException
    {
        try
        {
            SOAPBody body = resp.getBody();
            System.out.println("\n\n");
            System.out.println(body);
            System.out.println("\n\n");
            Name ns0 =  resp.createName("TestNS0", "ns0", "http://example.com");
            Name ns1 =  resp.createName("TestNS1", "ns1", "http://example.com");
            SOAPElement bodyElmnt = body.addBodyElement(ns0);
            SOAPElement el = bodyElmnt.addChildElement(ns1);
            el.addTextNode("TEST RESPONSE");
        }
        catch(Exception exp)
        {
            exp.printStackTrace();
        }
    }
}
 
And Client Code is : TestClient.java
 
import java.io.ByteArrayInputStream;
import org.apache.axis.client.Call;
import org.apache.axis.client.Service;
import javax.xml.soap.MessageFactory;
import javax.xml.soap.SOAPEnvelope;
import javax.xml.soap.SOAPMessage;
import javax.xml.soap.SOAPPart;
import javax.xml.soap.SOAPConnection;
import javax.xml.soap.MimeHeaders;
import javax.xml.soap.SOAPConnectionFactory;
import javax.xml.soap.SOAPBodyElement;
import javax.xml.soap.SOAPBody;
 
public class TestClient
{
    public static void main(String [] args)
    {
        try
        {
            String        xmlString        =    "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" +
                                            "<soapenv:Envelope xmlns:soapenv=\"http://schemas.xmlsoap.org/soap/envelope/\"\n" +
                                            "                   xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\"\n" +
                                            "                   xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\">\n" +
                                            " <soapenv:Header>\n" +
                                            "  <shw:Hello xmlns:shw=\"http://localhost:8080/axis/MessageService.jws\">\n" +
                                            "    <shw:Myname>Tony</shw:Myname>\n" +
                                            "  </shw:Hello>\n" +
                                            " </soapenv:Header>\n" +
                                            " <soapenv:Body>\n" +
                                            "  <shw:process xmlns:shw=\"http://localhost:8080/axis/MessageService.jws\">\n" +
                                            "    <shw:City>GENT</shw:City>\n" +
                                            "  </shw:process>\n" +
                                            " </soapenv:Body>\n" +
                                            "</soapenv:Envelope>";
           
            MessageFactory    mf            =    MessageFactory.newInstance();
            SOAPMessage        smsg        =    mf.createMessage(new MimeHeaders(), new ByteArrayInputStream(xmlString.getBytes()));
            SOAPPart        sp            =    smsg.getSOAPPart();
            SOAPEnvelope    se            =    (SOAPEnvelope)sp.getEnvelope();
           
            SOAPConnection    conn        =    SOAPConnectionFactory.newInstance().createConnection();
            SOAPMessage        response    =    conn.call(smsg, "http://localhost:8080/axis/MessageService.jws");
           
            System.out.println("Response : " + response.getSOAPBody());
         }
        catch (Exception e)
        {
            System.err.println(e.toString());
        }
    }
}
[+][-]06.11.2008 at 03:42AM PDT, ID: 21758516

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]06.11.2008 at 04:55AM PDT, ID: 21758967

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]06.11.2008 at 05:06AM PDT, ID: 21759056

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]06.11.2008 at 05:19AM PDT, ID: 21759171

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]06.11.2008 at 06:17AM PDT, ID: 21759697

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]06.11.2008 at 07:31AM PDT, ID: 21760406

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]06.11.2008 at 07:37AM PDT, ID: 21760482

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]06.11.2008 at 09:44PM PDT, ID: 21766242

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]06.11.2008 at 10:59PM PDT, ID: 21766465

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]06.16.2008 at 12:33PM PDT, ID: 21796681

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]06.16.2008 at 12:36PM PDT, ID: 21796712

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]06.16.2008 at 09:35PM PDT, ID: 21799602

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]06.16.2008 at 09:46PM PDT, ID: 21799636

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zones: SOAP, Java Programming Language, Apache Tomcat Application Server
Tags: Apache, Axis, SOAP
Sign Up Now!
Solution Provided By: shivaspk
Participating Experts: 2
Solution Grade: C
 
 
[+][-]06.25.2008 at 05:08AM PDT, ID: 21864575

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]06.25.2008 at 09:56PM PDT, ID: 21871942

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_2_20070628