facebook

Strange @WebParam namespace behavior with generated client

  1. MyEclipse Archived
  2.  > 
  3. Web Services
Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #269568 Reply

    GregVidiom
    Member

    I am running the MyEclipse 5.5M2 All-In-One distribution with no additional plugins installed. I have deployed the simple “HelloService” (from the Java EE 5.0 Tutorial) to a Sun Application Server 9.

    I can successfully run the service from either the MyEclipse Web Service Explorer or from the Sun Application Server “Test” facility.

    The port interface generated by MyEclipse looks like this:

    
    @WebService(name = "Hello", targetNamespace = "http://endpoint.helloservice/")
    @SOAPBinding(use = SOAPBinding.Use.LITERAL,
                              parameterStyle = SOAPBinding.ParameterStyle.WRAPPED)
    public interface Hello
    {
        @WebMethod(operationName = "sayHello", action = "")
        @WebResult(name = "return", targetNamespace = "")
        public String sayHello(@WebParam(name = "arg0", targetNamespace = "")
                                           String arg0);
    
    }
    

    When I run the service from the MyEclipse Web Service Explorer, the following SOAP message is sent to the server:

    
    <soapenv:Envelope
      xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
      xmlns:q0="http://endpoint.helloservice/"
      xmlns:xsd="http://www.w3.org/2001/XMLSchema"
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
        <soapenv:Body>
            <q0:sayHello>
                <arg0>Gregory</arg0>
            </q0:sayHello>
        </soapenv:Body>
    </soapenv:Envelope>
    

    Notice that the “arg0” element is defined in the empty namespace. My HelloService correctly receives the value “Gregory” for the parameter and produces the correct response.

    However, when I run the client generated by MyEclipse, the SOAP message sent to the server looks like this:

    
    <soap:Envelope
      xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
      xmlns:xsd="http://www.w3.org/2001/XMLSchema"
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
        <soap:Body>
            <sayHello xmlns="http://endpoint.helloservice/">
                <arg0 xmlns="http://endpoint.helloservice/">Gregory</arg0>
            </sayHello>
        </soap:Body>
    </soap:Envelope>
    

    The arg0 parameter in this message appears in the main service namespace. My service logs that its parameter is null (instead of Gregory).

    I wasn’t sure that WSDL would be very valuable to post here, since the service seems to be functioning correctly when accessed by any client except for the one generated by MyEclipse, but here it is anyway:

    
    <?xml version="1.0" encoding="UTF-8"?><definitions xmlns="http://schemas.xmlsoap.org/wsdl/" xmlns:tns="http://endpoint.helloservice/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" targetNamespace="http://endpoint.helloservice/" name="HelloService">
      <types>
        <xsd:schema>
          <xsd:import namespace="http://endpoint.helloservice/" schemaLocation="http://myhost:8080/HelloService/HelloService/__container$publishing$subctx/WEB-INF/wsdl/HelloService_schema1.xsd" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/"/>
        </xsd:schema>
      </types>
      <message name="sayHello">
        <part name="parameters" element="tns:sayHello"/>
      </message>
      <message name="sayHelloResponse">
        <part name="parameters" element="tns:sayHelloResponse"/>
      </message>
      <portType name="Hello">
        <operation name="sayHello">
          <input message="tns:sayHello"/>
          <output message="tns:sayHelloResponse"/>
        </operation>
      </portType>
      <binding name="HelloPortBinding" type="tns:Hello">
        <soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="document"/>
        <operation name="sayHello">
          <soap:operation soapAction=""/>
          <input>
            <soap:body use="literal"/>
          </input>
          <output>
            <soap:body use="literal"/>
          </output>
        </operation>
      </binding>
      <service name="HelloService">
        <port name="HelloPort" binding="tns:HelloPortBinding">
          <soap:address location="http://myhost:8080/HelloService/HelloService" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/"/>
        </port>
      </service>
    </definitions>
    

    Any ideas why the MyEclipse client is putting my arg0 in a namespace?

    Greg

    #269581 Reply

    tomeksz
    Member

    Probably empty namespace is treated as no namespace, thats why default one is used. Maybe a XFire bug

    #269719 Reply

    Riyad Kalla
    Member

    Greg,
    tomeksz is actually part of the XFire team and has a much better idea than I do what is going on here. I will double check with out devs on this end to see if they can dig up anything.

    #269732 Reply

    GregVidiom
    Member

    Thank you both for your responses…

    Is there anything further that I could provide to either of you to help get to the bottom of this? My company is developing a product that may use Java EE 5 and JAX-WS WebServices and I am responsible for investigating the technology and identifying tools for the team. I am currently using Netbeans5.5 to continue my investigation, but everyone on my team already uses Eclipse for Java development and my preferred choice would be a plugin for Eclipse instead of a whole new IDE.

    I realize that MyEclipse for Java EE 5 is still in milestone release state and there will be bugs. So, please let me know if there is any information I can provide to help. MyEclipse is a great product and hope to use it more in the future!

    #269733 Reply

    tomeksz
    Member

    I was a little busy last days with releasing XFire 1.2.6, but i’ll try to check this problem sometime later.

    #270588 Reply

    GregVidiom
    Member

    Just wanted to bump this thread to see if anything had been discovered with regard to the namespace issue.

    Greg

Viewing 6 posts - 1 through 6 (of 6 total)
Reply To: Strange @WebParam namespace behavior with generated client

You must be logged in to post in the forum log in