WLS 8.1 SP2 - Generated SOAP request contains unwanted xsi:type - CR218071 (Doc ID 776395.1)

Last updated on NOVEMBER 05, 2016

Applies to:

Oracle Weblogic Server
Information in this document applies to any platform.
Information in this document applies to any platform

Goal

DESCRIPTION:
The generated SOAP request populates an xsi:type token as shown here:

<n4:FilterableEventFields
xsi:type="n4:FilterableEventFields"><n4:NameValue><n4:Name>NAME_0</n4:Name><n4:Value&
gt;VALUE_0</n4:Value></n4:NameValue><n4:NameValue><n4:Name>NAME_1</n4:Name><n4:Value&g
t;VALUE_1</n4:Value></n4:NameValue></n4:FilterableEventFields>

The following is a run down of the test results when invoking a WebLogic Workshop Web service from a standalone WLS
stubs-based client. Note that the SOAP request populates xsi:type for FilterableEventFields. 

WLS classpath for the client has CR131821, CR130300 besides the WLS JAR files. 
And on the server side the following is the classpath:

java.class.path =
c:\temp\bea-support\CR131821_812.jar;c:\temp\bea-support\CR130300_810sp2.jar;c:\temp\bea-support\CR214003_81sp3.jar;c:\
bea812\WEBLOG~1\server\lib\weblogic_knex_patch.jar;c:\bea812\WEBLOG~1\common\lib\log4j.jar;c:\bea812\WEBLOG~1\server\li
b\debugging.jar;c:\bea812\WEBLOG~1\server\lib\knex.jar;c:\bea812\WEBLOG~1\javelin\lib\javelin.jar;c:\bea812\WEBLOG~1\se
rver\lib\wlw-lang.jar;c:\bea812\JDK141~1\lib\tools.jar;c:\bea812\WEBLOG~1\server\lib\weblogic_sp.jar;c:\bea812\WEBLOG~1
\server\lib\weblogic.jar;c:\bea812\WEBLOG~1\server\lib\ojdbc14.jar;c:\bea812\WEBLOG~1\server\lib\ant\ant.jar;c:\bea812\
JDK141~1\jre\lib\rt.jar;;c:\bea812\WEBLOG~1\common\eval\pointbase\lib\pbserver44.jar;c:\bea812\WEBLOG~1\common\eval\poi
ntbase\lib\pbclient44.jar;c:\bea812\WEBLOG~1\server\lib\webserviceclient.jar;c:\bea812\WEBLOG~1\server\lib\webservicecl
ient+ssl.jar;c:\bea812\WEBLOG~1\server\lib\xbean.jar;c:\bea812\WEBLOG~1\server\lib\wlxbean.jar;c:\bea812\WEBLOG~1\serve
r\lib\xqrl.jar;c:\bea812\WEBLOG~1\server\lib\netui\netui-compiler.jar;c:\bea812\WEBLOG~1\server\lib\wli.jar;c:\bea812\W
EBLOG~1\server\lib\fop.jar;c:\bea812\WEBLOG~1\integration\adapters\sample\lib\sample-eis.jar;

C:\bea812\user_projects\src\Case567285>java -cp
c:\temp\bea-support\CR131821_812.jar;c:\temp\bea-support\CR130300_810sp2.jar;%classpath%;.;.\build
-Dweblogic.webservice.verbose=true Client http://localhost:7001/Subscriber/GenericEventListener.jws?WSDL=
<!-------------------- REQUEST ---------------->
URL        :  http://server:7001/Subscriber/GenericEventListener.jwsHeaders    :
  SOAPAction: ["http://edb.company.com/wsdl/listener/v1/Notify"]
  Content-Type: [text/xml]

