I don't konow :P

I put its content here


deploy.wsdd
--------------------------------
<deployment name="xkms" 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="MyService" style="message">
   <parameter name="className" value="messagestyletest.MyService" />
   <parameter name="allowedMethods" value="service" />
 </service>
</deployment>


example.xml
--------------------------------
<LocateRequest Id="1140259412677880051" Service="http://test"; xmlns="http://www.w3.org/2002/03/xkms#";>
   <RespondWith>http://www.w3.org/2002/03/xkms#KeyName</RespondWith>
   <QueryKeyBinding>
       <ns1:KeyInfo xmlns:ns1="http://www.w3.org/2000/09/xmldsig#";>
           <ns1:KeyName>Test</ns1:KeyName>
       </ns1:KeyInfo>
   </QueryKeyBinding>
</LocateRequest>



AH! The test client takes as his first param the filename with the XML to be sent and if you don't specify iit, looks for example.xml file

Bye


Carmine Gargiulo wrote:

thanx a lot :D

but....wsdd and xml file....where are?? :D

In data Thu, 20 Oct 2005 10:27:21 +0200, Vicente D. Guardiola Buitrago <[EMAIL PROTECTED]> ha scritto:

First of all, thank you for your help

The code in the email is complete, but I attach you tu Java classes
(server and client), the wsdd file and an XML document example :)

MyService.java: Web Service class
Main.java: Client
example.xml: a test XML document
delpoy.wsdd: the wsdd file for AdminClient

Thanks

Carmine Gargiulo wrote:

i want help you but your code not work, cause: error in run.

The code that you've showed us...is completed for client e server??

In data Wed, 19 Oct 2005 18:43:24 +0200, Vicente D. Guardiola
Buitrago  <[EMAIL PROTECTED]> ha scritto:

No,

it's in a simple java Class, but the problem is un the client, the
constructor SOAPBodyElement modifies de XMLDoxument (byte[]) I pass
it  as paraemter.
It adds xmlns:ns1="" in every second level element in the document.


Carmine Gargiulo wrote:

the Server Code is into a servlet?


Client Code is:

    public byte[] request(byte[] request){
        try{
            Service  service = new Service();
            Call     call    = (Call) service.createCall();
            call.setTargetEndpointAddress( new
URL("http://localhost:8080/axis/services/MyService";) );
            SOAPBodyElement[] input = new SOAPBodyElement[1];
            input[0] = new
org.apache.axis.message.SOAPBodyElement(new
ByteArrayInputStream(request));
            System.out.println(call.invoke(input));
        }catch(Exception e){
            e.printStackTrace();
        }              return null;          }


and Server Code is:

    public void service(javax.xml.soap.SOAPEnvelope req,
javax.xml.soap.SOAPEnvelope resp) throws Exception {
if(myService == null){
            myService = new MyService();
        }
               // Request to byte[]
        SOAPBody soapBody = req.getBody();
        Node docBody = soapBody.getFirstChild();
               ByteArrayOutputStream inBytes = new
ByteArrayOutputStream();
        TransformerFactory tf = TransformerFactory.newInstance();
        Transformer trans = tf.newTransformer();
        trans.transform(new DOMSource(docBody), new
StreamResult(inBytes));
             //Call the  real underlyingService
        byte[] response = myService.service(inBytes.toByteArray());
                     ByteArrayInputStream outBytes = new
ByteArrayInputStream(response);
DocumentBuilderFactory docf = DocumentBuilderFactory.newInstance();
        DocumentBuilder docb = docf.newDocumentBuilder();
        Document doc = docb.parse(outBytes);

((org.apache.axis.message.SOAPEnvelope)resp).addBodyElement(new
org.apache.axis.message.SOAPBodyElement(doc.getDocumentElement()));
    }


The WSDD descriptor for the service is:

<deployment name="xkms" 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="MyService" style="message">
    <parameter name="className" value="org.um.xkms.ws.MyService" />
    <parameter name="allowedMethods" value="service" />
  </service>
</deployment>


I havn't WSDL (because I don't know how to write it for this kind
of   service)

Thanks a lot!

Vicente Guardiola


Carmine Gargiulo wrote:

show us all client/server code that you've wrote

In data Tue, 18 Oct 2005 10:55:12 +0200, Vicente D. Guardiola
Buitrago   <[EMAIL PROTECTED]> ha scritto:

Hello,

I want to do a Message style service because I want to send a
XML    document already created to the service and it returns
another XML  to  me.
I've seen in the Axis User's Guide that this type of service is
the   perfect ne to do this, because using this service the XML
keeps   unmodified, but it isn't in that way, that is, my XML is
modified,  when  I create a SOAPBodyElement with a byte[] (which
contains the XML  file  created) the XML-Document is modified by
adding sevreal  namespaces to  all the elements!!!!

Code:

             byte[] request; //An XML FIle
             ...
            Service  service = new Service();
            Call     call    = (Call) service.createCall();
            call.setTargetEndpointAddress( new
URL("http://localhost:8080/axis/services/Service";) );
            SOAPBodyElement[] input = new
SOAPBodyElement[1];                       input[0] = new
org.apache.axis.message.SOAPBodyElement(new
ByteArrayInputStream(request));
call.invoke(input);


How can I keep my XML file unmodified???

Thanks

Vicente Guardiola

       ______________________________________________ Renovamos
el   Correo  Yahoo! Nuevos servicios, más seguridad
http://correo.yahoo.es









       ______________________________________________ Renovamos el
Correo Yahoo! Nuevos servicios, más seguridad http://correo.yahoo.es









______________________________________________ Renovamos el Correo
Yahoo! Nuevos servicios, más seguridad http://correo.yahoo.es












        
        
                
______________________________________________ Renovamos el Correo Yahoo! Nuevos servicios, más seguridad http://correo.yahoo.es

Reply via email to