All,
I've written a couple times about this problem. I'm not being pressed to
finish up a project where I was hoping to use ws-security for my xfire
services. I'm at my wits end with this. I've followed the ws-security
samples. My problem is on the client side. My service works great with
both a xfire and php client. Stuff goes bad once I try adding a
WSS4JOutHandler as client OutHandler. If I add this handler it breaks,
if I do not add it everything works great. I tried debugging the
problem but got a little lost in the xfire code. The namespaceURI value
of the service object has the correct value set before and after adding
the WSS4J handler when I was debugging. I think I was looking at the
correct varibles while debugging. If I wasn't what should I be looking
at?
I'm using xfire 1.2.4 and Spring 2.0. I do have my class that has the
client code and my service class wired up in spring. I have no idea if
this has anything to do with.
At this point I have no idea what's wrong. I'm I correct in thinking
the exception is about the Service Namespace I pass to the
objectServiceFactory?
If I can't get this to work is there anything I should know about
publishing xfire services over HTTPS?
Thanks,
deno
private final String SERVICE_NAMESPACE =
"http://oracle.autoreturn.com/vehiclelookupservice";
private String _serviceUrl =
"http://localhost:8080/oracle/services/VehicleLookupService";
Service serviceModel = new
ObjectServiceFactory().create(VehicleLookupService.class,
"VehicleLookupService", SERVICE_NAMESPACE, null);
VehicleLookupService service = (VehicleLookupService) new
XFireProxyFactory().create(serviceModel,_serviceUrl);
Client client = ((XFireProxy)
Proxy.getInvocationHandler(service)).getClient();
client.addOutHandler(new DOMOutHandler());
Properties properties = new Properties();
configureOutProperties(properties);
client.addOutHandler(new WSS4JOutHandler(properties)); //
this line is the trouble maker.
LookupVehiclesRequest lookupRequest =
RequestBuilder.buildLookupVehiclesRequest(cmd);
LookupVehiclesResponse r =
service.getVehicles(lookupRequest);
2007-03-01 18:19:09,808 ERROR
[org.codehaus.xfire.util.dom.DOMSerializer] -
javax.xml.stream.XMLStreamException: NamespaceURI cannot be null
2007-03-01 18:19:09,808 ERROR
[org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/oracle]
.[spring]] - Servlet.service() for servlet spring threw exception
org.codehaus.xfire.XFireRuntimeException: Could not invoke service..
Nested exception is org.codehaus.xfire.fault.XFireFault: NamespaceURI
cannot be null
org.codehaus.xfire.fault.XFireFault: NamespaceURI cannot be null
at
org.codehaus.xfire.fault.XFireFault.createFault(XFireFault.java:89)
at
org.codehaus.xfire.util.dom.DOMSerializer.writeMessage(DOMSerializer.jav
a:47)
at
org.codehaus.xfire.transport.http.HttpChannel.writeWithoutAttachments(Ht
tpChannel.java:56)
at
org.codehaus.xfire.transport.http.CommonsHttpMessageSender.getByteArrayR
equestEntity(CommonsHttpMessageSender.java:388)
at
org.codehaus.xfire.transport.http.CommonsHttpMessageSender.send(CommonsH
ttpMessageSender.java:326)
at
org.codehaus.xfire.transport.http.HttpChannel.sendViaClient(HttpChannel.
java:123)
at
org.codehaus.xfire.transport.http.HttpChannel.send(HttpChannel.java:48)
at
org.codehaus.xfire.handler.OutMessageSender.invoke(OutMessageSender.java
:26)
at
org.codehaus.xfire.handler.HandlerPipeline.invoke(HandlerPipeline.java:1
31)
at org.codehaus.xfire.client.Invocation.invoke(Invocation.java:75)
at org.codehaus.xfire.client.Client.invoke(Client.java:335)
at
org.codehaus.xfire.client.XFireProxy.handleRequest(XFireProxy.java:77)
at org.codehaus.xfire.client.XFireProxy.invoke(XFireProxy.java:57)
at $Proxy12.getVehicles(Unknown Source)
at
com.autoreturn.service.VehicleLookupServiceController.handle(VehicleLook
upServiceController.java:71)
at
org.springframework.web.servlet.mvc.AbstractCommandController.handleRequ
estInternal(AbstractCommandController.java:82)
at
org.springframework.web.servlet.mvc.AbstractController.handleRequest(Abs
tractController.java:153)
at
org.springframework.web.servlet.mvc.SimpleControllerHandlerAdapter.handl
e(SimpleControllerHandlerAdapter.java:45)
at
org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherS
ervlet.java:806)
at
org.springframework.web.servlet.DispatcherServlet.doService(DispatcherSe
rvlet.java:736)
at
org.springframework.web.servlet.FrameworkServlet.processRequest(Framewor
kServlet.java:396)
at
org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.
java:350)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:689)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Applica
tionFilterChain.java:252)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilt
erChain.java:173)
at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValv
e.java:213)
at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValv
e.java:178)
at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java
:126)
at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java
:105)
at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.
java:107)
at
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:1
48)
at
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:86
9)
at
org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.proc
essConnection(Http11BaseProtocol.java:664)
at
org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint
.java:527)
at
org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollow
erWorkerThread.java:80)
at
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool
.java:684)
at java.lang.Thread.run(Thread.java:595)
Caused by: javax.xml.stream.XMLStreamException: NamespaceURI cannot be
null
at
com.sun.xml.stream.writers.XMLStreamWriterImpl.writeAttribute(XMLStreamW
riterImpl.java:324)
at
org.codehaus.xfire.util.STAXUtils.writeElement(STAXUtils.java:366)
at org.codehaus.xfire.util.STAXUtils.writeNode(STAXUtils.java:391)
at
org.codehaus.xfire.util.STAXUtils.writeElement(STAXUtils.java:380)
at org.codehaus.xfire.util.STAXUtils.writeNode(STAXUtils.java:391)
at
org.codehaus.xfire.util.STAXUtils.writeElement(STAXUtils.java:380)
at org.codehaus.xfire.util.STAXUtils.writeNode(STAXUtils.java:391)
at
org.codehaus.xfire.util.STAXUtils.writeElement(STAXUtils.java:380)
at org.codehaus.xfire.util.STAXUtils.writeNode(STAXUtils.java:391)
at
org.codehaus.xfire.util.STAXUtils.writeElement(STAXUtils.java:380)
at
org.codehaus.xfire.util.STAXUtils.writeDocument(STAXUtils.java:285)
at
org.codehaus.xfire.util.dom.DOMSerializer.writeMessage(DOMSerializer.jav
a:40)
... 36 more