Win a copy of Pro Spring MVC with WebFlux: Web Development in Spring Framework 5 and Spring Boot 2 this week in the Spring forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Jeanne Boyarsky
  • Liutauras Vilda
Sheriffs:
  • Rob Spoor
  • Bear Bibeault
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Piet Souris
Bartenders:
  • Frits Walraven
  • Himai Minh

Axis 1.4 Client .NET Webservice: serializable dictionaries

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Are you here to take over the surface world? Because this tiny ad will stop you!
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
reply
    Bookmark Topic Watch Topic
  • New Topic