• Post Reply Bookmark Topic Watch Topic
  • New Topic

Axis 1.4 Client .NET Webservice: serializable dictionaries

 
Bill Sykes
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello All,

I am using axis 1.4 to connect my java web client to a .NET webservice. The webservice uses serializable dictionaries data sets for certain parameters.

In my SOAP mesage, I am sending a structure called TradeHeader, which contains a parameter called AdditionalInformation - which is a serializable dictionary on the .NET web service side. The webservice generates a WSDL structure like this: (I won't post the whole WSDL just the hopefully relevant definitions):

<s:complexType name="TradeHeader">
<s:sequence>
...
<s:element minOccurs="0" maxOccurs="unbounded" name="AdditionalInformation">
<s:complexType>
<s:sequence>
<s:element ref="s:schema" />
<s:any />
</s:sequence>
</s:complexType>
</s:element>
...
</s:sequence>
</s:complexType>


When I use WSDL2Java to generate my client's stub, it creates odd java like this:

public class TradeHeaderAdditionalInformation implements java.io.Serializable, org.apache.axis.encoding.AnyContentType {
private org.apache.axis.message.MessageElement [] _any;

public TradeHeaderAdditionalInformation() {
}

public TradeHeaderAdditionalInformation (
org.apache.axis.message.MessageElement [] _any) {
this._any = _any;
}

public org.apache.axis.message.MessageElement [] get_any() {
return _any;
}

public void set_any(org.apache.axis.message.MessageElement [] _any) {
this._any = _any;
}

...
}


Now I need to be setting some name value pair in my stub class, so that the SOAP message I send resembles this for the AdditionalInformation parameter:

<TradeHeader>
...
<AdditionalInformation>
<Item>
<Key>Colour</Key>
<Value>Red</Value>
</Item>
</AdditionalInformation>
...
</TradeHeader>

My question is, is there a way of changing the WSDL, so that it gives me useful getter/setter methods for my AdditionalInformation class, instead of the "MessageElement[] any"? But obviously still sending the XML the service expects?

I've tried to persuade the webservice owner to use axis friendly data structures, but he is not keen to change his service.

Any thoughts of possible workarounds?

(I've hopefully posted relevant information - but let me know if you need more posted to help resolve)

Thanks in Advance,
Bill.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!