Axis2 1.4 How to modify soap envelope attributes?

Discussion in 'Java' started by zigzagdna@yahoo.com, Aug 8, 2008.

  1. Guest

    I am using AXIS 2 1.4. I have written a client using AXIS2 which calls
    a =
    third party web service written using Webmethods (not AXIS).
    I am using AXIOM API. When I look at the SOAP message sent:
    <?xml version=3D'1.0' encoding=3D'UTF-8'?>
    <soapenv:Envelope =
    xmlns:soapenv=3D"http://schemas.xmlsoap.org/soap/envelope/">
    <soapenv:Body><tns:TestRPC =
    xmlns:tns=3D"http://10.35.16.31/"><tns:Input1>test100</tns:Input1></
    tns:T=
    estRPC></soapenv:Body></soapenv:Envelope>
    It only has xmlns:soapenv=3D"http://schemas.xmlsoap.org/soap/envelope
    in =
    SOAP Enevelope.=20
    I want to add xsd and xsi namespaces
    <soapenv:Envelope =
    xmlns:xsi=3D"http://www.w3.org/2001/XMLSchema-instance" =
    xmlns:xsd=3D"http://www.w3.org/2001/XMLSchema" =
    xmlns:soapenv=3D"http://schemas.xmlsoap.org/soap/envelope/" =
    xmlns:pu0=3D"http://10.35.16.31/
    PU023_QM_TrackWise_V1.TrackWise_to_SAP.ma=
    ps">

    How do I do it using AXIOM API. Apprecaite any pointers.
    , Aug 8, 2008
    #1
    1. Advertising

  2. wrote:
    > I am using AXIS 2 1.4. I have written a client using AXIS2 which
    > calls
    > a =
    > third party web service written using Webmethods (not AXIS).
    > I am using AXIOM API. When I look at the SOAP message sent:
    > <?xml version=3D'1.0' encoding=3D'UTF-8'?>
    > <soapenv:Envelope =
    > xmlns:soapenv=3D"http://schemas.xmlsoap.org/soap/envelope/">
    > <soapenv:Body><tns:TestRPC =
    > xmlns:tns=3D"http://10.35.16.31/"><tns:Input1>test100</tns:Input1></
    > tns:T=
    > estRPC></soapenv:Body></soapenv:Envelope>
    > It only has
    > xmlns:soapenv=3D"http://schemas.xmlsoap.org/soap/envelope
    > in =
    > SOAP Enevelope.=20
    > I want to add xsd and xsi namespaces
    > <soapenv:Envelope =
    > xmlns:xsi=3D"http://www.w3.org/2001/XMLSchema-instance" =
    > xmlns:xsd=3D"http://www.w3.org/2001/XMLSchema" =
    > xmlns:soapenv=3D"http://schemas.xmlsoap.org/soap/envelope/" =
    > xmlns:pu0=3D"http://10.35.16.31/
    > PU023_QM_TrackWise_V1.TrackWise_to_SAP.ma=
    > ps">
    >
    > How do I do it using AXIOM API. Apprecaite any pointers.


    If anything in the message needs the xsi or xsd namespaces, they'll
    already be defined. If not, they serve no purpose. What are you
    trying to accomplish?
    Mike Schilling, Aug 8, 2008
    #2
    1. Advertising

  3. Guest

    On Aug 8, 5:47 pm, "Mike Schilling" <>
    wrote:
    > wrote:
    > > I am using AXIS 2 1.4. I have written a client using AXIS2 which
    > > calls
    > > a =
    > > third party web service written using Webmethods (not AXIS).
    > > I am using AXIOM API. When I look at the SOAP message sent:
    > > <?xml version=3D'1.0' encoding=3D'UTF-8'?>
    > > <soapenv:Envelope =
    > > xmlns:soapenv=3D"http://schemas.xmlsoap.org/soap/envelope/">
    > > <soapenv:Body><tns:TestRPC =
    > > xmlns:tns=3D"http://10.35.16.31/"><tns:Input1>test100</tns:Input1></
    > > tns:T=
    > > estRPC></soapenv:Body></soapenv:Envelope>
    > > It only has
    > > xmlns:soapenv=3D"http://schemas.xmlsoap.org/soap/envelope
    > > in =
    > > SOAP Enevelope.=20
    > > I want to add xsd and xsi namespaces
    > > <soapenv:Envelope =
    > > xmlns:xsi=3D"http://www.w3.org/2001/XMLSchema-instance" =
    > > xmlns:xsd=3D"http://www.w3.org/2001/XMLSchema" =
    > > xmlns:soapenv=3D"http://schemas.xmlsoap.org/soap/envelope/" =
    > > xmlns:pu0=3D"http://10.35.16.31/
    > > PU023_QM_TrackWise_V1.TrackWise_to_SAP.ma=
    > > ps">

    >
    > > How do I do it using AXIOM API. Apprecaite any pointers.

    >
    > If anything in the message needs the xsi or xsd namespaces, they'll
    > already be defined.  If not, they serve no purpose.  What are you
    > trying to accomplish?- Hide quoted text -
    >
    > - Show quoted text -


    Thanks. Not sure what you mean by alreday defined. I am writing client
    code from Scartch using AXIOM. By default it does not include xsd and
    xsi namespaces.

    OMElement helloWorldPayload = helloWorldPayload("test1234");
    Options options = new Options();
    System.out.println("getSoapVersionURI:" +
    options.getSoapVersionURI());
    options.setTo(targetEPR);
    options.setTransportInProtocol(Constants.TRANSPORT_HTTP);
    ServiceClient sender = new ServiceClient();

    sender.setOptions(options);
    sender.sendReceive(helloWorldPayload);

    when I use tcpmon to see messages going thorugh, it does not show xsd
    and xsi namespaces.., so they are no part of SOAP message sent by
    AXIS2, but my third party web service requires them.
    , Aug 8, 2008
    #3
  4. wrote:
    > On Aug 8, 5:47 pm, "Mike Schilling" <>
    > wrote:
    >> wrote:
    >>> I am using AXIS 2 1.4. I have written a client using AXIS2 which
    >>> calls
    >>> a =
    >>> third party web service written using Webmethods (not AXIS).
    >>> I am using AXIOM API. When I look at the SOAP message sent:
    >>> <?xml version=3D'1.0' encoding=3D'UTF-8'?>
    >>> <soapenv:Envelope =
    >>> xmlns:soapenv=3D"http://schemas.xmlsoap.org/soap/envelope/">
    >>> <soapenv:Body><tns:TestRPC =
    >>> xmlns:tns=3D"http://10.35.16.31/"><tns:Input1>test100</tns:Input1></
    >>> tns:T=
    >>> estRPC></soapenv:Body></soapenv:Envelope>
    >>> It only has
    >>> xmlns:soapenv=3D"http://schemas.xmlsoap.org/soap/envelope
    >>> in =
    >>> SOAP Enevelope.=20
    >>> I want to add xsd and xsi namespaces
    >>> <soapenv:Envelope =
    >>> xmlns:xsi=3D"http://www.w3.org/2001/XMLSchema-instance" =
    >>> xmlns:xsd=3D"http://www.w3.org/2001/XMLSchema" =
    >>> xmlns:soapenv=3D"http://schemas.xmlsoap.org/soap/envelope/" =
    >>> xmlns:pu0=3D"http://10.35.16.31/
    >>> PU023_QM_TrackWise_V1.TrackWise_to_SAP.ma=
    >>> ps">

    >>
    >>> How do I do it using AXIOM API. Apprecaite any pointers.

    >>
    >> If anything in the message needs the xsi or xsd namespaces, they'll
    >> already be defined. If not, they serve no purpose. What are you
    >> trying to accomplish?- Hide quoted text -
    >>
    >> - Show quoted text -

    >
    > Thanks. Not sure what you mean by alreday defined. I am writing
    > client
    > code from Scartch using AXIOM. By default it does not include xsd
    > and
    > xsi namespaces.
    >
    > OMElement helloWorldPayload = helloWorldPayload("test1234");
    > Options options = new Options();
    > System.out.println("getSoapVersionURI:" +
    > options.getSoapVersionURI());
    > options.setTo(targetEPR);
    >
    > options.setTransportInProtocol(Constants.TRANSPORT_HTTP);
    > ServiceClient sender = new ServiceClient();
    >
    > sender.setOptions(options);
    > sender.sendReceive(helloWorldPayload);
    >
    > when I use tcpmon to see messages going thorugh, it does not show
    > xsd
    > and xsi namespaces.., so they are no part of SOAP message sent by
    > AXIS2, but my third party web service requires them.


    That's what I don't understand. The only way a web service would
    reuire namespaces to be defined is if something (an element or an
    attribute) is in that namespace, but if that were true, the namespaces
    would already be defined. Let me take a wild guess: is the problem
    that your web service uses soap encoding, but the client is producing
    a literal message?
    Mike Schilling, Aug 8, 2008
    #4
  5. Guest

    On Aug 8, 6:14 pm, "Mike Schilling" <>
    wrote:
    > wrote:
    > > On Aug 8, 5:47 pm, "Mike Schilling" <>
    > > wrote:
    > >> wrote:
    > >>> I am using AXIS 2 1.4. I have written a client using AXIS2 which
    > >>> calls
    > >>> a =
    > >>> third party web service written using Webmethods (not AXIS).
    > >>> I am using AXIOM API. When I look at the SOAP message sent:
    > >>> <?xml version=3D'1.0' encoding=3D'UTF-8'?>
    > >>> <soapenv:Envelope =
    > >>> xmlns:soapenv=3D"http://schemas.xmlsoap.org/soap/envelope/">
    > >>> <soapenv:Body><tns:TestRPC =
    > >>> xmlns:tns=3D"http://10.35.16.31/"><tns:Input1>test100</tns:Input1></
    > >>> tns:T=
    > >>> estRPC></soapenv:Body></soapenv:Envelope>
    > >>> It only has
    > >>> xmlns:soapenv=3D"http://schemas.xmlsoap.org/soap/envelope
    > >>> in =
    > >>> SOAP Enevelope.=20
    > >>> I want to add xsd and xsi namespaces
    > >>> <soapenv:Envelope =
    > >>> xmlns:xsi=3D"http://www.w3.org/2001/XMLSchema-instance" =
    > >>> xmlns:xsd=3D"http://www.w3.org/2001/XMLSchema" =
    > >>> xmlns:soapenv=3D"http://schemas.xmlsoap.org/soap/envelope/" =
    > >>> xmlns:pu0=3D"http://10.35.16.31/
    > >>> PU023_QM_TrackWise_V1.TrackWise_to_SAP.ma=
    > >>> ps">

    >
    > >>> How do I do it using AXIOM API. Apprecaite any pointers.

    >
    > >> If anything in the message needs the xsi or xsd namespaces, they'll
    > >> already be defined. If not, they serve no purpose. What are you
    > >> trying to accomplish?- Hide quoted text -

    >
    > >> - Show quoted text -

    >
    > > Thanks. Not sure what you mean by alreday defined. I am writing
    > > client
    > > code from Scartch using AXIOM. By default it does not include xsd
    > > and
    > > xsi namespaces.

    >
    > >  OMElement helloWorldPayload = helloWorldPayload("test1234");
    > >             Options options = new Options();
    > >             System.out.println("getSoapVersionURI:" +
    > > options.getSoapVersionURI());
    > >             options.setTo(targetEPR);

    >
    > > options.setTransportInProtocol(Constants.TRANSPORT_HTTP);
    > >              ServiceClient sender = new ServiceClient();

    >
    > >              sender.setOptions(options);
    > >               sender.sendReceive(helloWorldPayload);

    >
    > > when I use tcpmon to see messages going thorugh, it does not show
    > > xsd
    > > and xsi namespaces.., so they are no part of SOAP message sent by
    > > AXIS2, but my third party web service requires them.

    >
    > That's what I don't understand.  The only way a web service would
    > reuire namespaces to be defined is if something (an element or an
    > attribute) is in that namespace, but if that were true, the namespaces
    > would already be defined.  Let me take a wild guess: is the problem
    > that your web service uses soap encoding, but the client is producing
    > a literal message?- Hide quoted text -
    >
    > - Show quoted text -

    You are right. Server is written in Webmethods which is using SOAP RPC
    (encoding). I am trying to call it from AXIS2 which bprobaly uses
    default style.

    Prem
    , Aug 8, 2008
    #5
  6. wrote:
    > On Aug 8, 6:14 pm, "Mike Schilling" <>
    > wrote:
    >> wrote:
    >>> On Aug 8, 5:47 pm, "Mike Schilling" <>
    >>> wrote:
    >>>> wrote:
    >>>>> I am using AXIS 2 1.4. I have written a client using AXIS2 which
    >>>>> calls
    >>>>> a =
    >>>>> third party web service written using Webmethods (not AXIS).
    >>>>> I am using AXIOM API. When I look at the SOAP message sent:
    >>>>> <?xml version=3D'1.0' encoding=3D'UTF-8'?>
    >>>>> <soapenv:Envelope =
    >>>>> xmlns:soapenv=3D"http://schemas.xmlsoap.org/soap/envelope/">
    >>>>> <soapenv:Body><tns:TestRPC =
    >>>>> xmlns:tns=3D"http://10.35.16.31/"><tns:Input1>test100</tns:Input1></
    >>>>> tns:T=
    >>>>> estRPC></soapenv:Body></soapenv:Envelope>
    >>>>> It only has
    >>>>> xmlns:soapenv=3D"http://schemas.xmlsoap.org/soap/envelope
    >>>>> in =
    >>>>> SOAP Enevelope.=20
    >>>>> I want to add xsd and xsi namespaces
    >>>>> <soapenv:Envelope =
    >>>>> xmlns:xsi=3D"http://www.w3.org/2001/XMLSchema-instance" =
    >>>>> xmlns:xsd=3D"http://www.w3.org/2001/XMLSchema" =
    >>>>> xmlns:soapenv=3D"http://schemas.xmlsoap.org/soap/envelope/" =
    >>>>> xmlns:pu0=3D"http://10.35.16.31/
    >>>>> PU023_QM_TrackWise_V1.TrackWise_to_SAP.ma=
    >>>>> ps">

    >>
    >>>>> How do I do it using AXIOM API. Apprecaite any pointers.

    >>
    >>>> If anything in the message needs the xsi or xsd namespaces,
    >>>> they'll
    >>>> already be defined. If not, they serve no purpose. What are you
    >>>> trying to accomplish?- Hide quoted text -

    >>
    >>>> - Show quoted text -

    >>
    >>> Thanks. Not sure what you mean by alreday defined. I am writing
    >>> client
    >>> code from Scartch using AXIOM. By default it does not include xsd
    >>> and
    >>> xsi namespaces.

    >>
    >>> OMElement helloWorldPayload = helloWorldPayload("test1234");
    >>> Options options = new Options();
    >>> System.out.println("getSoapVersionURI:" +
    >>> options.getSoapVersionURI());
    >>> options.setTo(targetEPR);

    >>
    >>> options.setTransportInProtocol(Constants.TRANSPORT_HTTP);
    >>> ServiceClient sender = new ServiceClient();

    >>
    >>> sender.setOptions(options);
    >>> sender.sendReceive(helloWorldPayload);

    >>
    >>> when I use tcpmon to see messages going thorugh, it does not show
    >>> xsd
    >>> and xsi namespaces.., so they are no part of SOAP message sent by
    >>> AXIS2, but my third party web service requires them.

    >>
    >> That's what I don't understand. The only way a web service would
    >> reuire namespaces to be defined is if something (an element or an
    >> attribute) is in that namespace, but if that were true, the
    >> namespaces would already be defined. Let me take a wild guess: is
    >> the problem that your web service uses soap encoding, but the
    >> client
    >> is producing a literal message?- Hide quoted text -
    >>
    >> - Show quoted text -

    > You are right. Server is written in Webmethods which is using SOAP
    > RPC
    > (encoding). I am trying to call it from AXIS2 which bprobaly uses
    > default style.


    There are three styles commonly used:

    1. rpc-encoded
    2. document-literal
    3. rpc-literal

    If youe aervice expects to see the namespaces xsd: and xsi:, it's
    probably using 1 AXIS should figure this out from the WSDL, but if it
    isn't, there may be hints you can give it during the generation
    process.
    Mike Schilling, Aug 9, 2008
    #6
  7. Guest

    On Aug 8, 7:23 pm, "Mike Schilling" <>
    wrote:
    > wrote:
    > > On Aug 8, 6:14 pm, "Mike Schilling" <>
    > > wrote:
    > >> wrote:
    > >>> On Aug 8, 5:47 pm, "Mike Schilling" <>
    > >>> wrote:
    > >>>> wrote:
    > >>>>> I am using AXIS 2 1.4. I have written a client using AXIS2 which
    > >>>>> calls
    > >>>>> a =
    > >>>>> third party web service written using Webmethods (not AXIS).
    > >>>>> I am using AXIOM API. When I look at the SOAP message sent:
    > >>>>> <?xml version=3D'1.0' encoding=3D'UTF-8'?>
    > >>>>> <soapenv:Envelope =
    > >>>>> xmlns:soapenv=3D"http://schemas.xmlsoap.org/soap/envelope/">
    > >>>>> <soapenv:Body><tns:TestRPC =
    > >>>>> xmlns:tns=3D"http://10.35.16.31/"><tns:Input1>test100</tns:Input1></
    > >>>>> tns:T=
    > >>>>> estRPC></soapenv:Body></soapenv:Envelope>
    > >>>>> It only has
    > >>>>> xmlns:soapenv=3D"http://schemas.xmlsoap.org/soap/envelope
    > >>>>> in =
    > >>>>> SOAP Enevelope.=20
    > >>>>> I want to add xsd and xsi namespaces
    > >>>>> <soapenv:Envelope =
    > >>>>> xmlns:xsi=3D"http://www.w3.org/2001/XMLSchema-instance" =
    > >>>>> xmlns:xsd=3D"http://www.w3.org/2001/XMLSchema" =
    > >>>>> xmlns:soapenv=3D"http://schemas.xmlsoap.org/soap/envelope/" =
    > >>>>> xmlns:pu0=3D"http://10.35.16.31/
    > >>>>> PU023_QM_TrackWise_V1.TrackWise_to_SAP.ma=
    > >>>>> ps">

    >
    > >>>>> How do I do it using AXIOM API. Apprecaite any pointers.

    >
    > >>>> If anything in the message needs the xsi or xsd namespaces,
    > >>>> they'll
    > >>>> already be defined. If not, they serve no purpose. What are you
    > >>>> trying to accomplish?- Hide quoted text -

    >
    > >>>> - Show quoted text -

    >
    > >>> Thanks. Not sure what you mean by alreday defined. I am writing
    > >>> client
    > >>> code from Scartch using AXIOM. By default it does not include xsd
    > >>> and
    > >>> xsi namespaces.

    >
    > >>> OMElement helloWorldPayload = helloWorldPayload("test1234");
    > >>> Options options = new Options();
    > >>> System.out.println("getSoapVersionURI:" +
    > >>> options.getSoapVersionURI());
    > >>> options.setTo(targetEPR);

    >
    > >>> options.setTransportInProtocol(Constants.TRANSPORT_HTTP);
    > >>> ServiceClient sender = new ServiceClient();

    >
    > >>> sender.setOptions(options);
    > >>> sender.sendReceive(helloWorldPayload);

    >
    > >>> when I use tcpmon to see messages going thorugh, it does not show
    > >>> xsd
    > >>> and xsi namespaces.., so they are no part of SOAP message sent by
    > >>> AXIS2, but my third party web service requires them.

    >
    > >> That's what I don't understand. The only way a web service would
    > >> reuire namespaces to be defined is if something (an element or an
    > >> attribute) is in that namespace, but if that were true, the
    > >> namespaces would already be defined. Let me take a wild guess: is
    > >> the problem that your web service uses soap encoding, but the
    > >> client
    > >> is producing a literal message?- Hide quoted text -

    >
    > >> - Show quoted text -

    > > You are right. Server is written in Webmethods which is using SOAP
    > > RPC
    > > (encoding). I am trying to call it from AXIS2 which bprobaly uses
    > > default style.

    >
    > There are three styles commonly used:
    >
    > 1. rpc-encoded
    > 2. document-literal
    > 3. rpc-literal
    >
    > If youe aervice expects to see the namespaces xsd: and xsi:, it's
    > probably using 1  AXIS should figure this out from the WSDL, but if it
    > isn't, there may be hints you can give it during the generation
    > process.- Hide quoted text -
    >
    > - Show quoted text -


    I was not using WSDL2JAVA. I was writing code from "scratch", that's
    why I am asking this question.

    There must be API calls to do this.
    , Aug 9, 2008
    #7
  8. wrote:

    >
    > I was not using WSDL2JAVA. I was writing code from "scratch", that's
    > why I am asking this question.


    OK, let's start at the beginning. Show us the code that generates the
    request.
    Mike Schilling, Aug 9, 2008
    #8
  9. Guest

    On Aug 8, 9:47 pm, "Mike Schilling" <>
    wrote:
    > wrote:
    >
    > > I was not using WSDL2JAVA. I was writing code from "scratch", that's
    > > why I am asking this question.

    >
    > OK, let's start at the beginning.  Show us the code that generates the
    > request.


    Mike:
    Thanks a lot for looking into. Attached is the code. Please keep in
    mind that I am new to AXIS2, started using it only 2 weeks ago, but I
    like AXIOM. I just want to know how to add additional name spaces in
    SOAP Enevlope at the beginning (refer to beginning of this Thread).

    import org.apache.axiom.om.OMAbstractFactory;
    import org.apache.axiom.om.OMElement;
    import org.apache.axiom.om.OMFactory;
    import org.apache.axiom.om.OMNamespace;
    import org.apache.axis2.Constants;
    import org.apache.axis2.addressing.EndpointReference;
    import org.apache.axis2.client.Options;
    import org.apache.axis2.client.ServiceClient;
    import javax.xml.namespace.QName;
    import java.util.*;

    public class CallWebm {

    private static EndpointReference targetEPR =
    new EndpointReference(
    "http://10.4.34.114:8888/soap/rpc/
    PU023_QM_TrackWise_V1_TrackWise_to_S
    AP_maps");


    public static OMElement helloWorldPayload(String symbol) {
    OMFactory fac = OMAbstractFactory.getOMFactory();
    OMNamespace omNs = fac.createOMNamespace(
    "http://
    10.35.16.31/", "tns");

    OMElement method = fac.createOMElement("TestRPC", omNs);
    OMElement value = fac.createOMElement("Input1", omNs);
    value.addChild(fac.createOMText(value, "test100"));
    method.addChild(value);
    try {
    System.out.println(method.toStringWithConsume());
    }
    catch (javax.xml.stream.XMLStreamException e) {
    e.printStackTrace();
    }

    return method;
    }

    public static void main(String[] args) {
    try {
    OMElement helloWorldPayload =
    helloWorldPayload("test1234");
    Options options = new Options();
    System.out.println("getSoapVersionURI:" +
    options.getSoapVersionURI());
    options.setTo(targetEPR);
    options.setTransportInProtocol(Constants.TRANSPORT_HTTP);
    //options.setAction("urn:echo");
    // some servers do not support chunking of HTTP 1.1, so
    disable it

    options.setProperty(org.apache.axis2.transport.http.HTTPConstants.HTTP_PROTOCOL_VERSION,
    org.apache.axis2.transport.http.HTTPConstants.HEADER_PROTOCOL_10);
    ServiceClient sender = new ServiceClient();
    sender.addStringHeader (new QName("http://
    www.apache.schema", "xsd"), "");
    sender.setOptions(options);

    //Thread.sleep(3000);
    //sender.sendReceive(helloWorldPayload);
    OMElement result = sender.sendReceive(helloWorldPayload);

    } catch (Exception e) {
    e.printStackTrace();
    }
    }
    }
    , Aug 9, 2008
    #9
  10. wrote:
    > On Aug 8, 9:47 pm, "Mike Schilling" <>
    > wrote:
    >> wrote:
    >>
    >>> I was not using WSDL2JAVA. I was writing code from "scratch",
    >>> that's
    >>> why I am asking this question.

    >>
    >> OK, let's start at the beginning. Show us the code that generates
    >> the
    >> request.

    >
    > Mike:
    > Thanks a lot for looking into. Attached is the code. Please keep in
    > mind that I am new to AXIS2, started using it only 2 weeks ago, but
    > I
    > like AXIOM. I just want to know how to add additional name spaces in
    > SOAP Enevlope at the beginning (refer to beginning of this Thread).


    I still don't think that's what you really want. What you want is to
    add attributes and/or elements in those namespaces: where the
    namespace definitions wind up being placed is unimportant. So, two
    more questions:

    1. What does the XML request this program produces look like.
    2. What do you want it to look like?

    By the way, you can use OMElement.declareNamespace() to create
    namespace definitions.
    Mike Schilling, Aug 9, 2008
    #10
  11. Guest

    On Aug 8, 10:44 pm, "Mike Schilling" <>
    wrote:
    > wrote:
    > > On Aug 8, 9:47 pm, "Mike Schilling" <>
    > > wrote:
    > >> wrote:

    >
    > >>> I was not using WSDL2JAVA. I was writing code from "scratch",
    > >>> that's
    > >>> why I am asking this question.

    >
    > >> OK, let's start at the beginning. Show us the code that generates
    > >> the
    > >> request.

    >
    > > Mike:
    > > Thanks a lot for looking into. Attached is the code. Please keep in
    > > mind that I am new to AXIS2, started using it only 2 weeks ago, but
    > > I
    > > like AXIOM. I just want to know how to add additional name spaces in
    > > SOAP Enevlope at the beginning (refer to beginning of this Thread).

    >
    > I still don't think that's what you really want.  What you want is to
    > add attributes and/or elements in those namespaces: where the
    > namespace definitions wind up being placed is unimportant.  So, two
    > more questions:
    >
    > 1. What does the XML request this program produces look like.
    > 2. What do you want it to look like?
    >
    > By the way, you can use OMElement.declareNamespace() to create
    > namespace definitions.- Hide quoted text -
    >
    > - Show quoted text -


    I really apprecaite all your help declareNamespace adds a name space
    in an element, not in the beginning of SOAP envelope. One thus has to
    set these name spaces in many elements. There should be a way to add
    them to beginning of SOAP envelope. As I said I am new to AXIS, so
    asking basic questions.
    , Aug 9, 2008
    #11
  12. wrote:
    > On Aug 8, 10:44 pm, "Mike Schilling" <>
    > wrote:
    >> wrote:
    >>> On Aug 8, 9:47 pm, "Mike Schilling" <>
    >>> wrote:
    >>>> wrote:

    >>
    >>>>> I was not using WSDL2JAVA. I was writing code from "scratch",
    >>>>> that's
    >>>>> why I am asking this question.

    >>
    >>>> OK, let's start at the beginning. Show us the code that generates
    >>>> the
    >>>> request.

    >>
    >>> Mike:
    >>> Thanks a lot for looking into. Attached is the code. Please keep
    >>> in
    >>> mind that I am new to AXIS2, started using it only 2 weeks ago,
    >>> but
    >>> I
    >>> like AXIOM. I just want to know how to add additional name spaces
    >>> in
    >>> SOAP Enevlope at the beginning (refer to beginning of this
    >>> Thread).

    >>
    >> I still don't think that's what you really want. What you want is
    >> to
    >> add attributes and/or elements in those namespaces: where the
    >> namespace definitions wind up being placed is unimportant. So, two
    >> more questions:
    >>
    >> 1. What does the XML request this program produces look like.
    >> 2. What do you want it to look like?
    >>
    >> By the way, you can use OMElement.declareNamespace() to create
    >> namespace definitions.- Hide quoted text -
    >>
    >> - Show quoted text -

    >
    > I really apprecaite all your help declareNamespace adds a name
    > space
    > in an element, not in the beginning of SOAP envelope. One thus has
    > to
    > set these name spaces in many elements. There should be a way to add
    > them to beginning of SOAP envelope.


    That's not vital.. Really, declaring a namespace more than once won't
    appreciably affect performance.

    Anyway, I'm done here.
    Mike Schilling, Aug 9, 2008
    #12
  13. Guest

    On Aug 9, 1:47 am, "Mike Schilling" <>
    wrote:
    > wrote:
    > > On Aug 8, 10:44 pm, "Mike Schilling" <>
    > > wrote:
    > >> wrote:
    > >>> On Aug 8, 9:47 pm, "Mike Schilling" <>
    > >>> wrote:
    > >>>> wrote:

    >
    > >>>>> I was not using WSDL2JAVA. I was writing code from "scratch",
    > >>>>> that's
    > >>>>> why I am asking this question.

    >
    > >>>> OK, let's start at the beginning. Show us the code that generates
    > >>>> the
    > >>>> request.

    >
    > >>> Mike:
    > >>> Thanks a lot for looking into. Attached is the code. Please keep
    > >>> in
    > >>> mind that I am new to AXIS2, started using it only 2 weeks ago,
    > >>> but
    > >>> I
    > >>> like AXIOM. I just want to know how to add additional name spaces
    > >>> in
    > >>> SOAP Enevlope at the beginning (refer to beginning of this
    > >>> Thread).

    >
    > >> I still don't think that's what you really want. What you want is
    > >> to
    > >> add attributes and/or elements in those namespaces: where the
    > >> namespace definitions wind up being placed is unimportant. So, two
    > >> more questions:

    >
    > >> 1. What does the XML request this program produces look like.
    > >> 2. What do you want it to look like?

    >
    > >> By the way, you can use OMElement.declareNamespace() to create
    > >> namespace definitions.- Hide quoted text -

    >
    > >> - Show quoted text -

    >
    > > I really apprecaite  all your help declareNamespace adds a name
    > > space
    > > in an element, not in the beginning of SOAP envelope. One thus has
    > > to
    > > set these name spaces in many elements. There should be a way to add
    > > them to beginning of SOAP envelope.

    >
    > That's not vital..  Really, declaring a namespace more than once won't
    > appreciably affect performance.
    >
    > Anyway, I'm done here.- Hide quoted text -
    >
    > - Show quoted text -


    Thanks again.
    , Aug 9, 2008
    #13
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Mike
    Replies:
    0
    Views:
    528
  2. cxc
    Replies:
    0
    Views:
    6,332
  3. Replies:
    0
    Views:
    440
  4. Michael Post
    Replies:
    5
    Views:
    1,110
    Arne Vajhøj
    Aug 22, 2009
  5. droesler
    Replies:
    2
    Views:
    474
    droesler
    Aug 31, 2010
Loading...

Share This Page