After importing a WSDL with XSD files I have a problem with namespaces.
The Meta.xsd file has targetNamespace = "http://www.openapplications.org/oagis/9"
A field is missing in Web Service Adapter:
<_wcf:BusinessContext>
<_wcf:ContextData name="storeId">10051</_wcf:ContextData>
</_wcf:BusinessContext>
_wcf is Namespace "http://www.ibm.com/xmlns/prod/commerce/9/foundation"
BusinessContext and ContextData should have the _wcf-Namespace.
I've added the BusinessContext element to the file Meta.xsd:
<xsd:element name="BusinessContext" type="bc:BusinessContextType">
<xsd:annotation>
<xsd:documentation source="http://www.ibm.com/xmlns/prod/commerce/9/foundation">
</xsd:documentation>
</xsd:annotation>
</xsd:element>
However, BusinessContext gets the targetNamespace of Meta.xsd ("http://www.openapplications.org/oagis/9"). Calling the Web Service Adapter with the BusinessContext having the targetNamespace results in a Soap Fault.
Solution is: Redefining the namespace of Business Context before calling the web service adapter or in the request document, but All fields are read-only, so I can not customize the namespace!
Another solution: Configure the Meta.xsd, as Business Context that gets the namespace "http://www.ibm.com/xmlns/prod/commerce/9/foundation", but I do not know how I can assign one element to another namespace while the attribute targetNamespace is set.
Please help me with one of the two solutions, so that the Call works.
Customizing Web Service Soap-Request
Moderators: Jon, Steve, Ian, Dave
-
- Ebase User
- Posts: 9
- Joined: Thu Nov 28, 2013 1:53 pm
- Location: Germany
-
- Ebase User
- Posts: 9
- Joined: Thu Nov 28, 2013 1:53 pm
- Location: Germany
The above Meta.xsd is imported within the CommerceFoundation.xsd. Within the CommerceFoundation.xsd, the BusinessContext element is added to the ApplicationArea, as BusinessContext belongs to a different namespace.
Excerpt from Meta.xsd:
Excerpt from CommerceFoundation.xsd:
Given this code, Ebase does not include the BusinessContext to the ApplicationArea. Is there a way to correctly import this WSDL? Or to change the namespace of document-elements after importing? What a change I have to make to the XSD files to make it work?
Excerpt from Meta.xsd:
Code: Select all
<?xml version="1.0" encoding="UTF-8"?>
<xsd:schema xmlns="http://www.openapplications.org/oagis/9"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:_wcf="http://www.ibm.com/xmlns/prod/commerce/9/foundation"
attributeFormDefault="unqualified"
elementFormDefault="qualified"
targetNamespace="http://www.openapplications.org/oagis/9">
<xsd:include schemaLocation="Fields.xsd"/>
<xsd:complexType name="BusinessObjectDocumentType">
<xsd:annotation>
<xsd:documentation>Is the schema based inheritance for all BODs. The logical model would also include the DataArea.</xsd:documentation>
</xsd:annotation>
<xsd:sequence>
<xsd:element ref="ApplicationArea"/>
</xsd:sequence>
<xsd:attribute name="releaseID" type="NormalizedStringType" use="required">
<xsd:annotation>
<xsd:documentation>OAGIS Release this BOD Instances belongs or the OAGIS release that the derivative work is based on.</xsd:documentation>
</xsd:annotation>
</xsd:attribute>
<xsd:attribute name="versionID" type="NormalizedStringType" use="optional">
<xsd:annotation>
<xsd:documentation source="http://www.openapplications.org/oagis/9">Indicates the version of the given BOD defintion.</xsd:documentation>
</xsd:annotation>
</xsd:attribute>
<xsd:attribute default="Production" name="systemEnvironmentCode" type="SystemEnvironmentCodeContentType" use="optional">
<xsd:annotation>
<xsd:documentation source="http://www.openapplications.org/oagis/9">Indicates whether this BOD is being sent in a "Test" or a "Production" mode. If the BOD is being sent in a test mode, it's information should not affect the business operation. However, if the BOD is sent in "Production" mode it is assumed that all test has been complete and the contents of the BOD are to affect the operation of the receiving business application(s).</xsd:documentation>
</xsd:annotation>
</xsd:attribute>
<xsd:attribute default="en-US" name="languageCode" type="LanguageCodeType" use="optional">
<xsd:annotation>
<xsd:documentation source="http://www.openapplications.org/oagis/9">Indicates the language that the contents of the BOD is in unless otherwise stated.</xsd:documentation>
</xsd:annotation>
</xsd:attribute>
</xsd:complexType>
<xsd:complexType name="ApplicationAreaType">
<xsd:sequence>
<xsd:element minOccurs="0" ref="Sender"/>
<xsd:element ref="CreationDateTime"/>
<xsd:element minOccurs="0" ref="Signature"/>
<xsd:element minOccurs="0" ref="BODID"/>
<xsd:element minOccurs="0" ref="UserArea"/>
</xsd:sequence>
</xsd:complexType>
<xsd:complexType name="SenderType">
<xsd:annotation>
<xsd:documentation>Identifies the sender of the given BOD instance</xsd:documentation>
</xsd:annotation>
<xsd:sequence>
<xsd:element minOccurs="0" ref="LogicalID"/>
<xsd:element minOccurs="0" ref="ComponentID"/>
<xsd:element minOccurs="0" ref="TaskID"/>
<xsd:element minOccurs="0" ref="ReferenceID"/>
<xsd:element minOccurs="0" ref="ConfirmationCode"/>
<xsd:element minOccurs="0" ref="AuthorizationID"/>
</xsd:sequence>
</xsd:complexType>
Excerpt from CommerceFoundation.xsd:
Code: Select all
<schema xmlns="http://www.w3.org/2001/XMLSchema" xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore"
xmlns:oa="http://www.openapplications.org/oagis/9"
xmlns:_wcf="http://www.ibm.com/xmlns/prod/commerce/9/foundation"
targetNamespace="http://www.ibm.com/xmlns/prod/commerce/9/foundation" elementFormDefault="qualified"
attributeFormDefault="unqualified" ecore:nsPrefix="_wcf"
ecore:package="com.ibm.commerce.foundation.common.datatypes">
<annotation>
<documentation>
This XML schema file defines the elements and types used by foundation.
</documentation>
</annotation>
<import namespace="http://www.openapplications.org/oagis/9"
schemaLocation="../../../../../Resources/Components/Common/Meta.xsd" />
<complexType name="ApplicationAreaType">
<annotation>
<documentation>
Type definition of the application area of a business object document.
</documentation>
</annotation>
<complexContent>
<extension base="oa:ApplicationAreaType">
<sequence>
<element maxOccurs="1" minOccurs="1" ref="_wcf:BusinessContext">
<annotation>
<documentation>The business context.</documentation>
</annotation>
</element>
</sequence>
</extension>
</complexContent>
</complexType>
<element name="ApplicationArea" type="_wcf:ApplicationAreaType"
substitutionGroup="oa:ApplicationArea">
<annotation>
<documentation>
Element definition of the application area of a business object document. A
substitution for the OAGIS application area.
</documentation>
</annotation>
</element>
0 x
-
- Moderator
- Posts: 421
- Joined: Fri Sep 07, 2007 3:44 pm
- Location: Sandy, UK
- Contact:
Hi Sebastian,
In the Web Service Resource, under the Advanced node in the tree (documents, adapters, Advanced), there is a schema node. You can expand this and make any adjustments required in the XSD's. These are where all the XSD's are read for the request and response documents.
If you find you are missing an XSD, you can just simply add a new schema (The names does not matter), and copy off the XSD code in there. Be aware that duplicate targetNamepsace's can cause errors.
If you look at the ProcessPerson WS you have created before, you can see where all the XSD's are included and related to one-another.
Kind regards
Steve Upton
In the Web Service Resource, under the Advanced node in the tree (documents, adapters, Advanced), there is a schema node. You can expand this and make any adjustments required in the XSD's. These are where all the XSD's are read for the request and response documents.
If you find you are missing an XSD, you can just simply add a new schema (The names does not matter), and copy off the XSD code in there. Be aware that duplicate targetNamepsace's can cause errors.
If you look at the ProcessPerson WS you have created before, you can see where all the XSD's are included and related to one-another.
Kind regards
Steve Upton
0 x
Who is online
Users browsing this forum: No registered users and 4 guests