Axis webservice with type=“xsd:base64Binary”
-
06-09-2019 - |
Question
So i have a wsdl that defines a message part like the following
<wsdl:message name="processEnvelopeResponse">
<wsdl:part name="processEnvelopeReturn" type="xsd:base64Binary"/>
</wsdl:message>
This maps to a xsd, wich then imports other xsds and so on.
I have the following questions:
- How can i generate the Message part objects from the xsd
Ignore this one, i have found the answer, you can do this as long as you import the xsd into the wsdl file. Will explain better later on
- How can i generate the client side objects in a way that allows me to directly fill the message objects and pass it over the wire
- How do i call the webservice, transforming the generated objects in to base64Binary (this one assumes the above is not possible)
Solution
So answering my own question, i was able to generate the artifacts to call the webservice from the list of xsd's, but i was unable to use them when calling the webservice.
So i ended up having to generate the XML by hand, lucky was i that this was a small call.
String input="XML";
byte[] s = port.processEnvelope(input.getBytes());
And since the response came in xsd:base64Binary too i had to map the incoming string into xml objects in order to process the response.
String xmloutput = new String(s,"UTF-8");
I then put xmloutput through jdom i got my data.
all in all a stupid way to implement a webservice.