This week's book giveaways are in the Java EE and JavaScript forums.
We're giving away four copies each of The Java EE 7 Tutorial Volume 1 or Volume 2(winners choice) and jQuery UI in Action and have the authors on-line!
See this thread and this one for details.
The moose likes Web Services Certification (SCDJWS/OCEJWSD) and the fly likes BP 1.1 Clarification related to parts attribute of <soapbind:body> element. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Certification » Web Services Certification (SCDJWS/OCEJWSD)
Bookmark "BP 1.1 Clarification related to parts attribute of <soapbind:body> element." Watch "BP 1.1 Clarification related to parts attribute of <soapbind:body> element." New topic
Author

BP 1.1 Clarification related to parts attribute of <soapbind:body> element.

Kamal Tripathi
Ranch Hand

Joined: Oct 02, 2008
Posts: 86
Here is what BP 1.1 says which finds mention in even Ivan's notes. Here is what Ivan's notes say.


• In a Document/Literal description where the <soapbind:body> element has a parts attribute
with the value “” (the empty string), the corresponding envelope must have an empty SOAP
<Body> element.
• In a RPC/Literal description where the <soapbind:body> element has a parts attribute with
the value “” (the empty string), the corresponding envelope must have no part acceparts attributessor
elements.



Here are my questions.

  • Unless I missed something in Ivan's notes and in RMH, it doesn't talk about parts attribute of <soapbind:body> element. What is it used for.
  • In a Document/Literal description where the <soapbind:body> element has a parts attribute
    with the value “” (the empty string), the corresponding envelope must have an empty SOAP
    <Body> element

    Are we talking abt a SOAP message with an empty <Body> element. What purpose would it serve. I am assuming somehow it would be answered by the first question but still wanted to put my doubt forth.

  • If someone could post an example of SOAP envelope for both RPC/Literal format with parts attribute = "" that would be really helpful.


  • Thanks

    Kamal Tripathi
    SCJP 1.4 90%, SCWCD5 94%, Next SCDJWS--> In Naescent stage. Researching abt exam and material itself.
    Kumar Raja
    Ranch Hand

    Joined: Mar 18, 2010
    Posts: 518
        
        2

    Kamal,

    May be I'm mistaken and would appreciate, if some one corrects me here.

    When I looked into the schema http://schemas.xmlsoap.org/wsdl/soap for soapbind:body element, below is what I see


    <xs:element name="body" type="soap:tBody" />
    - <xs:attributeGroup name="tBodyAttributes">
    <xs:attribute name="encodingStyle" type="soap:encodingStyle" use="optional" />
    <xs:attribute name="use" type="soap:useChoice" use="optional" />
    <xs:attribute name="namespace" type="xs:anyURI" use="optional" />
    </xs:attributeGroup>
    - <xs:complexType name="tBody">
    - <xs:complexContent>
    - <xs:extension base="wsdl:tExtensibilityElement">
    <xs:attribute name="parts" type="xs:NMTOKENS" use="optional" />
    <xs:attributeGroup ref="soap:tBodyAttributes" />
    </xs:extension>
    </xs:complexContent>
    </xs:complexType>



    parts attribute is of type NMTOKENS which means it should be non zero length of sequence as per definition

    The ·value space· of NMTOKENS is the set of finite, non-zero-length sequences of ·NMTOKEN·s. The ·lexical space· of NMTOKENS is the set of space-separated lists of tokens, of which each token is in the ·lexical space· of NMTOKEN. The ·itemType· of NMTOKENS is NMTOKEN.


    So I do not understand, why BP1.1 could actually say about parts="", when it is not allowed by spec.


    Regards
    KumarRaja

    Dan Drillich
    Ranch Hand

    Joined: Jul 09, 2001
    Posts: 1176
    "soap:body" - Binding for SOAP Body seems to explain it well.

    parts="nmtokens" - Indicates with part or parts defined in the input or output message (specified through the "wsdl:portType" element) are used to construct this SOAP Body. If not provided, all parts are used.


    So, three scenarios exist -

    Parts attribute doesn't exist - all input or output messages are used to construct the SOAP Body.
    Parts attribute exists and it's "" - SOAP Body would be empty.
    Parts attribute exists and it lists messages - SOAP Body would have only these parts.

    Regards,
    Dan


    William Butler Yeats: All life is a preparation for something that probably will never happen. Unless you make it happen.
    Kumar Raja
    Ranch Hand

    Joined: Mar 18, 2010
    Posts: 518
        
        2

    Agreed,

    but NMTOKENS means it should be a non zero length sequence, then how can we use parts="", which means a zero lenght here.
    Anitha Narayanan
    Greenhorn

    Joined: Apr 19, 2011
    Posts: 7
    Hi Dan/Kumar,
    I'm facing a problem in auto generated wsdl which has parts="" for soap:body while adding it as web reference in visual studio2008. I have created new thread webpage. Could you please clarify my doubts, Many thanks in advance.
     
    I agree. Here's the link: http://aspose.com/file-tools
     
    subject: BP 1.1 Clarification related to parts attribute of <soapbind:body> element.