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

WSDL 1.1: Two "address"-elements within one "port"?

 
Ranch Hand
Posts: 76
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi there,

I have a WSDL 1.1 document. It has two "address"-elements within one "port"-element:



The binding contains two operations and this transport binding:



This validates within Eclipse WTP, I think because the WSDL Schema contains an "any"-element, right?:



But my question: Does it make any sense with two "address"-elements within one "port"-element - does it mean the endpoint can be accessed through two different way?
Or should I use two "port"-elements with different bindings?
Or should I add a second transport-binding with "soap over http" to the "binding"-element?

I hope you can help me out and explain if this solution is nonsense?!


Best regards,
Kai
 
Ranch Hand
Posts: 215
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi. Per Section 2.6 of the WSDL 1.1 Spec: "A port MUST NOT specify more than one address."
 
Kai Wähner
Ranch Hand
Posts: 76
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Oh, thank you...

I only looked at the soap:address section in the spec :-(

Do you know, why this limitation is not specified within the WSDL Schema file, but only within the spec?
 
R Srini
Ranch Hand
Posts: 215
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Interesting. In the WSDL spec introduction (Section 1 in earlier link), it states "A port is defined by associating a network address with a reusable binding, and a collection of ports define a service." (The italics/colour are mine) So I guess the WSDL is not 1.1 compliant. Also, the statement implies that a port can have only one address. And yes, I see that the WSDL does validate in Eclipse with multiple address elements inside a port. No idea why.

Anyway, some questions:

1. What is the source of your WSDL? Is it being handed to you to develop against? Or are you creating one from scratch?
2. If you are creating it, what is your goal here?

My guess based on your example: If you are trying to trying to setup SOAP over JMS, then the SOAP over JMS spec has a nice example that you might find useful.
 
Kai Wähner
Ranch Hand
Posts: 76
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Well, my WSDL is compliant to the WSDL 1.1 XSD, but not to the speficiation. It validates within Eclipse, because there is an any-element in the XSD:



So you can add whatever you want, also <test/> instead of <jms:address/>.


And your other question: I am the creator of this file (contract first). We offer the server side, other guys create the client side.
The messages are send via JMS, so I used the JMS transport. I have sent them the file, and they returned an updated version with the two address elements. Reason: They need this transport to create a working client...
We will have some discussions with these guys soon, because they probably do not really know what they wanna do :-)
 
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!
Update: Ouch, I made an error writing this post - see below for correction!

There is only one thing that I want to add/clarify to the detailed discussion above:
Within a <wsdl:service> element, you can have multiple <port> elements that refer to the same binding, but with each <port> element specifying a different address for the service.
Example:

This can be useful when (as in the example above) you want to define multiple endpoints for the same service, where one is used for, for instance, failover or load balancing.
You can also use this technique to make one and the same service available using, for instance, JMS and HTTP transport.
Best wishes!
 
R Srini
Ranch Hand
Posts: 215
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
This is very useful information. Thank you for sharing it!

Best regards.
 
Kai Wähner
Ranch Hand
Posts: 76
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Evan,

I think the following statement is not correct:

You can also use this technique to make one and the same service available using, for instance, JMS and HTTP transport.



If you want to use JMS and HTTP transport, you need two different bindings, because the HTTP transport needs another transport-binding than <soap11:binding style="document" transport="http://schemas.xmlsoap.org/soap/jms"/> ???

Or maybe you can correct me?


Greetings Kai
 
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!
You are absolutely correct and I was too quick and made an error!
The transport is indeed specified in the <binding> element and, if you want to expose a service using JMS and HTTP, you need two different <binding> elements.
However, both <binding> elements can, using the type attribute, refer to the same interface. Thus, you expose two identical services with different bindings.
Thanks for pointing this error out!
 
Villains always have antidotes. They're funny that way. Here's an antidote disguised as a tiny ad:
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic