Interop with Apache SOAP

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Biao

    Interop with Apache SOAP

    I have a web service writen by .NET:

    [WebMethod]
    [SoapRpcMethod]
    public string[] Greetings(strin g[] names)
    {
    string[] gs = new string[names.Length];
    for (int i = 0; i < gs.Length; i++)
    gs[i] = string.Format(" Hello, {0}", names[i]);

    return gs;
    }

    It will be consumed by a Apache SOAP client (SOAPConnect for Lotus
    Notes). Apache can send the string array (names) to .NET; but fail to
    deserialize the return array (GreetingsResul t).

    Here is the web request (from Apache to .net)
    <SOAP-ENV:Body>
    <ns1:Greeting s xmlns:ns1="urn: ws-jlta-com"
    SOAP-ENV:encodingSty le="http://schemas.xmlsoap .org/soap/encoding/">
    <names xmlns:ns2="http ://schemas.xmlsoap .org/soap/encoding/"
    xsi:type="ns2:A rray" ns2:arrayType=" xsd:string[2]">
    <item xsi:type="xsd:s tring">biao</item>
    <item xsi:type="xsd:s tring">yuan</item>
    </names>
    </ns1:Greetings>
    </SOAP-ENV:Body>

    This is the web response (from .net to Apache)
    <soap:Body
    soap:encodingSt yle="http://schemas.xmlsoap .org/soap/encoding/">
    <types:Greeting sResponse>
    <GreetingsResul t href="#id1" />
    </types:Greetings Response>
    <soapenc:Arra y id="id1" soapenc:arrayTy pe="xsd:string[2]">
    <Item>Hello, biao</Item>
    <Item>Hello, yuan</Item>
    </soapenc:Array>
    </soap:Body>

    As Apache SOAP BeanSerializer only can accept camel casing properties.
    So I guess the problem is caused by .net return <Item> which is pascal
    casing.

    I tested by using SoapFormatter to serialize string array, its result
    is <item>, so I am quite confused why .net web serivce returns <Item>.

    Any solution for this?

    Thanks in advance.

  • Stephany Young

    #2
    Re: Interop with Apache SOAP

    Look's like there is a bug in Apache that doesn't interpret what the web
    servie wsdl is telling it.

    Get the the Apache gurus to fix their software.


    "Biao" <tang.biao@gmai l.com> wrote in message
    news:1112504839 .010861.200250@ f14g2000cwb.goo glegroups.com.. .[color=blue]
    >I have a web service writen by .NET:
    >
    > [WebMethod]
    > [SoapRpcMethod]
    > public string[] Greetings(strin g[] names)
    > {
    > string[] gs = new string[names.Length];
    > for (int i = 0; i < gs.Length; i++)
    > gs[i] = string.Format(" Hello, {0}", names[i]);
    >
    > return gs;
    > }
    >
    > It will be consumed by a Apache SOAP client (SOAPConnect for Lotus
    > Notes). Apache can send the string array (names) to .NET; but fail to
    > deserialize the return array (GreetingsResul t).
    >
    > Here is the web request (from Apache to .net)
    > <SOAP-ENV:Body>
    > <ns1:Greeting s xmlns:ns1="urn: ws-jlta-com"
    > SOAP-ENV:encodingSty le="http://schemas.xmlsoap .org/soap/encoding/">
    > <names xmlns:ns2="http ://schemas.xmlsoap .org/soap/encoding/"
    > xsi:type="ns2:A rray" ns2:arrayType=" xsd:string[2]">
    > <item xsi:type="xsd:s tring">biao</item>
    > <item xsi:type="xsd:s tring">yuan</item>
    > </names>
    > </ns1:Greetings>
    > </SOAP-ENV:Body>
    >
    > This is the web response (from .net to Apache)
    > <soap:Body
    > soap:encodingSt yle="http://schemas.xmlsoap .org/soap/encoding/">
    > <types:Greeting sResponse>
    > <GreetingsResul t href="#id1" />
    > </types:Greetings Response>
    > <soapenc:Arra y id="id1" soapenc:arrayTy pe="xsd:string[2]">
    > <Item>Hello, biao</Item>
    > <Item>Hello, yuan</Item>
    > </soapenc:Array>
    > </soap:Body>
    >
    > As Apache SOAP BeanSerializer only can accept camel casing properties.
    > So I guess the problem is caused by .net return <Item> which is pascal
    > casing.
    >
    > I tested by using SoapFormatter to serialize string array, its result
    > is <item>, so I am quite confused why .net web serivce returns <Item>.
    >
    > Any solution for this?
    >
    > Thanks in advance.
    >[/color]


    Comment

    • Biao

      #3
      Re: Interop with Apache SOAP

      Thanks for your reply. Apache has a new project for web service (Axis).
      But in my situation, Apache SOAP is the only choice. I have to find a
      way to serialize soap message which can be accepted by it.

      Comment

      • Stephany Young

        #4
        Re: Interop with Apache SOAP

        The point is that is the responsibility of the consumer to format the
        request as the provider requires it and interpret the result that the
        provider provides.

        It is like a contract where the provider says:

        - you are required to submit the request in the format specified in
        appendix A

        - the response will always be provided in the format specified in appendix
        B

        But, I can't really believe that Apache can't deal with a an <Item> node as
        opposed to an <item> tag.



        "Biao" <tang.biao@gmai l.com> wrote in message
        news:1112508374 .668921.63610@g 14g2000cwa.goog legroups.com...[color=blue]
        > Thanks for your reply. Apache has a new project for web service (Axis).
        > But in my situation, Apache SOAP is the only choice. I have to find a
        > way to serialize soap message which can be accepted by it.
        >[/color]


        Comment

        • Biao

          #5
          Re: Interop with Apache SOAP

          The client application is on Lotus Notes(version 5), which has used for
          several years. IBM gives a solution by using Apache SOAP for this
          version of Lotus Notes. Our Lotus developer has very limited expertise
          on web services, even on Java. So it is easier to do something in .NET
          than Lotus Notes for the web service.

          As Apache SOAP only supports encoding format. What I need is just an
          equivalent of XmlArrayItemAtt ribute which can set the element name of
          array item in literal format, such as SoapArrayItemAt tribute. I am
          trying to do soap extension to solve this problem now. Any suggestion?

          Comment

          • Stephany Young

            #6
            Re: Interop with Apache SOAP

            You're missing the point.

            Your supplier for widgets supplies them in cardboard cartons.

            Someone in your firm decides in thier infinite wisdom that you want them in
            plastic bags.

            Do you expect the widget supplier to redesign his packaging operation to
            suit the abberations of someone in your firm.

            No! You create a procedure to extract the widgets out of the cartons and put
            them in plastic bags when they arrive at your place.

            That is exactly what you need to do in this case. Take the data supplied by
            the web service and massage it to suit your needs.

            It's not the webservice's problem that your Lotus developer has very limited
            expertise on web services.

            What you are are advocating is the age old problem of someone saying "I'm
            not going to change my end - you change your end" and you caving in instead
            of sticking to your guns.

            The proper response is to modify the consumer to deal with what it gets.


            "Biao" <tang.biao@gmai l.com> wrote in message
            news:1112514220 .587277.153300@ l41g2000cwc.goo glegroups.com.. .[color=blue]
            > The client application is on Lotus Notes(version 5), which has used for
            > several years. IBM gives a solution by using Apache SOAP for this
            > version of Lotus Notes. Our Lotus developer has very limited expertise
            > on web services, even on Java. So it is easier to do something in .NET
            > than Lotus Notes for the web service.
            >
            > As Apache SOAP only supports encoding format. What I need is just an
            > equivalent of XmlArrayItemAtt ribute which can set the element name of
            > array item in literal format, such as SoapArrayItemAt tribute. I am
            > trying to do soap extension to solve this problem now. Any suggestion?
            >[/color]


            Comment

            • Biao

              #7
              Re: Interop with Apache SOAP

              Thanks for your reply. It looks like there will be some political
              actions to take!

              Comment

              • Biao

                #8
                Re: Interop with Apache SOAP

                I worked it out. It is not a casing problem, but an interop issue
                between Apache SOAP and Microsoft web service.

                This can be soloved by adding an type mapping to SOAPMappingRegi stry,
                and leave the java type null.

                For detail pls see a post from Sanjiva Weerawarana
                (http://marc.theaimsgroup.com/?l=soap...1982213396&w=2)

                Comment

                Working...