Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1300
  • 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
2017 Webroot Threat Report

MSPs: Get the facts you need to protect your clients.
The 2017 Webroot Threat Report provides a uniquely insightful global view into the analysis and discoveries made by the Webroot® Threat Intelligence Platform to provide insights on key trends and risks as seen by our users.

 
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

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

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