<env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"><env:Header/><env:Body><n1:Notify
xmlns:n1="http://edb.company.com/wsdl/listener/v1"><n2:Notify
xmlns:n2="http://edb.company.com/Listener/v1"><n3:WSHeader
xmlns:n3="http://cio.company.com/CommonHeader/v2"><n3:WSCredentials><n3:UserName>name</n3:U
serName><n3:Token>name123</n3:Token></n3:WSCredentials></n3:WSHeader><n4:GenericEvent
xmlns:n4="http://edb.company.com/Events/v1"><n4:EventHeader><n4:EventNameSpace>http://edb.comp
any.com/address</n4:EventNameSpace><n4:EventName>address</n4:EventName><n4:InstanceID><n4:Ev
entDomain>My Dummy
Domain</n4:EventDomain><n4:DomainSequenceNumber>1</n4:DomainSequenceNumber><n4:EventTimestamp>2
005-03-18T11:13:51.105-05:00</n4:EventTimestamp></n4:InstanceID><n4:Priority>9</n4:Priority><
;n4:Receipts>false</n4:Receipts></n4:EventHeader><n4:FilterableEventFields
xsi:type="n4:FilterableEventFields"><n4:NameValue><n4:Name>NAME_0</n4:Name><n4:Value&
gt;VALUE_0</n4:Value></n4:NameValue><n4:NameValue><n4:Name>NAME_1</n4:Name><n4:Value&g
t;VALUE_1</n4:Value></n4:NameValue></n4:FilterableEventFields><n4:EventXML>&lt;?xml
version="1.0" encoding="UTF-8"?><!-- edited with XML Spy v4.4 U
(http://www.xmlspy.com) by Name (Company) --&gt;&lt;!--Sample XML file generated by XML Spy v4.4 U
(http://www.xmlspy.com)--&gt;&lt;Address xmlns="http://dbor.cif.company.com/test"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="C:\PubSub\address.xsd"><Name>Name</Name><Addres
s1&gt;Number,
Street&lt;/Address1&gt;&lt;City&gt;City&lt;/City&gt;&lt;State&gt;State&lt;/State&am
p;gt;&lt;Zip&gt;12345&lt;/Zip&gt;&lt;/Address&gt;</n4:EventXML></n4:GenericEvent>&l
t;/n2:Notify></n1:Notify></env:Body></env:Envelope>
<!-------------------- END REQUEST ------------>
<!-------------------- RESPONSE --------------->
URL           : http://server:7001/Subscriber/GenericEventListener.jws
Response Code :200
Headers       :
  Date=Fri, 18 Mar 2005 16:13:51 GMT
  Pragma=no-cache
  Server=WebLogic Server 8.1 SP2 Fri Dec 5 15:01:51 PST 2003 316284 WebLogic Server 8.1 SP2 Fri Dec 5 15:01:51 PST
2003 316284 WebLogic Server 8.1 SP2 Fri Dec 5 15:01:51 PST 2003 316284 with CR131821 CR130300
  Content-Length=635
  Content-Type=text/xml; charset=UTF-8
  Expires=Thu, 01 Jan 1970 00:00:00 GMT
  Cache-Control=no-cache
Envelope   :
<?xml version="1.0" encoding="utf-8"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xm
lns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org
/2001/XMLSchema">
  <SOAP-ENV:Body>
<ns:NotifyResponse xmlns:ns='http://edb.company.com/wsdl/listener/v1'><v1:NotifyResponse
xmlns:v1='http://edb.company.com/Listener/v1'><v2:WSMessageData
xmlns:v2='http://cio.company.com/CommonHeader/v2'><v2:RefToMessageId>Test
Response</v2:RefToMessageId><v2:Timestamp>2005-03-18T11:13:51.425-05:00</v2:Timestamp></v2:WSMessa
geData>
</v1:NotifyResponse></ns:NotifyResponse>  </SOAP-ENV:Body>
</SOAP-ENV:Envelope>

<!-------------------- END RESPONSE ----------->
NotifyResponse{ wSMessageData=<WSMessageData{ messageId=<null> refToMessageId=<Test Response>
timestamp=<java.util.GregorianCalendar[time=1111162431425,areFieldsSet=false,areAllFieldsSet=false,lenient=true,zone
=sun.util.calendar.ZoneInfo[id
="GMT-05:00",offset=-18000000,dstSavings=0,useDaylight=false,transitions=0,lastRule=null],firstDayOfWeek=1,mi
nimalDaysInFirstWeek=1,ERA=1,YEAR=2005,MONTH=2,WEEK_OF_YEAR=?,WEEK_OF_MONTH=?,DAY_OF_MONTH=18,DAY_OF_YEAR=?,DAY_OF_WEEK
=?,DAY_OF_WEEK_IN_MONTH=?,AM_PM=?,HOUR=?,HOUR_OF_DAY=11,MINUTE=13,SECOND=51,MILLISECOND=425,ZONE_OFFSET=?,DST_OFFSET=?]
> }> }

In the schema (Events.xsd) the following is defined for "FilterableEventFields":

<xsd:schema xmlns:ch="http://cio.company.com/CommonHeader/v2"
xmlns:e="http://edb.company.com/Events/v1" xmlns:xsd="http://www.w3.org/2001/XMLSchema"
targetNamespace="http://edb.company.com/Events/v1" elementFormDefault="qualified"
attributeFormDefault="unqualified">
	<xsd:import namespace="http://cio.company.com/CommonHeader/v2"
schemaLocation="CommonHeaderV2.xsd"/>
	<xsd:element name="EventHeader">
		<xsd:complexType>
			<xsd:sequence>
				<xsd:element name="EventNameSpace" type="xsd:string"/>
				<xsd:element name="EventName" type="xsd:string"/>
				<xsd:element name="InstanceID" minOccurs="0">
					<xsd:complexType>
						<xsd:sequence>
							<xsd:annotation>
								<xsd:documentation>
									EventDomain enables subsetting events of a given event
									type.  Domain subsets can be anything that makes sense.  
								</xsd:documentation>
							</xsd:annotation>
							<xsd:element name="EventDomain" type="xsd:string" minOccurs="0"/>
							<xsd:element name="DomainSequenceNumber" type="xsd:long" minOccurs="0"/>
							<xsd:element name="EventTimestamp" type="xsd:dateTime" minOccurs="0"/>
						</xsd:sequence>
					</xsd:complexType>
				</xsd:element>
				<xsd:element name="Priority" type="xsd:int" minOccurs="0"/>
				<xsd:element name="Expiry" type="xsd:dateTime" minOccurs="0"/>
				<xsd:element name="Receipts" type="xsd:boolean" minOccurs="0"/>
			</xsd:sequence>
		</xsd:complexType>
	</xsd:element>
	<xsd:element name="EventXML" type="xsd:string"/>
	<xsd:element name="FilterableEventFields">
		<xsd:complexType>
			<xsd:sequence>
				<xsd:element name="NameValue" minOccurs="0" maxOccurs="unbounded">
					<xsd:complexType>
						<xsd:sequence>
							<xsd:element name="Name" type="xsd:string"/>
							<xsd:element name="Value" type="xsd:string"/>
						</xsd:sequence>
					</xsd:complexType>
				</xsd:element>
			</xsd:sequence>
		</xsd:complexType>
	</xsd:element>

where FilterableEventFields is defined as a complexType containing a sequence of an element, which is an array of
complexType.

NOTE:
a) The WebLogic Workshop Test Browser generated SOAP request does bit populate xsi:type. Only WLS WS does this.

b) Axis client does not exhibit this issue either, as can be seen from the trace below:

