cancel
Showing results for 
Search instead for 
Did you mean: 

Soap Envelope

Former Member
0 Kudos

Hello all,

I have a problem with my soap envelope. I need to add in the Header some Sender information. So I added:

- <xsd:element ref="Sender" />

And futher on I defined the Sender and Recipient like the following:

<xsd:element name="Sender">

<xsd:complexType>

<xsd:sequence>

<xsd:element ref="PartyNumberId" />

</xsd:sequence>

</xsd:complexType>

</xsd:element>

<xsd:element name="PartyNumberId">

<xsd:complexType>

<xsd:sequence>

<xsd:element name="PartyNumber" type="xsd:string" minOccurs="0" />

<xsd:element name="PartyNumberTypeCode" type="xsd:string" minOccurs="0" />

</xsd:sequence>

</xsd:complexType>

</xsd:element>

-


Piece of the exact code:

<?xml version="1.0" encoding="ISO-8859-1"?>

<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:tns="http://schemas.xmlsoap.org/soap/envelope/" targetNamespace="http://schemas.xmlsoap.org/soap/envelope/">

<xsd:element name="Envelope" type="tns:Envelope" />

<xsd:complexType name="Envelope">

<xsd:sequence>

<xsd:element ref="tns:Header" minOccurs="0" />

<xsd:element ref="tns:Body" />

</xsd:sequence>

</xsd:complexType>

<xsd:element name="Header" type="tns:Header" />

<xsd:complexType name="Header">

<xsd:sequence>

<xsd:element ref="Sender" />

<xsd:element ref="Recipient" />

</xsd:sequence>

</xsd:complexType>

<xsd:element name="Body" type="tns:Body" />

<xsd:complexType name="Body">

<xsd:sequence>

<xsd:element ref="ORDERS02" minOccurs="0" maxOccurs="99999" />

</xsd:sequence>

</xsd:complexType>

<xsd:attribute name="mustUnderstand">

<xsd:simpleType>

<xsd:restriction base="boolean">

<xsd:pattern value="0|1" />

</xsd:restriction>

</xsd:simpleType>

</xsd:attribute>

<xsd:attribute name="actor" type="anyURI" />

<xsd:attribute name="encodingStyle" type="encodingStyle" />

<xsd:element name="Fault" type="Fault" />

<xsd:element name="Sender">

<xsd:complexType>

<xsd:sequence>

<xsd:element ref="PartyNumberId" />

</xsd:sequence>

</xsd:complexType>

</xsd:element>

<xsd:element name="Recipient">

<xsd:complexType>

<xsd:sequence>

<xsd:element ref="PartyNumberId" />

</xsd:sequence>

</xsd:complexType>

</xsd:element>

<xsd:element name="PartyNumberId">

<xsd:complexType>

<xsd:sequence>

<xsd:element name="PartyNumber" type="xsd:string" minOccurs="0" />

<xsd:element name="PartyNumberTypeCode" type="xsd:string" minOccurs="0" />

</xsd:sequence>

</xsd:complexType>

</xsd:element>

-


But the referenced Sender element cannot be found.. does anyone know how to fix this??

Thnx

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

It has something to do with using namespaces, for the soap envelope I want to use the namespace for the own defined elements I do not want to use a namespace. Can this be done?

Former Member
0 Kudos

Hello,

I am not clear about your requirement, but if are saying that something is wrong in your xml, then you can go ahead with this xml which i have corrected. (There were some small errors, but now they are ok). Let me know your requirement in detail.

<?xml version="1.0" encoding="ISO-8859-1"?>

<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:tns="http://schemas.xmlsoap.org/soap/envelope/" targetNamespace="http://schemas.xmlsoap.org/soap/envelope/">

<xsd:element name="Envelope" type="tns:Envelope" />

<xsd:complexType name="Envelope">

<xsd:sequence>

<xsd:element ref="tns:Header" minOccurs="0" />

<xsd:element ref="tns:Body" />

</xsd:sequence>

</xsd:complexType>

<xsd:element name="Header" type="tns:Header" />

<xsd:complexType name="Header">

<xsd:sequence>

<xsd:element ref="Sender" />

<xsd:element ref="Recipient" />

</xsd:sequence>

</xsd:complexType>

<xsd:element name="Body" type="tns:Body" />

<xsd:complexType name="Body">

<xsd:sequence>

<xsd:element ref="ORDERS02" minOccurs="0" maxOccurs="99999" />

</xsd:sequence>

</xsd:complexType>

<xsd:attribute name="mustUnderstand">

<xsd:simpleType>

<xsd:restriction base="boolean">

<xsd:pattern value="0|1" />

</xsd:restriction>

</xsd:simpleType>

</xsd:attribute>

<xsd:attribute name="actor" type="anyURI" />

<xsd:attribute name="encodingStyle" type="encodingStyle" />

<xsd:element name="Fault" type="Fault" />

<xsd:element name="Sender">

<xsd:complexType>

<xsd:sequence>

<xsd:element ref="PartyNumberId" />

</xsd:sequence>

</xsd:complexType>

</xsd:element>

<xsd:element name="Recipient">

<xsd:complexType>

<xsd:sequence>

<xsd:element ref="PartyNumberId" />

</xsd:sequence>

</xsd:complexType>

</xsd:element>

<xsd:element name="PartyNumberId">

<xsd:complexType>

<xsd:sequence>

<xsd:element name="PartyNumber" type="xsd:string" minOccurs="0" />

<xsd:element name="PartyNumberTypeCode" type="xsd:string" minOccurs="0" />

</xsd:sequence>

</xsd:complexType>

</xsd:element>

</xsd:schema>

Regards,

Sarvesh

Former Member
0 Kudos

Hi,

I checked your XML and it's not correct also... Import it in ID and see that under Envelope, you have Header, Sender and Recipient but under Sender and Recipient there is no PartyNumberId with it's elements. That's the problem.

What I eventually want to do is to add some header information and a complete IDOC in the body. But when I use refrences the elements are not found.

Best regards,

Guido

Former Member
0 Kudos

The problem is indeed having two namespaces in one XSD and that's not possible. So I tried a XSLT mapping and it works now.