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 Kashif Saleem <Ka...@newcastle.ac.uk> on 2006/03/20 15:57:04 UTC

java.lang.NoSuchMethodError: org.apache.axis2.context.MessageContext.getMessageInformationHeaders()

Hi All,
      The problem is this, when calling ServiceClient. sendReceive (OMElement), I  
got a following message:

       Exception in thread "main" java.lang.NoSuchMethodError: org.apache.axis2.context.MessageContext.getMessageInformationHeaders()Lorg/apache/axis2/addressing/MessageInformationHeaders;
        at org.apache.axis2.handlers.addressing.AddressingOutHandler.invoke(AddressingOutHandler.java:56)
        at org.apache.axis2.engine.Phase.invoke(Phase.java:376)
        at org.apache.axis2.engine.AxisEngine.invoke(AxisEngine.java:351)
        at org.apache.axis2.engine.AxisEngine.send(AxisEngine.java:441)
        at org.apache.axis2.description.OutInAxisOperationClient.send(OutInAxisOperation.java:317)
        at org.apache.axis2.description.OutInAxisOperationClient.execute(OutInAxisOperation.java:267)
        at org.apache.axis2.client.ServiceClient.sendReceive(ServiceClient.java:393)
        at org.apache.axis2.client.ServiceClient.sendReceive(ServiceClient.java:326)
        at userguide.clients.TestClient.main(TestClient.java:54)

I am just wondering about the cause of it.Attached with this mail is my client.I would 
appreciate your help.


Kind Regards
Kashif Saleem

RE-[Axis2] Problem in accessing the python service

Posted by Kashif Saleem <Ka...@newcastle.ac.uk>.
Hi Eran,
        Thanks for your help.Below is the output I got after monitoring the soap messages using TCPMON.I chaged the helloWorld operation in http://wwww.basis.ncl.ac.uk/web-services/kashif.py to accept no argument and return string.I am quite surprised it works.




Request:


POST /web-services/kashif.py HTTP/1.1

User-Agent: Axis/2.0

SOAPAction: 

Connection: Keep-Alive

Host: basis.ncl.ac.uk:8080

Content-Length: 749

Content-Type: text/xml; charset=UTF-8



<?xml version='1.0' encoding='UTF-8'?><soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/08/addressing"><soapenv:Header><wsa:To xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/08/addressing">http://localhost:8080/web-services/kashif.py</wsa:To><wsa:ReplyTo xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/08/addressing"><wsa:Address>http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous</wsa:Address></wsa:ReplyTo><wsa:MessageID xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/08/addressing">A98863E478E239A7CF11432173236951</wsa:MessageID></soapenv:Header><soapenv:Body><example1:helloWorld xmlns:example1="http://example1.org/example1" /></soapenv:Body></soapenv:Envelope>



Response:


HTTP/1.1 200 OK

Date: Fri, 24 Mar 2006 16:19:45 GMT

Server: Apache/1.3.33 (Debian GNU/Linux) mod_python/2.7.10 Python/2.3.4 mod_fastcgi/2.4.2 mod_ssl/2.8.22 OpenSSL/0.9.7e

Keep-Alive: timeout=15, max=100

Connection: Keep-Alive

Transfer-Encoding: chunked

Content-Type: text/xml



257

<?xml version="1.0" encoding="utf-8"?>
<SOAP-ENV:Envelope
  xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
  xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xmlns:xsd="http://www.w3.org/2001/XMLSchema"
  xmlns:ZSI="http://www.zolera.com/schemas/ZSI/" 
  SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" >
<SOAP-ENV:Body>
<helloWorldResponse>
<SOAP-ENC:string id="414285c0">This is a hello world operation with no argument</SOAP-ENC:string>
</helloWorldResponse>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>





Kind Regards
Kashif Saleem


