Solved

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

Posted on 2013-01-20
9
1,107 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 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
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

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

Revamp Your Training Process

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action.

Question has a verified solution.

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

New Relic recently released its Synthetics product that allows for the creation of performance monitors that periodically test a site's performance. If you wish to test an interactive workflow New Relic employs Selenium WebDriverJS to run those test…
I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
Viewers will learn one way to get user input in Java. Introduce the Scanner object: Declare the variable that stores the user input: An example prompting the user for input: Methods you need to invoke in order to properly get  user input:
This tutorial covers a step-by-step guide to install VisualVM launcher in eclipse.

729 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