Link to home
Create AccountLog in
Avatar of kandsurge
kandsurge

asked on

is there any way to add addressing modules to soap in axis 1.4 for .net webservice

java client .net webservice
is there any way to add addressing modules to soap in axis 1.4 for .net webservice

adding wsa:to
wsa:from
various addressing into soap generated from axis 1.4
Avatar of Siva Prasanna Kumar
Siva Prasanna Kumar
Flag of India image

Avatar of kandsurge
kandsurge

ASKER

thanks shiv what jars do i need
ASKER CERTIFIED SOLUTION
Avatar of Siva Prasanna Kumar
Siva Prasanna Kumar
Flag of India image

Link to home
membership
Create an account to see this answer
Signing up is free. No credit card required.
Create Account
shiv i already had an addressing-1.0.jar file in my axis lib directory and i was trying to set it from the wsdd file for axis client .The cllient doesnt seem to set the addressing components..
It would be great if you could give me a whole coding sample for the sandesha.
I couldnt find the sandesha for axis1.0 when i go to the link above and went to the downloads its not available.

I am extremely sorry actually Sandesha is implementation of WS-ReliableMessaging not WS- Addressing, for addressing only Addressing.jar is enough.

>> "i was trying to set it from the wsdd file for axis client "

How were you doing this??

Can you explain me that part
I will give u the whole implementation in a sec
here is the client code
import com.MySite.api.pa.UserManagement.*;
import com.MySite.api.pa.*;
import com.MySite.schemas.Common._2006._01.ims_epv1p1_xsd.*;
import java.net.URL;
import java.rmi.RemoteException;
import java.util.HashMap;
import java.util.Map;
import javax.xml.namespace.QName;
import javax.xml.rpc.ServiceException;
import javax.xml.rpc.handler.HandlerInfo;
import javax.xml.soap.*;
import com.MySitea.webservices.signature.ClientSignHandler;
import com.MySitea.webservices.*;
import java.io.*;
import java.io.PrintStream;
 
public class Client
{
      public static void main(String [] args)
      {
            try
            {
                  //Create a service
                  //UserManagement service = new UserManagementLocator();
                  //UserManagement service = new UserManagementLocator.bind();
 
                  String soapm = service.getUserManagementSoap( new java.net.URL("https://api.MySite.com/UserManagementServices.asmx") );
                  System.out.println("soapm : " +soapm);
                 //create a handle
                  //Retrieve a stub to service
                  //UserManagementSoap soapResponse = service.getUserManagementSoap( new java.net.URL("https://api.MySite.com/UserManagementServices.asmx") );
                  //System.out.println("responsea : " +service.getUserManagementSoap( new java.net.URL("https://api.MySite.com/UserManagementServices.asmx")));
                //make a call
          //System.out.println("response after request : " +soapResponse.processRequest(new com.MySite.schemas.Common._2006._01.ims_epv1p1_xsd.Enterprise () ));
 
 
            }
            catch(Exception e)
            {System.out.println(e.getMessage());}
      }
}

Open in new window

here is my clien.wsdd file
<deployment xmlns="http://xml.apache.org/axis/wsdd/" xmlns:java="http://xml.apache.org/axis/wsdd/providers/java">
 
<typeMapping
xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/03/addressing";
deserializer="org.apache.axis.encoding.ser.SimpleDeserializerFactory"
      encodingStyle=""
      qname="wsa:PortType"
serializer="org.apache.axis.encoding.ser.SimpleSerializerFactory"
type="java:org.apache.axis.message.addressing.PortType"/>
 
 <operation name="getEnrollmentsByCourseId" qname="operNS:GetEnrollmentsByCourseId"
        xmlns:operNS="http://api.*****.com/tc/course" returnQName="retNS:enterprise"
        xmlns:retNS="http://***.org/imsep" returnType="rtns:>enterprise"
        xmlns:rtns="http://****.org/imsep"
        soapAction="http://api.*****.com/tc/course/GetEnrollmentsByCourseId" >
        <parameter qname="pns:courseId" xmlns:pns="http://*********.com/tc/course"
                type="tns:int" xmlns:tns="http://www.w3.org/2001/XMLSchema"/>
      </operation>
 
 
 <transport name="http" pivot="java:org.apache.axis.transport.http.HTTPSender"/>
 
 <globalConfiguration >
<parameter name="enableNamespacePrefixOptimization" value="false" />
 
<!--
 <parameter name="addressing.namespace.URI" value="http://schemas.xmlsoap.org/ws/2004/03/addressing"/>
  <requestFlow >
      <operation name="getEnrollmentsByCourseId" qname="operNS:GetEnrollmentsByCourseId"
        xmlns:operNS="http://*******.com/tc/course" returnQName="retNS:enterprise"
        xmlns:retNS="http://****.org/imsep" returnType="rtns:>enterprise"
        xmlns:rtns="http://*****.org/imsep"
        soapAction="http://*****.com/tc/course/GetEnrollmentsByCourseId" >
        <parameter qname="pns:courseId" xmlns:pns="http://*****/tc/course"
                type="tns:int" xmlns:tns="http://www.w3.org/2001/XMLSchema"/>
      </operation>
