Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Help needed for wsdl generated by wstools

 
Sumeet Shah
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I am using jboss 4.0.4 GA to generate wsdl file. I am using wstools ant task. WSDL generation is successful, but small issue is to make it more readable. Actually, namespace prefix is not auto generated with definitions , element, complexType,etc. For example, part of wsdl:

<complexType name='Status'>
<sequence>
<element name='XMLMessage' nillable='true' type='string'/>
<element name='loadStatusMessage' nillable='true' type='string'/>
<element name='messageId' nillable='true' type='string'/>
</sequence>

But, namespace is there in wsdl:
<definitions name='MyTestAdapter' targetNamespace='http://com.test.com' xmlns='http://schemas.xmlsoap.org/wsdl/' xmlns:soap='http://schemas.xmlsoap.org/wsdl/soap/' xmlns:xsd='http://www.w3.org/2001/XMLSchema'>


Is there any configuration I need to make in wstools.config.xml?
Any help is really appreciated.

Thanks,
Zeena
 
Dan Drillich
Ranch Hand
Posts: 1183
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sumeet,

Looking at Example 1 SOAP 1.1 Request/Response via HTTP -




So, as you can see the namespace is defined at the level of the schema. Therefore, can you please post the entire WSDL document?

Regards,
Dan
 
Sumeet Shah
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Dan,
WSDL generated is the same as given in reference link by you.
Like for complexType, I need "xsd:complexType", where xsd points to xmlns:xsd='http://www.w3.org/2001/XMLSchema'
For <definitions name='TestMessageAdapter' , I need <wsdl:definitions name='TestMessageAdapter'
I am also posting wsdl for reference.

<?xml version="1.0" encoding="UTF-8"?>
<definitions name='TestMessageAdapter' targetNamespace='http://test.ws.com' xmlns='http://schemas.xmlsoap.org/wsdl/' xmlns:ns1='http://test.ws.com/types' xmlns:ns2='http://jaxb.ws.ws.test.com/jaws' xmlns:soap='http://schemas.xmlsoap.org/wsdl/soap/' xmlns:tns='http://test.ws.com' xmlns:xsd='http://www.w3.org/2001/XMLSchema'>
<types>
<schema targetNamespace='http://test.ws.com/types' xmlns='http://www.w3.org/2001/XMLSchema' xmlns:ns2='http://jaxb.ws.test.com/jaws' xmlns:soap11-enc='http://schemas.xmlsoap.org/soap/encoding/' xmlns:tns='http://test.ws.com/types' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'>
<import namespace='http://jaxb.ws.test.com/jaws'/>
<complexType name='Status'>
<sequence>
<element name='XMLMessage' nillable='true' type='string'/>
<element name='loadStatusMessage' nillable='true' type='string'/>
<element name='messageId' nillable='true' type='string'/>
</sequence>
</complexType>


<complexType name='addOrUpdateUser'>
<sequence>
<element name='User_1' nillable='true' type='ns2:User'/>
<element name='UserName_2' nillable='true' type='tns:UserName'/>
</sequence>
</complexType>

<complexType name='UserName'>
<sequence>
<element name='username' nillable='true' type='string'/>
</sequence>
</complexType>

<element name='addOrUpdateUser' type='tns:addOrUpdateUser'/>

</schema>
<schema targetNamespace='http://jaxb.ws.test.com/jaws' xmlns='http://www.w3.org/2001/XMLSchema' xmlns:ns1='http://test.ws.com/types' xmlns:soap11-enc='http://schemas.xmlsoap.org/soap/encoding/' xmlns:tns='http://jaxb.ws.test.com/jaws' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'>
<import namespace='http://test.ws.com/types'/>

<complexType name='User'>
<sequence>
<element name='userCode' nillable='true' type='string'/>
<element name='email' nillable='true' type='string'/>
<element name='firstName' nillable='true' type='string'/>
<element name='lastName' nillable='true' type='string'/>
<element name='middleName' nillable='true' type='string'/>
<element name='office' nillable='true' type='string'/>
<element name='telephone' nillable='true' type='tns:Telephone'/>
<element name='title' nillable='true' type='string'/>
</sequence>
</complexType>

</schema>
</types>

<message name='TestMessageAdapter_addOrUpdateUser'>
<part element='ns1:addOrUpdateUser' name='parameters'/>
</message>

<operation name='addOrUpdateUser'>
<input message='tns:TestMessageAdapter_addOrUpdateUser'/>
<output message='tns:TestMessageAdapter_addOrUpdateUserResponse'/>
</operation>


<binding name='TestMessageAdapterBinding' type='tns:TestMessageAdapter'>
<soap:binding style='document' transport='http://schemas.xmlsoap.org/soap/http'/>
<operation name='addOrUpdateUser'>
<soapperation soapAction=''/>
<input>
<soap:body use='literal'/>
</input>
<output>
<soap:body use='literal'/>
</output>
</operation>

</binding>
<service name='TestMessageAdapter'>
<port binding='tns:TestMessageAdapterBinding' name='TestMessageAdapterPort'>
<soap:address location='REPLACE_WITH_ACTUAL_URL'/>
</port>
</service>
</definitions>
Thanks
 
Dan Drillich
Ranch Hand
Posts: 1183
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sumeet,

In the example you posted, xsd:complexType and complexType are equivalent since the schema element specifies xmlns='http://www.w3.org/2001/XMLSchema'. Meaning, all elements within the schema element belong to the 'http://www.w3.org/2001/XMLSchema' namespace.

Regards,
Dan
 
Sumeet Shah
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Dan,
Thanks for reply. Yes, it is true that xsd:complexType and complexType are equivalent. There is no issue with functionality too. Only to make wsdl easily readable, I want to append xsd as prefix. As, this wsdl is generated by wstools, not manually and it is in build process. So, there is no option to append prefix manually in wsdl. Is there any option where I can cofigure to have prefix with elements.
Thanks again...
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic