• 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

JSP as webservice client

 
Ranch Hand
Posts: 58
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
how to develop the jsp as the webservice client.

What is the value of the namespace uri.
 
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You can embed a WS client written in Java in a JSP page as a scriptlet, just like you would embed any other kind of Java code. Having any amount of Java code -and certainly a WS client- in a JSP page is considered bad design, though. Have you thought about putting the WS client in a servlet, from which you then forward to a JSP page?

Introduction to XML namespaces can be found here and here.
 
vijay kumar
Ranch Hand
Posts: 58
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
is it need to the stubs and ServiceLocator generated wsdl2java to be present at the client's classpath
 
Ulf Dittmer
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Yes, those classes need to be in the client classpath. In the case of a JSP or servlet client that would be in the WEB-INF/classes or lib directory.
 
vijay kumar
Ranch Hand
Posts: 58
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
org.xml.sax.SAXException: Deserializing parameter 'Return': could not find deserializer for type 'Message'
though i'm having the Bean in the classpath it's giving the error.
what is the solution to this problem
 
vijay kumar
Ranch Hand
Posts: 58
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I'm monitoring req/res using TCP monitor.

The req is going proper.
and in the values are coming proper.but i am having one complexType element definition.that is not getting deserialized.

The elements are under with requestelementName+Return.

why this is happning/
 
Ulf Dittmer
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
How did you specify on the client side which class to use for deserialization? Just making the class available is not sufficient, you need to specify the mapping explicitly.
 
vijay kumar
Ranch Hand
Posts: 58
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
i have given the type mapping in the server-config.wsdd file .is it

mapping.xml file needed
 
Ulf Dittmer
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
server-config.wsdd configures the server, which, as you were saying, serializes the object OK. How do you configure the client, which throws the exception?
 
vijay kumar
Ranch Hand
Posts: 58
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
clinet-config.wsdd file.
is it must?

the contents are same as server-config.wsdd file
 
vijay kumar
Ranch Hand
Posts: 58
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
what is the location it has to reside?
 
Ulf Dittmer
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The client config can't be the same as the server config - the server file has WS deployment information that are not applicable to the client. Why don't you post the two files -don't forget to use CODE tags-, and we can take a look at them to see if there's something missing.

And -yes- the client config file is a must if you want to declare custom serialization. How do you use/specify it during invocation of the client?
[ January 09, 2006: Message edited by: Ulf Dittmer ]
 
vijay kumar
Ranch Hand
Posts: 58
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
 
vijay kumar
Ranch Hand
Posts: 58
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
same content i kept in client-config.wsdd
 
Ulf Dittmer
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
A service element is only relevant for the server; it is ignored on the client. You need just the "typeMapping" element. If you're using the BeanSerializer, you could actually use the simpler "beanMapping" element instead. All the details are described in the Axis data mapping documentation.

Also, I don't see any mapping for the type 'Message' which the error message complains about.
[ January 10, 2006: Message edited by: Ulf Dittmer ]
 
vijay kumar
Ranch Hand
Posts: 58
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
my cutom type is complex Type,Then do i need to provide type mapping for sub types also
 
Ulf Dittmer
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Yes, of course. Even if the subtypes use the BeanSerializer as well, that needs to be declared in the config file.
 
vijay kumar
Ranch Hand
Posts: 58
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Even if the subelements are type of xsd:string?

And The Bean class is getSerializer() and getDeserializer().
Do i need to registerTypeMapping in the client explicitly
[ January 11, 2006: Message edited by: kumar sanu ]
 
Ulf Dittmer
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Even if the subelements are type of xsd:string?



No, Axis knows what to do with strings.

And The Bean class is getSerializer() and getDeserializer().



I don't know what this means.

Do i need to register TypeMapping in the client explicitly



To repeat: any type mapping that goes beyond the standard types needs to be registered; see the link I posted earlier.
reply
    Bookmark Topic Watch Topic
  • New Topic