You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@axis.apache.org by Wolfram Kaiser <mr...@gmx.de> on 2006/05/30 09:22:14 UTC

XML message does not get validated

Hello,

when I create the XML message using the Axiom API in my testechoString() method it does not matter whether a valid sub-element is created or not. For example, both of the following lines of code work:
correct:
OMElement requestElement = OMAbstractFactory.getOMFactory().createOMElement("echoString", defaultNamespace);
OMElement paramElement = factory.createOMElement("string", defaultNamespace);
incorrect:
OMElement requestElement = OMAbstractFactory.getOMFactory().createOMElement("echoString", defaultNamespace);
OMElement paramElement = factory.createOMElement("string12", defaultNamespace);

My WSDL extract looks like this (with the complex type "echoString" named "string"):

  <wsdl:types>
    <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:types="http://MyService.axis2.wk.test.com/types" targetNamespace="http://MyService.axis2.wk.test.com/types"
      xmlns:xmime="http://www.w3.org/2005/05/xmlmime" elementFormDefault="unqualified" attributeFormDefault="unqualified">
      <xs:element name="echoString">
        <xs:complexType>
          <xs:sequence>
            <xs:element type="xs:string" name="string" />
          </xs:sequence>
        </xs:complexType>
      </xs:element>
      <xs:element name="echoStringResponse">
        <xs:complexType>
          <xs:sequence>
            <xs:element type="xs:string" name="return" />
          </xs:sequence>
        </xs:complexType>
      </xs:element>
    </xs:schema>
  </wsdl:types>
  <wsdl:message name="echoStringMessage">
    <wsdl:part element="ns2:echoString" name="part1" />
  </wsdl:message>
  <wsdl:message name="echoStringResponseMessage">
    <wsdl:part element="ns2:echoStringResponse" name="part1" />
  </wsdl:message>
  <wsdl:portType name="MyServicePortType">
    <wsdl:operation name="echoString">
      <wsdl:input message="ns:echoStringMessage" />
      <wsdl:output message="ns:echoStringResponseMessage" />
    </wsdl:operation>
  </wsdl:portType>
  <wsdl:binding type="ns:MyServicePortType" name="MyServiceSOAP11Binding">
    <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http" />
    <wsdl:operation name="echoString">
      <soap:operation style="document" soapAction="urn:echoString" />
      <wsdl:input>
        <soap:body namespace="http://MyService.axis2.wk.test.com" use="literal" />
      </wsdl:input>
      <wsdl:output>
        <soap:body namespace="http://MyService.axis2.wk.test.com" use="literal" />
      </wsdl:output>
    </wsdl:operation>
  </wsdl:binding>


Thus, I would expect that the "string12" sub-element would be rejected by the web service but it is not. Can anyone advice me how to enable validation for XML messages when working with the Axiom API?

Thank you,
Wolfram
-- 


Bis zu 70% Ihrer Onlinekosten sparen: GMX SmartSurfer!
      Kostenlos downloaden: http://www.gmx.net/de/go/smartsurfer
    

---------------------------------------------------------------------
To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-user-help@ws.apache.org