-->
 
 
<!--      <handler type="java:org.apache.axis.message.addressing.handler.AddressingHandler" >
       <parameter name="signatureParts" value="{Element}{http://schemas.xmlsoap.org/soap/envelope/}Body;
                                      {Element}{http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd}Timestamp;
                                       {Element}{http://schemas.xmlsoap.org/ws/2004/03/addressing}MessageID;
                                       {Element}{http://schemas.xmlsoap.org/ws/2004/03/addressing}Action;
                                       {Element}{http://schemas.xmlsoap.org/ws/2004/03/addressing}To;
                                       {Element}{http://schemas.xmlsoap.org/ws/2004/03/addressing}From;
                                       {Element}{http://schemas.xmlsoap.org/ws/2004/03/addressing}FaultTo;
                                       {Element}{http://schemas.xmlsoap.org/ws/2004/03/addressing}ReplyTo"/>
 
     </handler>
    -->
 
     <handler type="java:org.apache.ws.axis.security.WSDoAllSender" >
 
   <parameter name="action" value="Signature Encrypt Timestamp"/>
 
 
    <!--  <parameter name="sgnatureParts"
      value="Header;{}{http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd}To" />
    -->
 
    <!--
      <parameter name="signatureParts" value="{Element}{http://schemas.xmlsoap.org/soap/envelope/}Body;
                                      {Element}{http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd}Timestamp;
                                       {Element}{http://schemas.xmlsoap.org/ws/2004/03/addressing}MessageID;
                                       {Element}{http://schemas.xmlsoap.org/ws/2004/03/addressing}Action;
                                       {Element}{http://schemas.xmlsoap.org/ws/2004/03/addressing}To;
                                       {Element}{http://schemas.xmlsoap.org/ws/2004/03/addressing}From;
                                       {Element}{http://schemas.xmlsoap.org/ws/2004/03/addressing}FaultTo;
                                       {Element}{http://schemas.xmlsoap.org/ws/2004/03/addressing}ReplyTo"/>
 
 
      <parameter name="addressing.sendReplyTo" value="true"/>
       <parameter name="addressing.namespace.URI" value="http://schemas.xmlsoap.org/ws/2004/03/addressing"/>
        -->
 
        <parameter name="action" value="Timestamp UsernameToken"/>
        <parameter name="action" value="UsernameToken"/>
        <parameter name="user" value="rutgers"/>
        <parameter name="passwordCallbackClass" value="com.eCollege.api.pa.commons.PWCallback"/>
 
        <parameter name="passwordType" value="PasswordDigest"/>
 
        <parameter name="precisionInMilliseconds" value="false"/>
 
        <!-- <parameter name="precisionInMilliseconds" value="false"/> -->
 
      <!-- parameter name="signaturePropFile" value="wss-usernamesign.properties"/>
 
        <parameter name="signatureParts" value="{Element}{http://schemas.xmlsoap.org/soap/envelope/}Body;
                                            {Element}{http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd}Timestamp;
                                           {Element}{http://schemas.xmlsoap.org/ws/2004/03/addressing}MessageID;
                                           {Element}{http://schemas.xmlsoap.org/ws/2004/03/addressing}Action;
                                           {Element}{http://schemas.xmlsoap.org/ws/2004/03/addressing}To;
                                           {Element}{http://schemas.xmlsoap.org/ws/2004/03/addressing}From;
                                           {Element}{http://schemas.xmlsoap.org/ws/2004/03/addressing}FaultTo"/>
 
-->
 
    </handler>
   </requestFlow >
  </globalConfiguration >
</deployment>

Open in new window

I am using wss4j for securing the webservice ...it seems to work fine..the only thing i seem to be missing is the wsa:To
wsa:from
various other addressing parameters
If could set that my webservice would interoperate with .net weservice

i need a axis 1.4 based client with wss4j to talk to .net webservice

Shiv were u aware of anything of that sort
I tried a lot searching about this but every where they speak WS addressing with Axis 2, which is not very useful as Axis 2 is much more modular, and u can just include the module u need to activate that module.

But with axis 1, you may have to code this in manually I am still searching if there is a proper answer then you will find it at

http://java2.5341.com/2_525.html

Please search this mail list form you may get it sooner. If I get any further resource on this I will surely share it, I have never tried WS-Addressing in Axis 1 :)
I need something more concrete as to how to implement it if someone has more info ..please respond
thanks
serge