In few scenarios, we may have to process old style XML document without namespaces. However, BPEL activities may not be able to work with variables properly without proper namespace.
In this example, we will see how to associate a namespace before bpel activities start.
Assume, we have below xsd: CustomerStauts.xsd
<?xml version="1.0" encoding="windows-1252" ?>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified">
<xsd:element name="custInput" type="custInputType">
<xsd:annotation>
<xsd:documentation>customer Input</xsd:documentation>
</xsd:annotation>
</xsd:element>
<xsd:element name="statusOuput" type="custCreditStatustType">
<xsd:annotation>
<xsd:documentation>customer credit status Ouput</xsd:documentation>
</xsd:annotation>
</xsd:element>
<xsd:complexType name="custInputType">
<xsd:sequence maxOccurs="unbounded">
<xsd:element name="custNumber" type="xsd:string"/>
<xsd:element name="custName" type="xsd:string"/>
</xsd:sequence>
</xsd:complexType>
<xsd:complexType name="custCreditStatustType">
<xsd:sequence maxOccurs="unbounded">
<xsd:element name="custNumber" type="xsd:string"/>
<xsd:element name="status" type="xsd:string"/>
</xsd:sequence>
</xsd:complexType>
</xsd:schema>
This does not have targetnamespace defined. To process this, we need to create a nxsd wrapper document in the same location Schemas folder of the BPEL project.
Below is the wrapper.xsd.
<?xml version="1.0" encoding="UTF-8"?>
<schema xmlns="http://www.w3.org/2001/XMLSchema"
targetNamespace="http://www.ns.example.org/customerStatus"
xmlns:nxsd="http://xmlns.oracle.com/pcbpel/nxsd"
nxsd:version="DTD">
<include schemaLocation="CustomerStatus.xsd"/>
</schema>
Use the wrapper.xsd with in the wsdl as wsdl:input instead of CusotmerStatus.xsd. It is important for the original schema to have elementFormDefault = "Qualified".
reference: 6.4.4 of the document:
http://docs.oracle.com/cd/E23943_01/integration.1111/e10231/nfb.htm#TKADP1079
In this example, we will see how to associate a namespace before bpel activities start.
Assume, we have below xsd: CustomerStauts.xsd
<?xml version="1.0" encoding="windows-1252" ?>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified">
<xsd:element name="custInput" type="custInputType">
<xsd:annotation>
<xsd:documentation>customer Input</xsd:documentation>
</xsd:annotation>
</xsd:element>
<xsd:element name="statusOuput" type="custCreditStatustType">
<xsd:annotation>
<xsd:documentation>customer credit status Ouput</xsd:documentation>
</xsd:annotation>
</xsd:element>
<xsd:complexType name="custInputType">
<xsd:sequence maxOccurs="unbounded">
<xsd:element name="custNumber" type="xsd:string"/>
<xsd:element name="custName" type="xsd:string"/>
</xsd:sequence>
</xsd:complexType>
<xsd:complexType name="custCreditStatustType">
<xsd:sequence maxOccurs="unbounded">
<xsd:element name="custNumber" type="xsd:string"/>
<xsd:element name="status" type="xsd:string"/>
</xsd:sequence>
</xsd:complexType>
</xsd:schema>
This does not have targetnamespace defined. To process this, we need to create a nxsd wrapper document in the same location Schemas folder of the BPEL project.
Below is the wrapper.xsd.
<?xml version="1.0" encoding="UTF-8"?>
<schema xmlns="http://www.w3.org/2001/XMLSchema"
targetNamespace="http://www.ns.example.org/customerStatus"
xmlns:nxsd="http://xmlns.oracle.com/pcbpel/nxsd"
nxsd:version="DTD">
<include schemaLocation="CustomerStatus.xsd"/>
</schema>
Use the wrapper.xsd with in the wsdl as wsdl:input instead of CusotmerStatus.xsd. It is important for the original schema to have elementFormDefault = "Qualified".
reference: 6.4.4 of the document:
http://docs.oracle.com/cd/E23943_01/integration.1111/e10231/nfb.htm#TKADP1079
No comments:
Post a Comment