-----Original Message-----
From: Eran Chinthaka [mailto:chinthaka@opensource.lk]
Sent: Thu 23/03/2006 17:50
To: axis-user@ws.apache.org
Subject: Re: RE-[Axis2] Problem in accessing the python service
 


Kashif Saleem wrote:
> Hi Eran,
>         I found out that I can access the python services without any problem which does not contain input arguments.So the problem occurs only if webservice needs some input arguments.As I understood ZSI cant understand the way input argument send by the AXIS2 and as a result it gives fault message "unparsable messages" as mentioned in the below email.Any thoughts on it would highly be regarded.Thanks.
>   
Strange. Can you please send me the SOAP message which your python
server treats as correct ? Then I can see what is wrong with the message
Axis2 sends out.

-- Chinthaka
>
> Kind Regards
> Kashif Saleem
>   




Re: RE-[Axis2] Problem in accessing the python service

Posted by Eran Chinthaka <ch...@opensource.lk>.

Kashif Saleem wrote:
> Hi Eran,
>         I found out that I can access the python services without any problem which does not contain input arguments.So the problem occurs only if webservice needs some input arguments.As I understood ZSI cant understand the way input argument send by the AXIS2 and as a result it gives fault message "unparsable messages" as mentioned in the below email.Any thoughts on it would highly be regarded.Thanks.
>   
Strange. Can you please send me the SOAP message which your python
server treats as correct ? Then I can see what is wrong with the message
Axis2 sends out.

-- Chinthaka
>
> Kind Regards
> Kashif Saleem
>   


RE-[Axis2] Problem in accessing the python service

Posted by Kashif Saleem <Ka...@newcastle.ac.uk>.
Hi Eran,
        I found out that I can access the python services without any problem which does not contain input arguments.So the problem occurs only if webservice needs some input arguments.As I understood ZSI cant understand the way input argument send by the AXIS2 and as a result it gives fault message "unparsable messages" as mentioned in the below email.Any thoughts on it would highly be regarded.Thanks.


Kind Regards
Kashif Saleem




-----Original Message-----
From: Kashif Saleem
Sent: Wed 22/03/2006 18:01
To: axis-user@ws.apache.org
Cc: chinthaka@opensource.lk
Subject: RE-[Axis2] Problem in accessing the python service
 
Hi Eran,
       I fixed the dispatching logic on the server.Now when I tried to access the server helloWorld  operation.I got the unparsable message.I  used to TCPMonitor to look at the soap request and response messages.Below is the tcpmonitor output:
Request:

Content-Type: text/xml; charset=UTF-8



<?xml version='1.0' encoding='UTF-8'?><soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/08/addressing"><soapenv:Header><wsa:To xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/08/addressing">http://localhost:8080/web-services/kashif.py</wsa:To><wsa:ReplyTo xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/08/addressing"><wsa:Address>http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous</wsa:Address></wsa:ReplyTo><wsa:MessageID xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/08/addressing">C97E1B4CD42952985E11430494666231</wsa:MessageID></soapenv:Header><soapenv:Body><example1:helloWorld xmlns:example1="http://example1.org/example1"><example1:Text>Axis2 Echo String </example1:Text></example1:helloWorld></soapenv:Body></soapenv:Envelope>


Response:

HTTP/1.1 200 OK

Date: Wed, 22 Mar 2006 17:42:07 GMT

Server: Apache/1.3.33 (Debian GNU/Linux) mod_python/2.7.10 Python/2.3.4 mod_fastcgi/2.4.2 mod_ssl/2.8.22 OpenSSL/0.9.7e

Keep-Alive: timeout=15, max=100

Connection: Keep-Alive

Transfer-Encoding: chunked

Content-Type: text/xml



318

<?xml version="1.0" encoding="utf-8"?>
<SOAP-ENV:Envelope
  xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
  xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xmlns:xsd="http://www.w3.org/2001/XMLSchema"
  xmlns:ZSI="http://www.zolera.com/schemas/ZSI/" 
  SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" >
<SOAP-ENV:Body>
<SOAP-ENV:Fault>
<faultcode>SOAP-ENV:Client</faultcode>
<faultstring>Unparseable message</faultstring>
<detail>
<ZSI:ParseFaultDetail>
<ZSI:string>Any cannot parse untyped element</ZSI:string>
<ZSI:trace>/soapenv:Envelope/soapenv:Body/example1:helloWorld/example1:Text</ZSI:trace>
</ZSI:ParseFaultDetail>

</detail>
</SOAP-ENV:Fault>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>



I checked the server error log but there is no error log for it.Attached with this mail is my ClientUtil.java and TestClient.java.Any help would highly be appreciated.


Kind Regards
Kashif Saleem


-----Original Message-----
From: Eran Chinthaka [mailto:chinthaka@opensource.lk]
Sent: Tue 21/03/2006 17:43
To: axis-user@ws.apache.org
Subject: Re: [Axis2] Problem in accessing the python service
 
Kashif Saleem wrote:
> Hi Eran,
>         I updated to newest version.Now again I am getting the server error- even after setting the options.setProperty(MessageContextConstants.CHUNKED, Constants.VALUE_FALSE).I checked the server log this time it is showing the following messages:
>   
Can you check on the server log please. I just accessed the service at 
your endpoint, and followings are the requests and reponses.

If I understand correct, this message has confused your dispatching 
logic in the server.

-- Chinthaka

Request :

POST /web-services/sbml.py HTTP/1.1
User-Agent: Axis/2.0
SOAPAction: ""
Connection: Keep-Alive
Host: www.basis.ncl.ac.uk
Content-Length: 286
Content-Type: text/xml; charset=UTF-8
 
<?xml version='1.0' encoding='UTF-8'?>
   <soapenv:Envelope 
xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
      <soapenv:Header />
      <soapenv:Body>
         <example1:helloWorld xmlns:example1="http://example1.org/example1">
            <example1:Text />
         </example1:helloWorld>
      </soapenv:Body>
   </soapenv:Envelope>

Reponse :

HTTP/1.1 200 OK
Date: Tue, 21 Mar 2006 17:39:29 GMT
Server: Apache/1.3.33 (Debian GNU/Linux) mod_python/2.7.10 Python/2.3.4 
mod_fastcgi/2.4.2 mod_ssl/2.8.22 OpenSSL/0.9.7e
Keep-Alive: timeout=15, max=100
Connection: Keep-Alive
Transfer-Encoding: chunked
Content-Type: text/xml
 
360
<?xml version="1.0" encoding="utf-8"?>
   <SOAP-ENV:Envelope  
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"  
xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"  
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"  
xmlns:xsd="http://www.w3.org/2001/XMLSchema"  
xmlns:ZSI="http://www.zolera.com/schemas/ZSI/"   
SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" >
      <SOAP-ENV:Body>
         <SOAP-ENV:Fault>
            <faultcode>SOAP-ENV:Server</faultcode>
            <faultstring>Processing Failure</faultstring>
            <detail>
               <ZSI:FaultDetail>
                  <ZSI:string>Multiple implementations found: 
[&lt;function helloWorld at 0x4144379c>, &lt;function helloWorld at 
0x4147ddbc>]</ZSI:string>
                  
<ZSI:trace>/home/basis/pythonModules//lib/python/ZSI/dispatch.py:44:_Dispatch</ZSI:trace>
               </ZSI:FaultDetail>
            </detail>
         </SOAP-ENV:Fault>
      </SOAP-ENV:Body>
   </SOAP-ENV:Envelope>0







RE-[Axis2] Problem in accessing the python service

Posted by Kashif Saleem <Ka...@newcastle.ac.uk>.
Hi Eran,
       I fixed the dispatching logic on the server.Now when I tried to access the server helloWorld  operation.I got the unparsable message.I  used to TCPMonitor to look at the soap request and response messages.Below is the tcpmonitor output:
Request:

Content-Type: text/xml; charset=UTF-8



<?xml version='1.0' encoding='UTF-8'?><soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/08/addressing"><soapenv:Header><wsa:To xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/08/addressing">http://localhost:8080/web-services/kashif.py</wsa:To><wsa:ReplyTo xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/08/addressing"><wsa:Address>http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous</wsa:Address></wsa:ReplyTo><wsa:MessageID xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/08/addressing">C97E1B4CD42952985E11430494666231</wsa:MessageID></soapenv:Header><soapenv:Body><example1:helloWorld xmlns:example1="http://example1.org/example1"><example1:Text>Axis2 Echo String </example1:Text></example1:helloWorld></soapenv:Body></soapenv:Envelope>


Response:

HTTP/1.1 200 OK

Date: Wed, 22 Mar 2006 17:42:07 GMT

Server: Apache/1.3.33 (Debian GNU/Linux) mod_python/2.7.10 Python/2.3.4 mod_fastcgi/2.4.2 mod_ssl/2.8.22 OpenSSL/0.9.7e

Keep-Alive: timeout=15, max=100

Connection: Keep-Alive

Transfer-Encoding: chunked

Content-Type: text/xml



318

<?xml version="1.0" encoding="utf-8"?>
<SOAP-ENV:Envelope
  xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
  xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xmlns:xsd="http://www.w3.org/2001/XMLSchema"
  xmlns:ZSI="http://www.zolera.com/schemas/ZSI/" 
  SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" >
<SOAP-ENV:Body>
<SOAP-ENV:Fault>
<faultcode>SOAP-ENV:Client</faultcode>
<faultstring>Unparseable message</faultstring>
<detail>
<ZSI:ParseFaultDetail>
<ZSI:string>Any cannot parse untyped element</ZSI:string>
<ZSI:trace>/soapenv:Envelope/soapenv:Body/example1:helloWorld/example1:Text</ZSI:trace>
</ZSI:ParseFaultDetail>

</detail>
</SOAP-ENV:Fault>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>



I checked the server error log but there is no error log for it.Attached with this mail is my ClientUtil.java and TestClient.java.Any help would highly be appreciated.


Kind Regards
Kashif Saleem


-----Original Message-----
From: Eran Chinthaka [mailto:chinthaka@opensource.lk]
Sent: Tue 21/03/2006 17:43
To: axis-user@ws.apache.org
Subject: Re: [Axis2] Problem in accessing the python service
 
Kashif Saleem wrote:
> Hi Eran,
>         I updated to newest version.Now again I am getting the server error- even after setting the options.setProperty(MessageContextConstants.CHUNKED, Constants.VALUE_FALSE).I checked the server log this time it is showing the following messages:
>   
Can you check on the server log please. I just accessed the service at 
your endpoint, and followings are the requests and reponses.

If I understand correct, this message has confused your dispatching 
logic in the server.

-- Chinthaka

Request :

POST /web-services/sbml.py HTTP/1.1
User-Agent: Axis/2.0
SOAPAction: ""
Connection: Keep-Alive
Host: www.basis.ncl.ac.uk
Content-Length: 286
Content-Type: text/xml; charset=UTF-8
 
<?xml version='1.0' encoding='UTF-8'?>
   <soapenv:Envelope 
xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
      <soapenv:Header />
      <soapenv:Body>
         <example1:helloWorld xmlns:example1="http://example1.org/example1">
            <example1:Text />
         </example1:helloWorld>
      </soapenv:Body>
   </soapenv:Envelope>

Reponse :

HTTP/1.1 200 OK
Date: Tue, 21 Mar 2006 17:39:29 GMT
Server: Apache/1.3.33 (Debian GNU/Linux) mod_python/2.7.10 Python/2.3.4 
mod_fastcgi/2.4.2 mod_ssl/2.8.22 OpenSSL/0.9.7e
Keep-Alive: timeout=15, max=100
Connection: Keep-Alive
Transfer-Encoding: chunked
Content-Type: text/xml
 
360
<?xml version="1.0" encoding="utf-8"?>
   <SOAP-ENV:Envelope  
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"  
xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"  
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"  
xmlns:xsd="http://www.w3.org/2001/XMLSchema"  
xmlns:ZSI="http://www.zolera.com/schemas/ZSI/"   
SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" >
      <SOAP-ENV:Body>
         <SOAP-ENV:Fault>
            <faultcode>SOAP-ENV:Server</faultcode>
            <faultstring>Processing Failure</faultstring>
            <detail>
               <ZSI:FaultDetail>
                  <ZSI:string>Multiple implementations found: 
[&lt;function helloWorld at 0x4144379c>, &lt;function helloWorld at 
0x4147ddbc>]</ZSI:string>
                  
<ZSI:trace>/home/basis/pythonModules//lib/python/ZSI/dispatch.py:44:_Dispatch</ZSI:trace>
               </ZSI:FaultDetail>
            </detail>
         </SOAP-ENV:Fault>
      </SOAP-ENV:Body>
   </SOAP-ENV:Envelope>0






Re: [Axis2] Problem in accessing the python service

Posted by Eran Chinthaka <ch...@opensource.lk>.
Kashif Saleem wrote:
> Hi Eran,
>         I updated to newest version.Now again I am getting the server error- even after setting the options.setProperty(MessageContextConstants.CHUNKED, Constants.VALUE_FALSE).I checked the server log this time it is showing the following messages:
>   
Can you check on the server log please. I just accessed the service at 
your endpoint, and followings are the requests and reponses.

If I understand correct, this message has confused your dispatching 
logic in the server.

-- Chinthaka

Request :

POST /web-services/sbml.py HTTP/1.1
User-Agent: Axis/2.0
SOAPAction: ""
Connection: Keep-Alive
Host: www.basis.ncl.ac.uk
Content-Length: 286
Content-Type: text/xml; charset=UTF-8
 
<?xml version='1.0' encoding='UTF-8'?>
   <soapenv:Envelope 
xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
      <soapenv:Header />
      <soapenv:Body>
         <example1:helloWorld xmlns:example1="http://example1.org/example1">
            <example1:Text />
         </example1:helloWorld>
      </soapenv:Body>
   </soapenv:Envelope>

Reponse :

HTTP/1.1 200 OK
Date: Tue, 21 Mar 2006 17:39:29 GMT
Server: Apache/1.3.33 (Debian GNU/Linux) mod_python/2.7.10 Python/2.3.4 
mod_fastcgi/2.4.2 mod_ssl/2.8.22 OpenSSL/0.9.7e
Keep-Alive: timeout=15, max=100
Connection: Keep-Alive
Transfer-Encoding: chunked
Content-Type: text/xml
 
360
<?xml version="1.0" encoding="utf-8"?>
   <SOAP-ENV:Envelope  
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"  
xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"  
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"  
xmlns:xsd="http://www.w3.org/2001/XMLSchema"  
xmlns:ZSI="http://www.zolera.com/schemas/ZSI/"   
SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" >
      <SOAP-ENV:Body>
         <SOAP-ENV:Fault>
            <faultcode>SOAP-ENV:Server</faultcode>
            <faultstring>Processing Failure</faultstring>
            <detail>
               <ZSI:FaultDetail>
                  <ZSI:string>Multiple implementations found: 
[&lt;function helloWorld at 0x4144379c>, &lt;function helloWorld at 
0x4147ddbc>]</ZSI:string>
                  
<ZSI:trace>/home/basis/pythonModules//lib/python/ZSI/dispatch.py:44:_Dispatch</ZSI:trace>
               </ZSI:FaultDetail>
            </detail>
         </SOAP-ENV:Fault>
      </SOAP-ENV:Body>
   </SOAP-ENV:Envelope>0


