• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1489
  • Last Modified:

How do i get the Soap XML from a Axis webservice serializable object

Hi all,

I've created axis classes from WSDL using axis 1.4 (v1) WSDL2Java and i dont know how to marshal the populated and instatiated object (Wich i send to the WS).

Using JAX-WS i only use the JAXBContext.createMarshal(), but i dont know how to do it using the axis api and the java.io.Serializable  implemented classes generated by WSDL2Java.

Any ideas??
0
duzao7667
Asked:
duzao7667
1 Solution
 
yatsCommented:
0
 
ValeriCommented:
Why you need this? if you have created your client stub already (by using wsdl2java ) then just invoke the respective web service. The serialization that you are interested in is hidden from axis implementation - just invoke the service and the stub will use the created classes.
if you need more information about serialization, then read this:
http://axis.apache.org/axis/java/user-guide.html#XMLJavaDataMappingInAxis
0
 
Sharon SethCommented:
If you have a SOAPInput already , then invoke the service using the client as follows:

QName serviceQname = new QName(WS_NAMESPACE, WS_SERVICE_NAME);
Service service = new Service();
Call call = (Call)service.createCall();
call.setTargetEndpointAddress(WS_WSDL_URL);
call.setOperationName(serviceQname);
call.setProperty(Call.SOAPACTION_USE_PROPERTY,Boolean.TRUE);
System.out.println("Invoking webservice ...");
response = call.invoke(request);

Open in new window

0
Cloud Class® Course: Python 3 Fundamentals

This course will teach participants about installing and configuring Python, syntax, importing, statements, types, strings, booleans, files, lists, tuples, comprehensions, functions, and classes.

 
duzao7667Author Commented:
Thats not the case... i need to get the XML because i need to add a complex and custom WS-Security header (icl. BinarySecurityToken, transforms, SHA1 digest and c14n canonicalization), wich i only have it using w3c DOM:

DocumentBuilder builder = factory.newDocumentBuilder();
Document doc = builder.parse(new File(theXML));

Open in new window

0
 
ValeriCommented:
0
 
duzao7667Author Commented:
No binary token on it...

This is what i need to implement via code:
soapUI GUI
0
 
duzao7667Author Commented:
look, i only want to insert the binary token, the digest in the soap header and i cant find in any place in the world a solution to integrate axis 1.4 generated files with the wss4j ... mother of god i dont even know how i configure the WSSecurity to imitate the auth above in the soapUI image.
0
 
ValeriCommented:
There is a possibility: Search for some good tutorial "how to integrate axis 1.4 and wss4j"
for example something like that : http://ws.apache.org/wss4j/axis.html
and then add some item, it should be something like that:

<wsse:BinarySecurityToken wsu:Id='SomeCert'
          ValueType="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-x509-token-profile-1.0#X509v3"
          EncodingType="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-soap-message-security-1.0#Base64Binary">
          lui+Jy4WYKGJW5xM3aHnLxOpGVIpzSg4V486hHFe7sHET/uxxVBovT7JV1A2RnWSWkXm9jAEdsm/...
          </wsse:BinarySecurityToken>
0
 
duzao7667Author Commented:
exactly.
i googled it and other keywords and i only get unfinished posts, unclear explanations and wsdd XML implementation. I need to do it via code (because we have various types of keystorages - A1 and A3), and i need to get it dinamically.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now