Java client accessing .NET web service interoperablility

  • Thread starter Thread starter Paul Hutchinson
  • Start date Start date
P

Paul Hutchinson

All,

I wonder if anyone can help/advise with the following interoperability
issue we are encountering?

We have a .NET web service that takes an abstract type as parameter.
Using it from a .net client works OK. However calling the method from
a java client (Websphere 5.0) we see the following error being thrown
on the call to the method.

System.InvalidOperationException: There is an error in XML document
(4, 94).
System.InvalidOperationException: The specified type is abstract:
name=Key


The method signature is as follows:

public string GetData(Key key)

....where Key is an abstract class.



Using the SOAP Trace utility I can see that the messages being sent
are different:

From .NET client:

<?xml version="1.0"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsi="http://www.w3.org/2001/XMLSchemainstance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<soap:Body>
<GetData xmlns="http://paulstest.com/webservices/gcs/PolicyService">
<key xsi:type="SectionKey">
<Transaction>38630</Transaction>
<Component>8</Component>
<MasterNumber>9092DM</MasterNumber>
<MasterSequence>001</MasterSequence>
<SectionSequence>10</SectionSequence>
<SectionType>FIR</SectionType>
<SubSectionType>BLD</SubSectionType>
</key>
</GetData>
</soap:Body>
</soap:Envelope>

From Java client:

<?xml version="1.0"?>
<SOAPENV:Envelope xmlns:SOAPENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsi="http://www.w3.org/2001/XMLSchemainstance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<SOAPENV:Body>
<Q1:GetData xmlns:Q1="http://paulstest.com/webservices/gcs/PolicyService">
<Q1:key>
<Q1:Transaction>38627</Q1:Transaction>
<Q1:Component>8</Q1:Component>
<Q1:Transaction>38627</Q1:Transaction>
<Q1:Component>8</Q1:Component>
<Q1:MasterNumber>9092DJ</Q1:MasterNumber>
<Q1:MasterSequence>001</Q1:MasterSequence>
<Q1:Transaction>38627</Q1:Transaction>
<Q1:Component>8</Q1:Component>
<Q1:MasterNumber>9092DJ</Q1:MasterNumber>
<Q1:MasterSequence>001</Q1:MasterSequence>
<Q1:Transaction>38627</Q1:Transaction>
<Q1:Component>8</Q1:Component>
<Q1:MasterNumber>9092DJ</Q1:MasterNumber>
<Q1:MasterSequence>001</Q1:MasterSequence>
<Q1:SectionSequence>10</Q1:SectionSequence>
<Q1:SectionType>FIR</Q1:SectionType>
<Q1:SubSectionType>BLD</Q1:SubSectionType>
</Q1:key>
</Q1:GetData>
</SOAPENV:Body>
</SOAPENV:Envelope>

I know that the Component and transaction parts of Key are duplicated
in the Java SOAP messages - but this happens for other messages that
do not use an abstract class and they work fine from Java client.

The main problem part that I can see is that the .NET client sends:

<key xsi:type="SectionKey">

but the Java client sends:

<Q1:key>

However, even if I manually insert the 'xsi:type="SectionKey"' in the
Java SOAP message I get:

System.InvalidOperationException: There is an error in XML document
(4, 94).
System.InvalidOperationException: The specified type was not
recognized: name='SectionKey'


I have also tried setting the WebMethod to be SOAPDocumentType Literal
and Encoded aswell as SOAPRPCMethod without any luck.

Any ideas??

Thanks,

Paul
 
Back
Top