Win a copy of Java EE 8 High Performance this week in the Java/Jakarta EE forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

webmethod of Doc/Lit bare style with only one header param generates part="" invalid wsdl soap:body  RSS feed

Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi there,

I have a question regarding generated wsdl's soap:body of webmethod which is doc/lit bare style with only one header parameter.

I read BasicProfile V1.1 section 4.4.1 R2213 that soap:body can have empty string in their parts attribute. But if wsdl have parts="", i face below problem in Visual Studio. I'm using bottom-up approach. my web method and generated wsdl is given below.

R2213 In a doc-literal description where the value of the parts attribute of soapbind:body is an empty string, the corresponding ENVELOPE MUST have no element content in the soap:Body element.

Example webmethod:
@WebResult(name = "GetAllStockQuotesResponse", targetNamespace = "http://jaxwebsvcs/StockQuote", partName = "parameters")
@WebMethod(action = "getAllStockQuotes")
public StockQuoteList getAllStockQuotes(
@WebParam(partName = "header", name = "SecurityHeader", targetNamespace = "http://jaxwebsvcs/WebSvcHeader", header =true)
jaxwebsvcs.websvcheader.SecurityAttributes header
) throws ServiceException;

Part of Generated Wsdl:
<message name="getAllStockQuotes">
<part xmlns:ns4="http://jaxwebsvcs/WebSvcHeader" name="header" element="ns4:SecurityHeader" />
<message name="getAllStockQuotesResponse">
<part name="parameters" element="tns:GetAllStockQuotesResponse" />

<portType name="StockQuotePort">
<operation name="getAllStockQuotes">
<input wsam:Action="getAllStockQuotes" message="tns:getAllStockQuotes" />
<output wsam:Action="http://jaxwebsvcs/StockQuote/StockQuotePort/getAllStockQuotesResponse" message="tns:getAllStockQuotesResponse" />
<fault message="tns:ServiceException" name="ServiceException" wsam:Action="http://jaxwebsvcs/StockQuote/StockQuotePort/getAllStockQuotes/Fault/ServiceException" />

<binding name="StockQuotePortBinding" type="tns:StockQuotePort">
<soap12:binding transport="" style="document" />
<operation name="getAllStockQuotes">
<soap12:operation soapAction="getAllStockQuotes" />
<soap12:body use="literal" parts="" />
<soap12:header message="tns:getAllStockQuotes" part="header" use="literal" />
<soap12:body use="literal" />
<fault name="ServiceException">
<soap12:fault name="ServiceException" use="literal" />

If i add this wsdl as web reference in VS2008 i'm getting following error.

Custom tool error: Unable to import WebService/Schema. Unable to import binding 'StockQuotePortBinding' from namespace 'http://jaxwebsvcs/StockQuote'. Unable to import operation 'getAllStockQuotes'. Missing message part '' for message 'getAllStockQuotes' from namespace 'http://jaxwebsvcs/StockQuote'.

Bare style can have zero arguments(parts = empty string) in their web method accordong to BasicProfile 1.1. [considering only non-header parameters consititute arguments below method is the zero argument web method only. So a valid wsdl only, but why VS2008 generates above custom tool error ?
Brief version of above webmethod
public StockQuoteList getAllStockQuotes(@WebParam(header=true) SecAttributes header)

i) How ever if i remove that SecurityAttributes header argument totally, part="" is not generated in the wsdl soap binding body. Therefore i'm able to add web reference without any issue.
ii) Also If i change the parameter style to doc/Lit wrapped, I'm able to add as web reference without any issue.

Is it rule that bare parameter style should have atleast one non-header parameter if it has atleast one header parameter ?
Is it possible to take that parts="" from wsdl without manually editing the wsdl ?
Am i missing any properties of annotations, which adds parts="" for soap:body ?
Can some one help me out with this error ? Please....
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!