-
Need help creating client for DOM/Message Based Webservice
Hello all,
I am using Apache Axis and am trying to set up a document style (message based) webservice that will receive a DOM object, modify that DOM object, and return it as a new DOM object.
I have set up my webservice (a very simple one to get this going):
package testing.webservices;
import org.w3c.dom.Document;
import org.apache.axis.MessageContext;
public class DocTest{
public Document doSubmission(MessageContext msgContext, Document inDoc)throws Exception{
return inDoc;
}
}
I set this class up in Axis with my deploy.wsdd file:
<deployment name="test" 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="DocService" style="java:MSG">
<parameter name="className" value="testing.webservices.DocTest" />
<parameter name="allowedMethods" value="doSubmission" />
</service>
</deployment>
When I look at Axis it lists this DocService as an active service. Can anyone tell me what the client code would look like to send a Document object to my simple webservice and receive a document object back? Any help would be greatly appreciated.
J-Rod
NOTE: This is what I have so far:
import .....
public class DocTestClient{
public static void main(String[] args) throws Exception {
String fileName = "C:\\Dev\\MyXmlFile.xml";
String uri = "file:" + new File(fileName).getAbsolutePath( );
DocumentBuilderFactory factory =DocumentBuilderFactory.newInstance();
DocumentBuilder builder = factory.newDocumentBuilder();
Document doc = builder.parse(uri);
String endpointURL = "http://localhost:8080/axis/services/DocService";
Service service = new Service();
Call call = (Call) service.createCall();
call.setTargetEndpointAddress(new java.net.URL(endpointURL) );
call.setOperationName(new QName("http://testing.webservices", "doSubmission") );
-------------------------------------------------------------------
?????? WHAT DO I DO HERE to access the send the doc object and receive it back?????
-------------------------------------------------------------------
}
}
-
Found a work around
Hello all,
I needed to move on so I figured a work around to my issue. I ended up using RPC with strings of XML, which I then convert to a DOM object when I receive it. Works just as well.
Thanks anyways.
J-Rod
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
Forum Rules
|
Top DevX Stories
Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL
|
Bookmarks