[Axis2] Problem in accessing the python service

Posted by Kashif Saleem <Ka...@newcastle.ac.uk>.
Hi Eran,
        I updated to newest version.Now again I am getting the server error- even after setting the options.setProperty(MessageContextConstants.CHUNKED, Constants.VALUE_FALSE).I checked the server log this time it is showing the following messages:


[Tue Mar 21 11:12:29 2006] [error] PythonHandler ws: Traceback (most recent call last):
[Tue Mar 21 11:12:29 2006] [error] PythonHandler ws:   File "/usr/lib/python2.3/site-packages/mod_python/apache.py", line 193, in Dispatch\n    result = object(req)
[Tue Mar 21 11:12:29 2006] [error] PythonHandler ws:   File "/home/basis/www/web-services/ws.py", line 10, in handler\n    dispatch.AsHandler(modules=(sbml,kashif, ),request=req)
[Tue Mar 21 11:12:29 2006] [error] PythonHandler ws:   File "/home/basis/pythonModules//lib/python/ZSI/dispatch.py", line 180, in AsHandler\n    ps = ParsedSoap(request)
[Tue Mar 21 11:12:29 2006] [error] PythonHandler ws:   File "/home/basis/pythonModules//lib/python/ZSI/parse.py", line 60, in __init__\n    str(e.__class__) + "): " + str(e), 0)
[Tue Mar 21 11:12:29 2006] [error] PythonHandler ws: ParseException: Can't parse document (xml.parsers.expat.ExpatError): not well-formed (invalid token): line 1, column 724


To get a clear idea about the problem.I am attaching  with this mail the ClientUtil.java,TestClient.java and the input file.


Kind Regards
Kashif Saleem




-----Original Message-----
From: Eran Chinthaka [mailto:chinthaka@opensource.lk]
Sent: Mon 20/03/2006 15:34
To: axis-user@ws.apache.org
Subject: Re: [Axis2] java.lang.NoSuchMethodError: org.apache.axis2.context.MessageContext.getMessageInformationHeaders()

Hi Kashif,

Seems like you are trying to use an older version addressing mar with
Axis2. Better have the appropriate version of addressing in the modules
folder.

MessageContext.getMessageInformationHeaders is a method removed some
time back.

-- Chinthaka

P.S. Please prefix the subjects of all your emails related to Axis2 with
[Axis2].


