You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by mi...@fortis.com on 2006/06/02 16:14:24 UTC
axis 2 client for axis 1 server
Hi all,
I have a strange problem, could please someone try to help me ?
I am trying to use an axis 2 client to connect to an axis 1 web service,
when running the code I get the error :
[2/06/06 15:57:51:830 CEST] 2fdbdee4 WebGroup I SRVE0180I:
[SimpleClient] [/SimpleClient] [Servlet.LOG]: /index.jsp: init
[2/06/06 15:57:51:924 CEST] 2fdbdee4 WebGroup E SRVE0026E: [Erreur
de servlet]-[javax.xml.namespace.QName: method
<init>(Ljava/lang/String;Ljava/lang/String;Ljava/lang/
String;)V not found]: java.lang.NoSuchMethodError:
javax.xml.namespace.QName: method
<init>(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)V not
found
When the same client is runned to connect to an axis 2 web service it
works perfectly.
The ws I try to connect is a simple ws that accept two string in
parameter and return a string,
Here is the code I use to connect axis 2 to an axis 1 ws:
<%!
OMElement getEchoOMElement() {
OMFactory fac = OMAbstractFactory.getOMFactory();
OMNamespace omNs = fac.createOMNamespace(
"http://example1.org/example1", "example1");
OMElement method = fac.createOMElement("getCurrentPosition",
omNs);
OMElement value = fac.createOMElement("text", omNs);
OMElement value2 = fac.createOMElement("text", omNs);
value.addChild(fac.createOMText(value, "central"));
value2.addChild(fac.createOMText(value2, "chicago"));
method.addChild(value);
method.addChild(value2);
return method;
}
%>
<%
try {
org.apache.axis2.addressing.EndpointReference
targetEPR = new
org.apache.axis2.addressing.EndpointReference("http://xx.xx.xx.xx:9080/A
xis_Test/NHLService.jws");
OMElement payload = getEchoOMElement();
org.apache.axis2.client.Options options = new
org.apache.axis2.client.Options();
options.setTo(targetEPR);
//Blocking invocation
org.apache.axis2.client.ServiceClient sender = new
org.apache.axis2.client.ServiceClient();
sender.setOptions(options);
OMElement result = sender.sendReceive(payload);
System.out.println(result);
} catch (AxisFault axisFault) {
axisFault.printStackTrace();
}
%>
= = = = = = = = = = = = = = = = = = = = = = = = =
Fortis Bank disclaimer :
http://www.fortisbank.be/legal/disclaimer.htm
Fortis Bank privacy policy :
http://www.fortisbank.be/legal/privacy_policy.htm
= = = = = = = = = = = = = = = = = = = = = = = = =
---------------------------------------------------------------------
To unsubscribe, e-mail: axis-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-dev-help@ws.apache.org
Re: axis 2 client for axis 1 server
Posted by Paul Fremantle <pz...@gmail.com>.
Can you do a TCPMON trace of the message on the wire?
Thats a good way of debugging SOAP interop.
Paul
On 6/2/06, michel.lequim@fortis.com <mi...@fortis.com> wrote:
> Hi all,
>
> I have a strange problem, could please someone try to help me ?
> I am trying to use an axis 2 client to connect to an axis 1 web service,
>
> when running the code I get the error :
>
> [2/06/06 15:57:51:830 CEST] 2fdbdee4 WebGroup I SRVE0180I:
> [SimpleClient] [/SimpleClient] [Servlet.LOG]: /index.jsp: init
> [2/06/06 15:57:51:924 CEST] 2fdbdee4 WebGroup E SRVE0026E: [Erreur
> de servlet]-[javax.xml.namespace.QName: method
> <init>(Ljava/lang/String;Ljava/lang/String;Ljava/lang/
> String;)V not found]: java.lang.NoSuchMethodError:
> javax.xml.namespace.QName: method
> <init>(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)V not
> found
>
> When the same client is runned to connect to an axis 2 web service it
> works perfectly.
>
> The ws I try to connect is a simple ws that accept two string in
> parameter and return a string,
>
> Here is the code I use to connect axis 2 to an axis 1 ws:
>
> <%!
> OMElement getEchoOMElement() {
> OMFactory fac = OMAbstractFactory.getOMFactory();
> OMNamespace omNs = fac.createOMNamespace(
> "http://example1.org/example1", "example1");
> OMElement method = fac.createOMElement("getCurrentPosition",
> omNs);
> OMElement value = fac.createOMElement("text", omNs);
> OMElement value2 = fac.createOMElement("text", omNs);
>
> value.addChild(fac.createOMText(value, "central"));
> value2.addChild(fac.createOMText(value2, "chicago"));
>
> method.addChild(value);
> method.addChild(value2);
>
> return method;
> }
> %>
>
> <%
> try {
> org.apache.axis2.addressing.EndpointReference
> targetEPR = new
> org.apache.axis2.addressing.EndpointReference("http://xx.xx.xx.xx:9080/A
> xis_Test/NHLService.jws");
>
>
> OMElement payload = getEchoOMElement();
> org.apache.axis2.client.Options options = new
> org.apache.axis2.client.Options();
> options.setTo(targetEPR);
>
> //Blocking invocation
> org.apache.axis2.client.ServiceClient sender = new
> org.apache.axis2.client.ServiceClient();
> sender.setOptions(options);
> OMElement result = sender.sendReceive(payload);
>
> System.out.println(result);
>
> } catch (AxisFault axisFault) {
> axisFault.printStackTrace();
> }
> %>
>
>
>
>
>
> = = = = = = = = = = = = = = = = = = = = = = = = =
> Fortis Bank disclaimer :
> http://www.fortisbank.be/legal/disclaimer.htm
>
> Fortis Bank privacy policy :
> http://www.fortisbank.be/legal/privacy_policy.htm
> = = = = = = = = = = = = = = = = = = = = = = = = =
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: axis-dev-unsubscribe@ws.apache.org
> For additional commands, e-mail: axis-dev-help@ws.apache.org
>
>
--
Paul Fremantle
VP/Technology, WSO2 and OASIS WS-RX TC Co-chair
http://bloglines.com/blog/paulfremantle
paul@wso2.com
"Oxygenating the Web Service Platform", www.wso2.com
---------------------------------------------------------------------
To unsubscribe, e-mail: axis-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-dev-help@ws.apache.org