Solved

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

Posted on 2013-01-20
9
943 Views
Last Modified: 2013-01-25
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
Comment
Question by:duzao7667
9 Comments
 
LVL 6

Accepted Solution

by:
yats earned 500 total points
ID: 38800042
0
 
LVL 16

Expert Comment

by:Valeri
ID: 38800197
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
 
LVL 12

Expert Comment

by:Sharon Seth
ID: 38800670
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
 

Author Comment

by:duzao7667
ID: 38800861
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
What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

 
LVL 16

Expert Comment

by:Valeri
ID: 38801183
0
 

Author Comment

by:duzao7667
ID: 38801385
No binary token on it...

This is what i need to implement via code:
soapUI GUI
0
 

Author Comment

by:duzao7667
ID: 38803995
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
 
LVL 16

Expert Comment

by:Valeri
ID: 38806289
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
 

Author Comment

by:duzao7667
ID: 38807925
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

Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

Join & Write a Comment

Introduction In my previous article (http://www.experts-exchange.com/Microsoft/Development/MS-SQL-Server/SSIS/A_9150-Loading-XML-Using-SSIS.html) I showed you how the XML Source component can be used to load XML files into a SQL Server database, us…
To properly understand GitHub, let’s divide it into two words ‘Git’ and ‘Hub’. Git is basically a ‘Distribution Version Control’ (DVC) and ‘Source Code Management’ (SCM) system widely used by software programmers while Hub means the efficient centre…
Viewers will learn about arithmetic and Boolean expressions in Java and the logical operators used to create Boolean expressions. We will cover the symbols used for arithmetic expressions and define each logical operator and how to use them in Boole…
The purpose of this video is to demonstrate how to set up the WordPress backend so that each page automatically generates a Mailchimp signup form in the sidebar. This will be demonstrated using a Windows 8 PC. Tools Used are Photoshop, Awesome…

760 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now