Win a copy of TDD for a Shopping Website LiveProject this week in the Testing forum!

Remi Desreumaux

Greenhorn
+ Follow
since Sep 23, 2010
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Remi Desreumaux

I regenerated the stubs from web service client eclipse plug-in:


log4j:WARN No appenders could be found for logger (org.apache.axis.i18n.ProjectResourceBundle). log4j:WARN Please initialize the log4j system properly. 3

11 years ago
Using tcp/ip monitor , I got this as request :



This looks good but the response is the wsdl itself ! Why ?


As a reminder, my client 's code is :

11 years ago
I put it in stand by.... did not resolve it
11 years ago
but at the execution time :


I have this awful error :


org.apache.axis2.AxisFault: First Element must contain the local name, Envelope , but found definitions
at org.apache.axis2.AxisFault.makeFault(AxisFault.java:430)
at org.apache.axis2.transport.TransportUtils.createSOAPMessage(TransportUtils.java:118)
at org.apache.axis2.transport.TransportUtils.createSOAPMessage(TransportUtils.java:67)
at org.apache.axis2.description.OutInAxisOperationClient.handleResponse(OutInAxisOperation.java:354)
at org.apache.axis2.description.OutInAxisOperationClient.send(OutInAxisOperation.java:417)
at org.apache.axis2.description.OutInAxisOperationClient.executeImpl(OutInAxisOperation.java:229)
at org.apache.axis2.client.OperationClient.execute(OperationClient.java:165)
at org.apache.axis2.axis2userguide.Service1Stub.add(Service1Stub.java:312)
at namespace.webservice._new.Client.main(Client.java:24)
Caused by: org.apache.axiom.soap.SOAPProcessingException: First Element must contain the local name, Envelope , but found definitions
at org.apache.axiom.soap.impl.builder.StAXSOAPModelBuilder.constructNode(StAXSOAPModelBuilder.java:267)
at org.apache.axiom.soap.impl.builder.StAXSOAPModelBuilder.createOMElement(StAXSOAPModelBuilder.java:224)
at org.apache.axiom.soap.impl.builder.StAXSOAPModelBuilder.createNextOMElement(StAXSOAPModelBuilder.java:196)
at org.apache.axiom.om.impl.builder.StAXOMBuilder.next(StAXOMBuilder.java:207)
at org.apache.axiom.soap.impl.builder.StAXSOAPModelBuilder.getSOAPEnvelope(StAXSOAPModelBuilder.java:161)
at org.apache.axiom.soap.impl.builder.StAXSOAPModelBuilder.<init>(StAXSOAPModelBuilder.java:110)
at org.apache.axis2.builder.BuilderUtil.getSOAPBuilder(BuilderUtil.java:682)
at org.apache.axis2.transport.TransportUtils.createDocumentElement(TransportUtils.java:210)
at org.apache.axis2.transport.TransportUtils.createSOAPMessage(TransportUtils.java:140)
at org.apache.axis2.transport.TransportUtils.

11 years ago
I read some documentation :
http://ws.apache.org/axis2/1_1_1/userguide-creatingclients.html#choosingclient

And I regenerated the stub calling :

C:\axis2-1.5.1-bin\axis2-1.5.1\bin>wsdl2java -uri http://intevit.com/ws/ex4/WebS
ervice.wsdl -p org.apache.axis2.axis2userguide -d adb -s
Using AXIS2_HOME: C:\axis2-1.5.1-bin\axis2-1.5.1
Using JAVA_HOME: C:\j\
Retrieving document at 'http://intevit.com/ws/ex4/WebService.wsdl'.
C:\axis2-1.5.1-bin\axis2-1.5.1\bin>wsdl2java -uri http://intevit.com/ws/ex4/WebS
ervice.wsdl -p org.apache.axis2.axis2userguide -d adb -s




Then in my client :


Unfortunately :

at the execution :



org.apache.axis2.AxisFault: First Element must contain the local name, Envelope , but found definitions
at org.apache.axis2.AxisFault.makeFault(AxisFault.java:430)
at org.apache.axis2.transport.TransportUtils.createSOAPMessage(TransportUtils.java:118)
at org.apache.axis2.transport.TransportUtils.createSOAPMessage(TransportUtils.java:67)
at org.apache.axis2.description.OutInAxisOperationClient.handleResponse(OutInAxisOperation.java:354)
at org.apache.axis2.description.OutInAxisOperationClient.send(OutInAxisOperation.java:417)
at org.apache.axis2.description.OutInAxisOperationClient.executeImpl(OutInAxisOperation.java:229)
at org.apache.axis2.client.OperationClient.execute(OperationClient.java:165)
at org.apache.axis2.axis2userguide.Service1Stub.add(Service1Stub.java:312)
at namespace.webservice._new.Client.main(Client.java:24)
Caused by: org.apache.axiom.soap.SOAPProcessingException: First Element must contain the local name, Envelope , but found definitions
at org.apache.axiom.soap.impl.builder.StAXSOAPModelBuilder.constructNode(StAXSOAPModelBuilder.java:267)
at org.apache.axiom.soap.impl.builder.StAXSOAPModelBuilder.createOMElement(StAXSOAPModelBuilder.java:224)
at org.apache.axiom.soap.impl.builder.StAXSOAPModelBuilder.createNextOMElement(StAXSOAPModelBuilder.java:196)
at org.apache.axiom.om.impl.builder.StAXOMBuilder.next(StAXOMBuilder.java:207)
at org.apache.axiom.soap.impl.builder.StAXSOAPModelBuilder.getSOAPEnvelope(StAXSOAPModelBuilder.java:161)
at org.apache.axiom.soap.impl.builder.StAXSOAPModelBuilder.<init>(StAXSOAPModelBuilder.java:110)
at org.apache.axis2.builder.BuilderUtil.getSOAPBuilder(BuilderUtil.java:682)
at org.apache.axis2.transport.TransportUtils.createDocumentElement(TransportUtils.java:210)
at org.apache.axis2.transport.TransportUtils.createSOAPMessage(TransportUtils.java:140)
at org.apache.axis2.transport.TransportUtils.createSOAPMessage(TransportUtils.java:103)
... 7 more



thanks for help!
11 years ago

shivendra tripathi wrote:The callback mechanism is used for asynchronous call and depends on the SOAP stack you are using.
In case of axis2 you have to pass callback handler class as second argument while calling an operation, same as mentioned in your code. You need to implement abstract callback handler class generated by axis2 as well, to pass it as second argument.



Hi, I can see an example right here of implementation of a callbackhandler, it seems complicated.
How do I can do to not use the async mod? thank you.

Here is my callbackhandletimpl :



and my client :


I still wonder how to display the result please.

this seems much more complicated than a .net client with the same webservice :


11 years ago
thank you so much, this is better!!
11 years ago
and nothing special in the inmplementation ? Just an empty class?
11 years ago
Well not the simpliest but very easy

I want to be able to add two integers.
Here is my wsdl : http://intevit.com/ws/ex4/WebService.wsdl

My java code starts with :


How do I define the callbackhandler?
I guess I have to do that later :
11 years ago
Well, I don't see the attribute Document in my wsdl
http://intevit.com/ws/EX3/WebService.wsdl

(( thank you for help.
11 years ago
Hello, when I call :






Using AXIS2_HOME: C:\axis2-1.5.1-bin\axis2-1.5.1
Using JAVA_HOME: C:\j\
Retrieving document at 'http://intevit.com/ws/EX3/WebService.wsdl'.
[ERROR] More than one part for message AddRequest
org.apache.axis2.description.WSDL11ToAxisServiceBuilder$WSDLProcessingException:
More than one part for message AddRequest



How can I fix this?
I heard about litteral/encoded soap body but I cannot fix it.
http://www.w3.org/TR/wsdl#_soap:body

here is my math.php

thank you
11 years ago
just like that ))
11 years ago
Hello, I have been following this tutorial :
http://www.mti.epita.fr/blogs/2008/05/08/howto-axis2-tutoriel-sur-lutilisation-des-webservices-avec-axis2/

Here , the web service code :



and the User.java



I have generated the stub with wsdl2java.bat and I was wondering how to get the address of user 14.

return new User(14, "sami", "15 Toto titi");





thanks
11 years ago
It is weird cause I have problems when compiling.
I think there are unconsistencies between some objects inside.
The method send (String,OmElement) in the type MessageSender is not applicable for the arguments (String,OmElement).
cast payload to OMlement.



OmElement seems to belong to two packages :

Type mismatch: cannot convert from org.apache.axiom.om.OMElement to org.apache.axis2.om.OMElement
11 years ago
Hello, I take advantage of this topic to ask a general question :

In this tutorial, http://www.ibm.com/developerworks/opensource/library/ws-webaxis1/, they talk about this :

Invoking In-Only operation

The org.apache.axis2.clientapi.MessageSender class is used to invoke an In-Only operation, as shown in Listing 3 below, that invokes the subscribe() operation of the StockQuoteService.



I really cannot find org.apache.axis2.clientapi.MessageSender .
How can I do ?
Thank you.
11 years ago