Uploaded image for project: 'JBoss Web Services'
  1. JBoss Web Services
  2. JBWS-397

CTS: jaxrpc/ee/wsi/document/literal/headertest

XMLWordPrintable

      The schema

      <complexType name="ConfigHeader">
      <sequence>
      <annotation>
      <documentation>
      This is the configuration header
      </documentation>
      </annotation>
      <element name="message" type="string"/>
      <element name="testName" type="string"/>
      </sequence>
      <attribute ref="env:mustUnderstand"/>
      </complexType>

      has a reference to the soap:mustUnderstand attribute that can be set on SOAPHeaderElements

      The message put on the wire by the client is

      <env:Envelope xmlns:env='http://schemas.xmlsoap.org/soap/envelope/'>
      <env:Header>
      <ns1:ConfigHeaderRequest mustUnderstand='false' xmlns:ns1='http://headertestservice.org/types4' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'>
      <message>Config Header</message>
      <testName>GoodOrderTestWithSoapHeaderAndMUFalse</testName>
      </ns1:ConfigHeaderRequest>
      </env:Header>
      <env:Body>
      <ns1:ProductOrderRequest xmlns:ns1='http://headertestservice.org/types4' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'>
      <item>
      <productName>Product-1</productName>
      <productCode>100</productCode>
      <quantity>10</quantity>
      <price>119</price>
      </item>
      <customerInfo>
      <creditcard>1201-4465-1567-9823</creditcard>
      <name>John Doe</name>
      <street>1 Network Drive</street>
      <city>Burlington</city>
      <state>Ma</state>
      <zip>01837</zip>
      <country>USA</country>
      </customerInfo>
      </ns1:ProductOrderRequest>
      </env:Body>
      </env:Envelope>

      It should read

      <env:Envelope xmlns:env='http://schemas.xmlsoap.org/soap/envelope/'>
      <env:Header>
      <ns1:ConfigHeaderRequest env:mustUnderstand='0' xmlns:ns1='http://headertestservice.org/types4' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'>
      <message>Config Header</message>
      <testName>GoodOrderTestWithSoapHeaderAndMUFalse</testName>
      </ns1:ConfigHeaderRequest>
      </env:Header>
      <env:Body>
      <ns1:ProductOrderRequest xmlns:ns1='http://headertestservice.org/types4' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'>
      <item>
      <productName>Product-1</productName>
      <productCode>100</productCode>
      <quantity>10</quantity>
      <price>119</price>
      </item>
      <customerInfo>
      <creditcard>1201-4465-1567-9823</creditcard>
      <name>John Doe</name>
      <street>1 Network Drive</street>
      <city>Burlington</city>
      <state>Ma</state>
      <zip>01837</zip>
      <country>USA</country>
      </customerInfo>
      </ns1:ProductOrderRequest>
      </env:Body>
      </env:Envelope>

      Note the prefix and the value. Valid values for mustUnderstand are 0|1, true and false are not allowed.

      The error is

      2005-09-01 12:53:34,093 ERROR [org.jboss.ws.server.AbstractServlet:63] Error processing web service request
      java.lang.IllegalStateException: Attribute mustUnderstand found in jaxrpc-mapping but not in the schema.
      at org.jboss.ws.jaxb.JAXBUnmarshallerImpl.bindSchemaToJava(JAXBUnmarshallerImpl.java:430)
      at org.jboss.ws.jaxb.JAXBUnmarshallerImpl.initSchemaBinding(JAXBUnmarshallerImpl.java:278)
      at org.jboss.ws.jaxb.JAXBUnmarshallerImpl.unmarshal(JAXBUnmarshallerImpl.java:69)
      at org.jboss.ws.jaxrpc.encoding.JAXBDeserializer.deserialize(JAXBDeserializer.java:85)

            tdiesler@redhat.com Thomas Diesler
            tdiesler@redhat.com Thomas Diesler
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved: