Expiring Today—Celebrate National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

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

Posted on 2013-01-20
9
Medium Priority
?
1,199 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
9 Comments
 
LVL 6

Accepted Solution

by:
yats earned 1500 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
More Than Just A Video Library

Train for your certification. Learn the latest DevOps tools. Grow your skillset to do better work.

At Linux Academy, we release new training modules every week so you'll always be up to date on the latest tech.

 

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
 
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

[Webinar] Lessons on Recovering from Petya

Skyport is working hard to help customers recover from recent attacks, like the Petya worm. This work has brought to light some important lessons. New malware attacks like this can take down your entire environment. Learn from others mistakes on how to prevent Petya like worms.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The Confluence of Individual Knowledge and the Collective Intelligence At this writing (summer 2013) the term API (http://dictionary.reference.com/browse/API?s=t) has made its way into the popular lexicon of the English language.  A few years ago, …
In this post we will learn how to connect and configure Android Device (Smartphone etc.) with Android Studio. After that we will run a simple Hello World Program.
Viewers learn about the “for” loop and how it works in Java. By comparing it to the while loop learned before, viewers can make the transition easily. You will learn about the formatting of the for loop as we write a program that prints even numbers…
This tutorial covers a step-by-step guide to install VisualVM launcher in eclipse.
Suggested Courses

718 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