This week's book giveaway is in the Java in General forum.
We're giving away four copies of Beginning Java 17 Fundamentals: Object-Oriented Programming in Java 17 and have ishori Sharan & Adam L Davis on-line!
See this thread for details.
Win a copy of Beginning Java 17 Fundamentals: Object-Oriented Programming in Java 17 this week in the Java in General forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • Ron McLeod
  • Liutauras Vilda
  • Jeanne Boyarsky
Sheriffs:
  • Junilu Lacar
  • Rob Spoor
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Tim Moores
  • Jesse Silverman
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Piet Souris
  • Frits Walraven

Encoding style not supported

 
Ranch Hand
Posts: 82
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
I am using DII(jaxrpc1.0) to invoke a web service running at http://otn.oracle.com/ws/oracle.otn.ws.scott.OTNDeptEmp
wsdl file is available there.
Following are the exceptions I get.
encoding style: "http://xml.apache.org/xml-soap/literalxml" not supported
at com.sun.xml.rpc.client.dii.BasicCall.getRequestSerializer(BasicCall.java:379)
at com.sun.xml.rpc.client.dii.BasicCall.invoke(BasicCall.java:279)
at otndeptclient.main(otndeptclient.java:87)
Code to invoke web service is as below:

import javax.xml.rpc.Call;
import javax.xml.rpc.Service;
import javax.xml.rpc.JAXRPCException;
import javax.xml.namespace.QName;
import javax.xml.rpc.ServiceFactory;
import javax.xml.rpc.ParameterMode;
public class otndeptclient {
private static String qnameService = "OTNDeptEmp";
private static String qnamePort = "OTNDeptEmpPort";
private static String BODY_NAMESPACE_VALUE =
"http://otn.oracle.com/wstns/oracle/otn/ws/scott/OTNDeptEmp";
private static String ENCODING_STYLE_PROPERTY =
"javax.xml.rpc.encodingstyle.namespace.uri";
private static String NS_XSD =
"http://www.w3.org/2001/XMLSchema";
private static String URI_ENCODING =
"http://xml.apache.org/xml-soap/literalxml";
public static void main(String[] args) {
try {
String endpoint= "http://otn.oracle.com/ws/oracle.otn.ws.scott.OTNDeptEmp";
ServiceFactory factory = ServiceFactory.newInstance();
Service service =factory.createService(new QName(qnameService));
QName port = new QName(qnamePort);
Call call = service.createCall(port);
call.setTargetEndpointAddress(endpoint);
call.setProperty(Call.SOAPACTION_USE_PROPERTY,
new Boolean(true));
call.setProperty(Call.SOAPACTION_URI_PROPERTY, "");
call.setProperty(ENCODING_STYLE_PROPERTY, URI_ENCODING);
QName QNAME_TYPE_STRING = new QName(NS_XSD, "string");
call.setReturnType(QNAME_TYPE_STRING);
call.setOperationName(new QName(BODY_NAMESPACE_VALUE,
"getDeptXML"));
String[] params = { };
String result = (String)call.invoke(params);
System.out.println(result);
} catch (Exception ex) {
ex.printStackTrace();
}
}
}
How do I overcome this problem, please let me know.
Thanks,
-Amol
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic