Search...
FAQs
Subscribe
Pie
FAQs
Recent topics
Flagged topics
Hot topics
Best topics
Search...
Search within Web Services
Search Coderanch
Advance search
Google search
Register / Login
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:
Campbell Ritchie
Jeanne Boyarsky
Ron McLeod
Paul Clapham
Liutauras Vilda
Sheriffs:
paul wheaton
Rob Spoor
Devaka Cooray
Saloon Keepers:
Stephan van Hulst
Tim Holloway
Carey Brown
Frits Walraven
Tim Moores
Bartenders:
Mikalai Zaikin
Forum:
Web Services
AXIS 2 - org.apache.axis2.AxisFault: Server was unable to process request
Asif Usman
Greenhorn
Posts: 12
posted 11 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
Hi,
I am ne bee to web service and trying to invoke a web service (URL given by client) and i am getting following error.
Environment
java
- Java 1.7
Axis - Axis2
Here is my code
MyStub stub=new MyStub(); MyRequest req=new MyRequest(); // setting re parameters MyStub.MyViolations mv= new MyViolations (); OMFactory omFactory = OMAbstractFactory.getOMFactory(); OMElement omSecurityElement = omFactory.createOMElement(new QName( "http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd", "Security", "wsse"), null); OMElement omusertoken = omFactory.createOMElement(new QName("http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd", "UsernameToken", "wsu"), null); OMElement omuserName = omFactory.createOMElement(new QName("", "UsernameToken", "wsse"), null); omuserName.setText("myUsername"); OMElement omPassword = omFactory.createOMElement(new QName("", "Password", "wsse"), null); omPassword.addAttribute("Type","http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordText",null ); omPassword.setText("mypassword"); omusertoken.addChild(omuserName); omusertoken.addChild(omPassword); omSecurityElement.addChild(omusertoken); stub._getServiceClient().addHeader(omSecurityElement); // adding request to my violations mv.setRequest(req); try { MyViolationResponse res= stub.myMethoName(dv).getMyViolationResult(); System.out.println(": res " + res.getDayOffViolations()); } catch (RemoteException e1) { // TODO Auto-generated catch block e1.printStackTrace(); }
and below is exception i am getting..
org.apache.axis2.AxisFault: Server was unable to process request. ---> Unable to cast object of type 'Microsoft.Web.Services3.Security.Tokens.IssuedToken' to type 'Microsoft.Web.Services3.Security.Tokens.UsernameToken'. at org.apache.axis2.util.Utils.getInboundFaultFromMessageContext(Utils.java:531) at org.apache.axis2.description.OutInAxisOperationClient.handleResponse(OutInAxisOperation.java:375) at org.apache.axis2.description.OutInAxisOperationClient.send(OutInAxisOperation.java:421) at org.apache.axis2.description.OutInAxisOperationClient.executeImpl(OutInAxisOperation.java:229) at org.apache.axis2.client.OperationClient.execute(OperationClient.java:165) at com.qualcomm.www.DriverStub.driverViolations(DriverStub.java:3494) at com.test.Test.main(Test.java:72)
Can any one of you help me to resolve this issue.
Thanks in advance,
Asif
Vijitha Kumara
Bartender
Posts: 4116
72
I like...
posted 11 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
It'd be helpful if you can explain the design you are using here and which part of it (and when) causes this issue (and perhaps environment, any other libraries involved).
SCJP 5 | SCWCD 5
[
How to ask questions
] [
Twitter
]
These are the worst of times and these are the best of times. And this is the best tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
reply
Bookmark Topic
Watch Topic
New Topic
Boost this thread!
Similar Threads
HeaderElements must be namespace qualified when create soap client
WSSecurity headers programmatically
Error in Soap Response while implementing ws-security using Metro
Axis2 and mustUnderstand
CXF, WSDL, and SecurityPolicy problems with "None of the policy alternatives can be satisfied."
More...