• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Tim Cooke
  • Paul Clapham
  • Jeanne Boyarsky
Sheriffs:
  • Ron McLeod
  • Frank Carver
  • Junilu Lacar
Saloon Keepers:
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Al Hobbs
  • Carey Brown
Bartenders:
  • Piet Souris
  • Frits Walraven
  • fred rosenberger

AXIS client example: need help.

 
Ranch Hand
Posts: 93
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello Everyone!

Guys, I just started to study web-services and making my first app. It is taken from the AXIS site: Getting Started Example. Here is the code:



This results in

08.11.2010 11:39:26 org.apache.axis.utils.JavaUtils isAttachmentSupported
WARNING: Unable to find required classes (javax.activation.DataHandler and javax.mail.internet.MimeMultipart). Attachment support is disabled.
error java.net.ConnectException: Connection refused: connect



So, as far as I understand I have 2 problems:
- something is missing
- apache testing server is not working

Can you help me with this? Can you advice some open web-service in www using which I can test my client?
 
Rancher
Posts: 1337
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Stop! Before you go any further you should update to a newer version of Axis, namely Axis2. Instead of http://ws.apache.org/axis/, go to http://ws.apache.org/axis2/ to get all the software and tutorials. Axis 1 has long been obsolete and should not be used for anything at this point.

As for the two problems, the first is just a warning and results in what it mentions: no support for attachments. Attachments are used far less than SOAP services in general, so that is most likely not a problem, especially if you're just starting out.

The second means that the server you're trying to access (http://ws.apache.org:5049/) does not exist. The folks at Apache do not run test servers for the general public, and you should replace the URL with the respective address of your test server - which means you have to install Axis and your test service before you can use that client code.
 
Dmitry Zhuravlev
Ranch Hand
Posts: 93
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
OK,
Lester may be you can advice some working web-service in internet using which I can test my client?

And also, can you explain me if I need WSDL2Java utility? How can it help me building my client?
 
Lester Burnham
Rancher
Posts: 1337
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I'm not aware of a public testbed for SOAP services, although they probably exist. I would advise to run your own Axis2 instance in Tomcat or some other servlet container; it's easy to get up and running, and you should definitely learn about both sides.

The Axis2 web site has very extensive documentation covering wsdl2java and all its other features; start reading there, particularly the "User Guide".
 
Dmitry Zhuravlev
Ranch Hand
Posts: 93
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Lester, I have been advised to use axis 1.4 because the web-service I need to reach uses "old rpc/enc - encoded style". Dont know what is it.

Anyway,
now I have made some steps in working soap client direction and have the following two erros, can anyone explain me whats up?

(1) at home I get
org.xml.sax.SAXException: No deserializer defined for array type {http://namespaces.soaplite.com/perl}ShortCampaignInfo
at org.apache.axis.encoding.ser.ArrayDeserializer.onStartElement(ArrayDeserializer.java:276)
at org.apache.axis.encoding.DeserializerImpl.startElement(DeserializerImpl.java:393)
at org.apache.axis.encoding.DeserializationContext.startElement(DeserializationContext.java:1048)
at org.apache.axis.message.SAX2EventRecorder.replay(SAX2EventRecorder.java:165)
at org.apache.axis.message.MessageElement.publishToHandler(MessageElement.java:1141)
at org.apache.axis.message.RPCElement.deserialize(RPCElement.java:345)
at org.apache.axis.message.RPCElement.getParams(RPCElement.java:384)
at org.apache.axis.client.Call.invoke(Call.java:2467)
at org.apache.axis.client.Call.invoke(Call.java:2366)
at org.apache.axis.client.Call.invoke(Call.java:1812)
at solutiondatabase.SOAPExample.runExample(SOAPExample.java:37)
at solutiondatabase.Main.main(Main.java:Cool
org.xml.sax.SAXException: No deserializer defined for array type {http://namespaces.soaplite.com/perl}ShortCampaignInfo


(2) at office, where I have proxy and firewall, I have:

(405)Not Allowed
at org.apache.axis.transport.http.HTTPSender.readFromSocket(HTTPSender.java:744)
at org.apache.axis.transport.http.HTTPSender.invoke(HTTPSender.java:144)
at org.apache.axis.strategies.InvocationStrategy.visit(InvocationStrategy.java:32)
at org.apache.axis.SimpleChain.doVisiting(SimpleChain.java:118)
at org.apache.axis.SimpleChain.invoke(SimpleChain.java:83)
at org.apache.axis.client.AxisClient.invoke(AxisClient.java:165)
at org.apache.axis.client.Call.invokeEngine(Call.java:2784)
at org.apache.axis.client.Call.invoke(Call.java:2767)
at org.apache.axis.client.Call.invoke(Call.java:2443)
at org.apache.axis.client.Call.invoke(Call.java:2366)
at org.apache.axis.client.Call.invoke(Call.java:1812)
at solutiondatabase.SOAPExample.runExample(SOAPExample.java:46)
at solutiondatabase.Main.main(Main.java:10)


I gave already added proxy settings to my code:
Properties props= new Properties(System.getProperties());
props.put("http.proxySet", "true");
props.put("http.proxyHost", "XXX");
props.put("http.proxyPort", "8080");

Properties newprops = new Properties(props);
System.setProperties(newprops);



Can you explain me the meaning of the errors?
 
Lester Burnham
Rancher
Posts: 1337
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You need a custom serializer in order to send arbitrary Java objects over the wire. If your object follows JavaBean semantics, you may be able to get away with configuring a Bean Serializer. Start here: http://ws.apache.org/axis/java/user-guide.html#XMLJavaDataMappingInAxis.
 
Let me tell you a story about a man named Jed. He made this tiny ad:
Garden Master Course kickstarter
https://coderanch.com/t/754577/Garden-Master-kickstarter
reply
    Bookmark Topic Watch Topic
  • New Topic