• Post Reply Bookmark Topic Watch Topic
  • New Topic

soap, wsdl, xsd and soap message

 
David Spades
Ranch Hand
Posts: 348
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm just getting started with soap web service and already got so many questions. I'm using Java SOA cookbook as my guideline.
1. Does WSDL exist anywhere in the server or client machine? or is it ALWAYS generated dynamically on the fly?
2. Are there separate xsd to validate request and response? where are they stored? any best-practice folder structure?
3. Who does the validation? the client or the server?
4. When a client already knows the endpoint, what does it do? download WSDL before sending the message, or just send the message?
5. How many WSDL in a web service? one per class? one per endpoint?

thanks.
 
Ulf Dittmer
Rancher
Posts: 42970
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
#1 The WSDL is generated by the SOAP engine that runs the WS, so it would exist on the server. You can save it as a file and then use wherever you please, though. In production use the generation of the WSDL is generally turned off.

#2 The XSD is also generally part of the WSDL, although it could exist separately and be referenced by the WSDL. See http://www.w3.org/2001/03/14-annotated-WSDL-examples for some examples.

#3/#4 I'm not sure there is normally validation against an XSD happening, at least not in he XML sense of the word. The WSDL and XSD are used to generate client code, after that (meaning, when the WS is called) they're generally irrelevant.

#5 A WSDL can contain several endpoints. I think whether there could be several classes implementing WS that are all bundled in the same WSDL might be implementation-dependent. "class" is in any case a Java concept, and so would have no place being reflected in a WSDL.
 
David Spades
Ranch Hand
Posts: 348
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
okay, I realize that soap is supposed to be technology independent, but for now, I'm implementing using Java, so perhaps to make things clearer, I'll use Java terms.
does one endpoint translate to one class in Java? can an endpoint contain several classes which in turn contains several methods (operation)?



This is what I got from the link above. I'm curious as to why the m namespace must be used? what would happen if it's omitted?
also, the children on endorsingBoarder doesn't share the same namespace as the parent. how does that affect parsing?

thanks
 
Ulf Dittmer
Rancher
Posts: 42970
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
As I said, that's an implementation-specific question, so I don't think there's one answer that applies to all SOAP implementations. With the implementations I have used (JAX-WS RI and Axis2), a Java class can contain multiple operations, and multiple Java classes containing operations can be used in a single endpoint. IMO it would make sense for all SOAP to work this way, but I'm not sure if that's required by the JAX-WS spec. (It couldn't be required by the SOAP or WSDL specs because they don't get into implementation language details.)
 
David Spades
Ranch Hand
Posts: 348
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
ah, yes, that's what I need, multiple java class (serviceName) under the same endpoint. Could you show me how it's done? all the tutorials only gives one java class in one endpoint.
what about the namespace issue?
thanks
 
Ulf Dittmer
Rancher
Posts: 42970
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Assuming you're using JAX-WS, have you tried having several classes with the appropriate annotations? I don't think there was anything else that needed to be done.

What namespace issue?
 
David Spades
Ranch Hand
Posts: 348
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes I have, I'm using endpoint.publish, but I understand that no overloaded version of that method that accepts multiple implementor objects.
I'm referring to the effect if I remove the m namespace in the soap request I posted earlier.
thanks
 
Ulf Dittmer
Rancher
Posts: 42970
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Method overloading is a language-specific construct; I don't think WSDL has a way to dealing with that. Maybe you can map that parameter type to xsd:anyType (losing some of the benefits of XSD in the process).

I had overlooked the comment on NS - can't help with that, I've never paid much attention to them. That, too, may be implementation-dependent, as the WSDL spec doesn't have much to say about NS.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!