You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@axis.apache.org by Murray Spork <m....@qut.edu.au> on 2002/05/22 04:31:29 UTC
More problems with document style
Hi all,
I've read through the recent threads on document-style calls and I've
also been through the source for AdminClient (as was suggested) but I'm
still having trouble getting document-style SOAP calls to work in Axis
Beta 2.
I'm getting the exception message "The AXIS engine could not find a
target service to invoke! targetService is null"
I deployed the service with a deployment descriptor like so:
<deployment xmlns="http://xml.apache.org/axis/wsdd/"
xmlns:java="http://xml.apache.org/axis/wsdd/providers/java"
xmlns:xsi="http://www.w3.org/2000/10/XMLSchema-instance">
<service name="AdvertisementService" provider="java:MSG">
<parameter name="className" value="AdvertisementService"/>
<parameter name="allowedMethods" value="advertise"/>
</service>
</deployment>
The signature of my service method looks like:
public void advertise(Document xml);
In the AdminClient the method actually takes a Vector of Element objects
and returns an array of Element objects - I tried this first but it
didn't work so I noticed that some on the messages on this list
suggested a method sig that looks like the above (which seems more
natural to me - why would you do it the other way?)
So then on the client side - my code to call the service looks something
like this:
public void invokeService(Document xmlBody)
{
// Initialize our Service -
Service service = new Service();
Call call = (Call) service.createCall();
call.setTargetEndpointAddress( new java.net.URL(getUrl()) );
call.setOperationName( "advertise" ); // doesn't do anything?
call.setOperationStyle("document");
call.setUseSOAPAction( true );
call.setSOAPActionURI("DiscoveryMessagingService" );
call.setTargetService("DiscoveryMessagingService");
// the last line doesn't seem to do anything
Object[] params
= new Object[] { new SOAPBodyElement(messageBody.getDocumentElement())};
call.invoke(params);
}
In the axis server it's bombing out at line 282 in
org.apache.axis.server.AxisServer.invoke(). I tried looking through thie
source code and working back from there to find out where it is looking
for the targetService (I assume it gets this from the SOAPAction header)
- but I couldn't figure it out.
Any help would be most appreciated
Thanks
Murray Spork
P.S. here's what my SOAP request looks like (from TCPMonitor)
POST /axis/servlet/AxisServlet HTTP/1.0
Content-Length: 2418
Host: localhost
Content-Type: text/xml; charset=utf-8
SOAPAction: "DiscoveryMessagingService"
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<SOAP-ENV:Body><advertise><!-- some more xml here --> </advertise>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>