Kashif Saleem wrote:
> Hi All,
>       The problem is this, when calling ServiceClient. sendReceive (OMElement), I 
> got a following message:
>
>        Exception in thread "main" java.lang.NoSuchMethodError: org.apache.axis2.context.MessageContext.getMessageInformationHeaders()Lorg/apache/axis2/addressing/MessageInformationHeaders;
>         at org.apache.axis2.handlers.addressing.AddressingOutHandler.invoke(AddressingOutHandler.java:56)
>         at org.apache.axis2.engine.Phase.invoke(Phase.java:376)
>         at org.apache.axis2.engine.AxisEngine.invoke(AxisEngine.java:351)
>         at org.apache.axis2.engine.AxisEngine.send(AxisEngine.java:441)
>         at org.apache.axis2.description.OutInAxisOperationClient.send(OutInAxisOperation.java:317)
>         at org.apache.axis2.description.OutInAxisOperationClient.execute(OutInAxisOperation.java:267)
>         at org.apache.axis2.client.ServiceClient.sendReceive(ServiceClient.java:393)
>         at org.apache.axis2.client.ServiceClient.sendReceive(ServiceClient.java:326)
>         at userguide.clients.TestClient.main(TestClient.java:54)
>
> I am just wondering about the cause of it.Attached with this mail is my client.I would
> appreciate your help.
>
>
> Kind Regards
> Kashif Saleem
>  
> ------------------------------------------------------------------------
>
> /*
>  * Copyright 2004,2005 The Apache Software Foundation.
>  *
>  * Licensed under the Apache License, Version 2.0 (the "License");
>  * you may not use this file except in compliance with the License.
>  * You may obtain a copy of the License at
>  *
>  *      http://www.apache.org/licenses/LICENSE-2.0
>  *
>  * Unless required by applicable law or agreed to in writing, software
>  * distributed under the License is distributed on an "AS IS" BASIS,
>  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
>  * See the License for the specific language governing permissions and
>  * limitations under the License.
>  */
>
> package userguide.clients;
>
> import org.apache.axis2.AxisFault;
> import org.apache.axis2.Constants;
> import org.apache.axis2.addressing.EndpointReference;
> import org.apache.axis2.client.Options;
> import org.apache.axis2.client.ServiceClient;
> import org.apache.axis2.om.OMAbstractFactory;
> import org.apache.axis2.om.OMElement;
> import org.apache.axis2.om.OMFactory;
> import org.apache.axis2.om.OMNamespace;
>
> import javax.xml.namespace.QName;
> import javax.xml.stream.FactoryConfigurationError;
> import javax.xml.stream.XMLOutputFactory;
> import javax.xml.stream.XMLStreamException;
> import javax.xml.stream.XMLStreamWriter;
>
> /**
>  * This is a Client progam that accesses 'MyService' web service in Axis2 samples
>  */
> public class TCPClient {
>
>     private static String toEpr = "tcp://localhost:8080/axis2/services/MyService";
>
>     public static void main(String[] args) throws AxisFault {
>
>         Options options = new Options();
>         options.setTo(new EndpointReference(toEpr));
>         options.setTransportInProtocol(Constants.TRANSPORT_TCP);
>
>         ServiceClient sender = new ServiceClient();
>         sender.engageModule(new QName(Constants.MODULE_ADDRESSING));
>         sender.setOptions(options);
>         OMElement result = sender.sendReceive(getPayload());
>
>         try {
>             XMLStreamWriter writer = XMLOutputFactory.newInstance()
>                     .createXMLStreamWriter(System.out);
>             result.serialize(writer);
>             writer.flush();
>         } catch (XMLStreamException e) {
>             e.printStackTrace();
>         } catch (FactoryConfigurationError e) {
>             e.printStackTrace();
>         }
>     }
>
>
>     private static OMElement getPayload() {
>         OMFactory fac = OMAbstractFactory.getOMFactory();
>         OMNamespace omNs = fac.createOMNamespace(
>                 "tcp://localhost:8080/axis2/services/MyService", "example1");
>         OMElement method = fac.createOMElement("echo", omNs);
>         OMElement value = fac.createOMElement("Text", omNs);
>         value.addChild(fac.createText(value, "Axis2 Echo String "));
>         method.addChild(value);
>
>         return method;
>     }
> }
>  






Re: [Axis2] java.lang.NoSuchMethodError: org.apache.axis2.context.MessageContext.getMessageInformationHeaders()

Posted by Eran Chinthaka <ch...@opensource.lk>.
Hi Kashif,

Seems like you are trying to use an older version addressing mar with 
Axis2. Better have the appropriate version of addressing in the modules 
folder.

MessageContext.getMessageInformationHeaders is a method removed some 
time back.

-- Chinthaka

P.S. Please prefix the subjects of all your emails related to Axis2 with 
[Axis2].


