• 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

WSDL error: binding:StocksQuoteSOAPBinding not exist

 
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am developing web services with contract first approach. I developed the wsdl file and now I am ecuting the wsdl2java command. In that process I am getting the following error. I am also pasting the wsdl file below that



The wsdl file is pasted below

 
Ranch Hand
Posts: 215
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Prasad, I just tried it myself using the wsimport from NetBeans, and got the same error. I have typically observed that the URLs for targetNamespace and tns are the same. In the current wsdl, they are different. Once I changed that, that particular error went away.

Instead of this:
targetNamespace="http://stocksquote.com/StocksQuote.wsdl"
xmlns:tns="http://www.stocksquote.com/StocksQuote.wsdl"

Please try this:
targetNamespace="http://www.stocksquote.com/StocksQuote.wsdl"
xmlns:tns="http://www.stocksquote.com/StocksQuote.wsdl"

And now, I get another error:

[WARNING] s4s-att-not-allowed: Attribute 'location' cannot appear in element 'import'.
line 13 of file:/C:/Srini/StocksQuote.wsdl#types?schema1

I think the attribute should be "schemaLocation" instead of "location". Anyway, once you figure it out, please let us know what you fixed.

But I have another question: Do the tns and targetnamespace always have to be the same in a schema/xsd? Or can they be different?
 
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!
If the target namespace is set to one namespace, for instance http://stocksquote.com/StocksQuote.wsdl, and there is no namespace prefix specified for this namespace, then this will be the default namespace and items belonging to this namespace must not be prefixed by any namespace prefix.
In the original WSDL, with this:

targetNamespace="http://stocksquote.com/StocksQuote.wsdl"
xmlns:tns="http://www.stocksquote.com/StocksQuote.wsdl"


The target namespace is not the same as the namespace that has the tns namespace prefix.
The namespace prefix, tns in the above case, is arbitrary. You can give a namespace prefix any name you want. Example:

Usually namespace prefixes are given shorter names...
Hope this clarifies things!
 
You get good luck from rubbing the belly of a tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic