Skip to Main Content

Java EE (Java Enterprise Edition) General Discussion

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Interested in getting your voice heard by members of the Developer Marketing team at Oracle? Check out this post for AppDev or this post for AI focus group information.

How can I change namespace prefix for JAX-RPC client request?

WP v.2Nov 21 2013 — edited Dec 5 2013

I'm creating a JAX-RPC client to invoke a RPC/encoded web service. The service was generated from a ColdFusion program and for some reason when the SOAP namespace prefix is anything but "soapenv" it returns text/html instead of text/xml. Currently the client is sending requests with the prefix "env" and I'd like to change it to "soapenv".

I created a type of javax.xml.rpc.handler.GenericHandler and attempted to do the follow:

@Override public boolean handleRequest(MessageContext p1) {

SOAPMessage msg = ((SOAPMessageContext) p1).getMessage();


try {

SOAPPart part = msg.getSOAPPart();

SOAPEnvelope envelope = part.getEnvelope();

envelope.setPrefix("soapenv");

msg.saveChanges();

} catch(SOAPException ex) {

// TODO

return false;

}


return true;

}

However I get the following exception:

java.rmi.RemoteException: SOAPFaultException - FaultCode [{http://schemas.xmlsoap.org/soap/envelope/}Server] FaultString [UNIMPLEMENTED ] FaultActor [null] Detail [<detail><bea_fault:stacktrace xmlns:bea_fault="http://www.bea.com/servers/wls70/webservice/fault/1.0.0">java.lang.AssertionError: UNIMPLEMENTED

at weblogic.xml.domimpl.NodeImpl.setPrefix(NodeImpl.java:173)

at test.MyHandler.handleRequest(MyHandler.java:33)

at weblogic.wsee.handler.JaxrpcHandlerChain.handleRequest(JaxrpcHandlerChain.java:58)

at weblogic.wsee.ws.dispatch.server.JaxrpcChainHandler.handleRequest(JaxrpcChainHandler.java:102)

at weblogic.wsee.handler.HandlerIterator.handleRequest(HandlerIterator.java:141)

at weblogic.wsee.handler.HandlerIterator.handleRequest(HandlerIterator.java:107)

at weblogic.wsee.ws.dispatch.client.ClientDispatcher.dispatch(ClientDispatcher.java:132)

at weblogic.wsee.ws.WsStub.invoke(WsStub.java:87)

at weblogic.wsee.jaxrpc.StubImpl._invoke(StubImpl.java:341)

at test.Approvedsuppliers_Wrap_Stub.echo(Approvedsuppliers_Wrap_Stub.java:31)

at test.Approvedsuppliers_WrapPortClient.echo(Approvedsuppliers_WrapPortClient.java:130)

at test.Approvedsuppliers_WrapPortClient.main(Approvedsuppliers_WrapPortClient.java:43)

Is there any workaround? I appreciate any feedback.

Thanks, Bill

This post has been answered by WP v.2 on Dec 5 2013
Jump to Answer

Comments

Processing
Locked Post
New comments cannot be posted to this locked post.

Post Details

Locked on Jan 2 2014
Added on Nov 21 2013
2 comments
2,900 views