• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

new to soap web service

 
Ranch Hand
Posts: 60
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Im new to web services, so hopefully can get some help here. Say i need to write some api to correspond to the web service http://api.clickatell.com/soap/webservice.php?WSDL in order to invoke the method of the web service and pass in parameter, how should i start with that, any good examples which i can follow?
 
Ranch Hand
Posts: 2198
1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi!
The NetBeans site has a lot of tutorials, for instance this one about getting started developing JAX-WS web services:
http://www.netbeans.org/kb/docs/websvc/jax-ws.html
The web service you want to develop a client to uses RPC/Encoded encoding and I am not sure about the support for SOAP encoding in JAX-WS, since I have never tried it. If you check the JAX-WS 2.1 specification, under the section Non-Goals, you see the following:


SOAP Encoding Support Use of the SOAP encoding is essentially deprecated in the web services com-
munity, e.g., the WS-I Basic Profile[8] excludes SOAP encoding. Instead, literal usage is preferred,
either in the RPC or document style.
SOAP 1.1 encoding is supported in JAX-RPC 1.0 and 1.1 but its support in JAX-WS 2.0 runs counter
to the goal of delegation of data binding to JAXB. Therefore JAX-WS 2.0 will make support for SOAP
1.1 encoding optional and defer description of it to JAX-RPC 1.1.
Support for the SOAP 1.2 Encoding[4] is optional in SOAP 1.2 and JAX-WS 2.0 will not add support
for SOAP 1.2 encoding.



If you check the JAX-RPC 1.1 specification, section 14.3.2 you see:


The JAX-RPC specification requires support for the following representation for remote call and response in a SOAPmessage:
• Encoded representation using the SOAP 1.1 encoding:
The rules and format of serialization for the XML data types are based on the SOAP1.1 encoding.
A JAX-RPC run time system implementation is required to support the SOAP1.1 encoding. Interoperability requirements for any other encodings are outside the scope of the JAX-RPC specification.


Thus: You may have to revert to JAX-RPC if there are problems consuming your web service using JAX-WS.
Best wishes!
 
Cloey Tan
Ranch Hand
Posts: 60
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi thanks for the reply, ill take a look at the links provided. While i was in the process of researching, i came across , apache axis, axis2 and apache soap. Can i use them to write the client soap?
 
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

i came across , apache axis, axis2 and apache soap. Can i use them to write the client soap?


Apache SOAP is obsolete - under no circumstances should you use it for anything.

For JAX-WS services you can Axis-2. If you have to use JAX-RPC (see Ivan's post) you can use Axis 1 (Axis 2 doesn't support JAX-RPC).
 
Cloey Tan
Ranch Hand
Posts: 60
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
First off, i would like to thank you both on the replies. Here i have another doubt.

I can see there're some examples on the net on how to use axis to write client to invoke web service, one of them is http://192.87.31.188/docs/easws/easws103.htm Well, i have a question here since i have not started trying out the examples, yet, that whether it is possible to to use axis to list out the available web methods to invoke? and we need to know the return value type as well, so that we can do something like this int value= ((Integer)call.invoke(inParams)).intValue(); it means we need to know /understand the web service before proceed with writing the client? Would that be possible that i write a generic web service client that could cater for different web services?
Please advice and thanks in advance.

Regards

 
Ivan Krizsan
Ranch Hand
Posts: 2198
1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi!
Generally speaking, you do not need to fully understand the WSDL of a web service in order to develop a client for the service.
This is what tools like wsimport do; they parse the WSDL and create artifacts (like JAXB beans, service endpoint interface etc).
Having created these artifacts, you can, in a very simple manner, invoke operations in the service.

Yes, it is possible to write a generic web service client, but I feel it would be a lot of work. Given that there are tools available, I feel it would be a waste of time better spent on other things.
Best wishes!
 
reply
    Bookmark Topic Watch Topic
  • New Topic