POST http://localhost:7001/Subscriber/GenericEventListener.jws HTTP/1.0
Content-Type: text/xml; charset=utf-8
Accept: application/soap+xml, application/dime, multipart/related, text/*
User-Agent: Axis/1.2RC3
Host: localhost:7001
Cache-Control: no-cache
Pragma: no-cache
SOAPAction: "http://edb.company.com/wsdl/listener/v1/Notify"
Content-Length: 1949

<?xml version="1.0" encoding="UTF-8"?><soapenv:Envelope
xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><soapenv:Body><Notify
xmlns="http://edb.company.com/wsdl/listener/v1"><ns1:Notify
xmlns:ns1="http://edb.company.com/Listener/v1"><ns2:WSHeader
xmlns:ns2="http://cio.company.com/CommonHeader/v2"><ns2:WSCredentials><ns2:UserName>Name</n
s2:UserName><ns2:Token>Name</ns2:Token></ns2:WSCredentials></ns2:WSHeader><ns3:GenericEve
nt
xmlns:ns3="http://edb.company.com/Events/v1"><ns3:EventHeader><ns3:EventNameSpace>http://edb.c
ompany.com/address</ns3:EventNameSpace><ns3:EventName>address</ns3:EventName><ns3:InstanceID>&l
t;ns3:EventDomain>string</ns3:EventDomain><ns3:DomainSequenceNumber>10</ns3:DomainSequenceNumber>&
lt;ns3:EventTimestamp>2014-09-19T03:18:33.000Z</ns3:EventTimestamp></ns3:InstanceID><ns3:Priority>
3</ns3:Priority><ns3:Receipts>false</ns3:Receipts></ns3:EventHeader><ns3:FilterableEventFiel
ds><ns3:NameValue><ns3:Name>SOMENAME</ns3:Name><ns3:Value>SOMEVALUE</ns3:Value></ns
3:NameValue><ns3:NameValue><ns3:Name>SOMENAME1</ns3:Name><ns3:Value>SOMEVALUE1</ns3:Value
></ns3:NameValue></ns3:FilterableEventFields><ns3:EventXML>&lt;?xml
version="1.0" encoding="UTF-8"?>
&lt;!-- edited with XML Spy v4.4 U (http://www.xmlspy.com) by Name --&gt;
&lt;!--Sample XML file generated by XML Spy v4.4 U (http://www.xmlspy.com)--&gt;
&lt;Address xmlns="http://dbor.cif.company.com/test"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="C:\PubSub\address.xsd">
	&lt;Name&gt;Name&lt;/Name&gt;
	&lt;Address1&gt;Address&lt;/Address1&gt;
	&lt;City&gt;City&lt;/City&gt;
	&lt;State&gt;State&lt;/State&gt;
	&lt;Zip&gt;12345&lt;/Zip&gt;
&lt;/Address&gt;</ns3:EventXML></ns3:GenericEvent></ns1:Notify></Notify></soapenv:Bo
dy></soapenv:Envelope>

c) Between WebLogic client and server the presence of xsi:type does not seem to pose any problems. However, the
customer's concerns are as follows:

c.1) When WebLogic Workshop does not generate this, then why does WLS do it? They, however, understand that WLS and
WLW are different SOAP stacks so this behaviour is possibly a result of this. They do not want to use Axis client as
they want to keep WLS as the standard. 

c.2) They follow a publish - subscibe model, where the messages published would be coming from the Web service client
while the subscribers of these messages would be serving as Web service endpoints. Now their concern is that these
subscribers could be implemented by non-WebLogic SOAP vendors such as .Net, Axis or WebSphere, and in that case they
suspect that this xsi:type in the WLS-generated SOAP request could be rejected or the server might fail to process
this properly.

d) The following workarounds have been discussed :

d.1) Immediately they can use Axis client; however, that means they would be jettisoning their policy of standardising
on WebLogic across the board.

d.1) Modifying the XSD is not much of an option as that would cause quite a ripple in their practice.

c.3) Use of client-side message handlers is another option, and they are looking into it.

Solution

Sign In with your My Oracle Support account

Don't have a My Oracle Support account? Click to get started

My Oracle Support provides customers with access to over a
Million Knowledge Articles and hundreds of Community platforms