Kashif Saleem wrote:
> Hi All,
>       The problem is this, when calling ServiceClient. sendReceive (OMElement), I  
> got a following message:
>
>        Exception in thread "main" java.lang.NoSuchMethodError: org.apache.axis2.context.MessageContext.getMessageInformationHeaders()Lorg/apache/axis2/addressing/MessageInformationHeaders;
>         at org.apache.axis2.handlers.addressing.AddressingOutHandler.invoke(AddressingOutHandler.java:56)
>         at org.apache.axis2.engine.Phase.invoke(Phase.java:376)
>         at org.apache.axis2.engine.AxisEngine.invoke(AxisEngine.java:351)
>         at org.apache.axis2.engine.AxisEngine.send(AxisEngine.java:441)
>         at org.apache.axis2.description.OutInAxisOperationClient.send(OutInAxisOperation.java:317)
>         at org.apache.axis2.description.OutInAxisOperationClient.execute(OutInAxisOperation.java:267)
>         at org.apache.axis2.client.ServiceClient.sendReceive(ServiceClient.java:393)
>         at org.apache.axis2.client.ServiceClient.sendReceive(ServiceClient.java:326)
>         at userguide.clients.TestClient.main(TestClient.java:54)
>
> I am just wondering about the cause of it.Attached with this mail is my client.I would 
> appreciate your help.
>
>
> Kind Regards
> Kashif Saleem
>   
> ------------------------------------------------------------------------
>
> /*
>  * Copyright 2004,2005 The Apache Software Foundation.
>  *
>  * Licensed under the Apache License, Version 2.0 (the "License");
>  * you may not use this file except in compliance with the License.
>  * You may obtain a copy of the License at
>  *
>  *      http://www.apache.org/licenses/LICENSE-2.0
>  *
>  * Unless required by applicable law or agreed to in writing, software
>  * distributed under the License is distributed on an "AS IS" BASIS,
>  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
>  * See the License for the specific language governing permissions and
>  * limitations under the License.
>  */
>
> package userguide.clients;
>
> import org.apache.axis2.AxisFault;
> import org.apache.axis2.Constants;
> import org.apache.axis2.addressing.EndpointReference;
> import org.apache.axis2.client.Options;
> import org.apache.axis2.client.ServiceClient;
> import org.apache.axis2.om.OMAbstractFactory;
> import org.apache.axis2.om.OMElement;
> import org.apache.axis2.om.OMFactory;
> import org.apache.axis2.om.OMNamespace;
>
> import javax.xml.namespace.QName;
> import javax.xml.stream.FactoryConfigurationError;
> import javax.xml.stream.XMLOutputFactory;
> import javax.xml.stream.XMLStreamException;
> import javax.xml.stream.XMLStreamWriter;
>
> /**
>  * This is a Client progam that accesses 'MyService' web service in Axis2 samples
>  */
> public class TCPClient {
>
>     private static String toEpr = "tcp://localhost:8080/axis2/services/MyService";
>
>     public static void main(String[] args) throws AxisFault {
>
>         Options options = new Options();
>         options.setTo(new EndpointReference(toEpr));
>         options.setTransportInProtocol(Constants.TRANSPORT_TCP);
>
>         ServiceClient sender = new ServiceClient();
>         sender.engageModule(new QName(Constants.MODULE_ADDRESSING));
>         sender.setOptions(options);
>         OMElement result = sender.sendReceive(getPayload());
>
>         try {
>             XMLStreamWriter writer = XMLOutputFactory.newInstance()
>                     .createXMLStreamWriter(System.out);
>             result.serialize(writer);
>             writer.flush();
>         } catch (XMLStreamException e) {
>             e.printStackTrace();
>         } catch (FactoryConfigurationError e) {
>             e.printStackTrace();
>         }
>     }
>
>
>     private static OMElement getPayload() {
>         OMFactory fac = OMAbstractFactory.getOMFactory();
>         OMNamespace omNs = fac.createOMNamespace(
>                 "tcp://localhost:8080/axis2/services/MyService", "example1");
>         OMElement method = fac.createOMElement("echo", omNs);
>         OMElement value = fac.createOMElement("Text", omNs);
>         value.addChild(fac.createText(value, "Axis2 Echo String "));
>         method.addChild(value);
>
>         return method;
>     }
> }
>