Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

java.lang.IllegalArgumentException: No Serializer found to serialize a 'com.sun.xml.messaging.saaj.s

 
sarmi ghosh
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can anyone help me on this Please......
I am trying to use DOC-Literal Web service with WSIF tool .
Error as
------------
java.lang.IllegalArgumentException: No Serializer found to serialize a 'com.sun.xml.messaging.saaj.soap.impl.ElementImpl' using encoding style 'literal'.
----------------------------
--------------------------
Error Line
if (operation.executeRequestResponseOperation(input, output, fault))

Total Code
------------------
// get the service
WSIFService service = SOAPHelper.getWSIFService(SOAPHelper.TPAROLEAUTHORIZATION_SERVICE_NAME);
System.out.println("service="+service);
//Service service;//= SOAPHelper.getWSIFService(SOAPHelper.TPAROLEAUTHORIZATION_SERVICE_NAME);
//service.getPort(port, serviceEndpointInterface);
WSIFPort port = service.getPort();
System.out.println("port="+port);
WSIFOperation operation = port.createOperation("getUserTPAEntitlement");

// create the input, output and fault messages associated
// with this operation
WSIFMessage input = operation.createInputMessage();
WSIFMessage output = operation.createOutputMessage();
WSIFMessage fault = operation.createFaultMessage();

// input.setObjectPart("in0", inputBean);
SOAPFactory soapfactory = SOAPFactory.newInstance();
SOAPElement request = soapfactory.createElement("getUserTPAEntitlementElement", "ns0",
"http://localhost:8080/TPAHomeAuthorization/iws/ws/TPARoleAuthorizationService?wsdl");
SOAPElement nameChild = soapfactory.createElement("in0");
nameChild.addTextNode("inputBean");
request.addChildElement(nameChild);
input.setObjectPart("parameters", request);
System.out.println("Sarmi4");
if (operation.executeRequestResponseOperation(input, output, fault))
{
System.out.println("Sarmi5");
// Get the output
//returnVo = (BaseNetworkBean) output.getObjectPart("getPlanAuthorityReturn");
//returnCo = (Collection) output.getObjectPart("getUserTPAEntitlementReturn");
Object[] objects = (Object[]) output.getObjectPart("getUserTPAEntitlementReturn");
if (objects != null && objects.length > 0)
{
// Put into an array list
for (int i = 0; i < objects.length; i++)
{
results.add(objects[i]);
}
}

}
 
Ivan Krizsan
Ranch Hand
Posts: 2198
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi!
First of all, having had a quick look at the WSIF web site, I notice that it seems like nothing has happened for more than 6 years.
This leads me to suspect that there will be problems using this tool to invoke a Document/Literal web service.
I see that you are trying to use parts from SAAJ (which, I also suspect, may cause problems when used with WSIF) - how about skipping the WSIF part and using only SAAJ to invoke the web service?
If you want an example on how to issue web service requests using SAAJ, take a look at page 199 in my document: http://faq.javaranch.com/content/Exam-Objectives-5.pdf
Best wishes!
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic