Author |
Message
|
SCSailors |
Posted: Mon Dec 11, 2006 6:31 am Post subject: Validation if wsdl contains xsd:anyType |
|
|
Newbie
Joined: 11 Dec 2006 Posts: 3
|
MessageBroker 5: if an xsd contains type as xsd:anyType instead of string ,integer, can one do any validation on the xml against the MRM.. |
|
Back to top |
|
 |
Vitor |
Posted: Mon Dec 11, 2006 6:35 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
Yes - and if the MRM reflects the schema any type will be valid.... _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
SCSailors |
Posted: Mon Dec 11, 2006 7:22 am Post subject: |
|
|
Newbie
Joined: 11 Dec 2006 Posts: 3
|
to a bit more complicated question.. the xsd from the partner looks like this <?xml version="1.0" encoding="UTF-8"?>
<xsd:schema targetNamespace="com.xyz.msg" xmlns="com.xyz.msg" xmlns:xsd="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" attributeFormDefault="unqualified">
<xsd:element name="LogicalShipped">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="LogicalOrderCode" type="xsd:string" minOccurs="0" />
<xsd:element name="GenerationDate" type="xsd:string" minOccurs="0" />
<xsd:element name="Line" minOccurs="0" maxOccurs="unbounded">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="ShipDate" type="xsd:string" minOccurs="0" />
<xsd:element name="MarketCode" type="xsd:string" minOccurs="0" />
<xsd:element name="CountryCode" type="xsd:string" minOccurs="0" />
<xsd:element name="Quantity" type="xsd:string" minOccurs="0" />
</xsd:sequence>
</xsd:complexType>
</xsd:element>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
</xsd:schema>
they are the webservice client and message broker is the service provider, but for some technical reason they do not want the xsd object above used as is, they want to use a wsdl like this <?xml version="1.0" encoding="UTF-8"?>
<wsdl:definitions xmlns:impl="http://service.app.xyz.com" xmlns:intf="http://service.app.xyz.com" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:wsi="http://ws-i.org/profiles/basic/1.1/xsd" xmlns:xsd="http://www.w3.org/2001/XMLSchema" targetNamespace="http://service.app.xyz.com">
<wsdl:types>
<schema xmlns="http://www.w3.org/2001/XMLSchema" targetNamespace="http://service.app.xyz.com" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<element name="sample">
<complexType>
<sequence>
<element name="param" nillable="true" type="xsd:anyType"/>
</sequence>
</complexType>
</element>
</schema>
</wsdl:types>
<wsdl:message name="ProcessLogicalShipped_in">
<wsdl:part name="parameters" element="impl:sample"/>
</wsdl:message>
<wsdl:portType name="LogicalShippedPortType">
<wsdl:operation name="ProcessLogicalShipped">
<wsdl:input name="ProcessLogicalShipped_LogicalShipped" message="tns:ProcessLogicalShipped_in"/>
</wsdl:operation>
</wsdl:portType>
<wsdl:binding name="LogicalShippedSOAP_JMS_Binding" type="impl:LogicalShippedPortType">
<wsdlsoap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
<wsdl:operation name="ProcessLogicalShipped">
<wsdlsoap:operation/>
<wsdl:input>
<wsdlsoap:body use="literal"/>
</wsdl:input>
</wsdl:operation>
</wsdl:binding>
<wsdl:service name="LogicalShippedSOAP_JMS_Service">
<wsdl:port name="JMSSOAPPort" binding="tns:LogicalShippedSOAP_JMS_Binding">
<soap:address location="jms:/queue?destination=jms/aQueue&connectionFactory=jms/aQCF&targetService=LogicalShippedSOAP_JMS_Service&initialContextFactory=com.ibm.websphere.naming.WsnInitialContextFactory&jndiProviderURL=iiop://localhost"/>
</wsdl:port>
</wsdl:service>
</wsdl:definitions>
I can do this in the broker's toolkit only by editing the wsdl by hand..if I have a wsdl like the above I do not know what validation I can do for the xsd |
|
Back to top |
|
 |
jefflowrey |
Posted: Mon Dec 11, 2006 7:31 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
You should look at the Web Services samples in the Samples Gallery.
You should look at Multipart Messages, and Wildcard elements. _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
kimbert |
Posted: Mon Dec 11, 2006 2:40 pm Post subject: |
|
|
 Jedi Council
Joined: 29 Jul 2003 Posts: 5542 Location: Southampton
|
Quote: |
if I have a wsdl like the above I do not know what validation I can do for the xsd |
Element 'sample' contains exactly one child element 'param'. 'param' may be nil, or may contain anything you like. In theory, MRM validation will enforce those rules. |
|
Back to top |
|
 |
jefflowrey |
Posted: Mon Dec 11, 2006 2:54 pm Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
In fact, what I believe that SCSailors wants is that the MRM should validate that "sample" contains exactly one child element, that is the "LogicalShipped" element described in the other schema.
Editing the WSDL by hand is one approach. Playing around with multipart messages is another. _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
SCSailors |
Posted: Mon Dec 11, 2006 5:09 pm Post subject: |
|
|
Newbie
Joined: 11 Dec 2006 Posts: 3
|
will the validation be carried forward into LOgicalShipped (which has the field definitions in this case) or will it just stop at sample..any ideas |
|
Back to top |
|
 |
jefflowrey |
Posted: Mon Dec 11, 2006 6:06 pm Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
It will not be carried forward unless you do some things to make it get carried forward. _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
|