You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@axis.apache.org by Gajdi Ádám <ma...@freemail.hu> on 2008/06/30 16:02:26 UTC

Axis 1.4 namespace problem

Hello,

   

  I would like to request a little help from you in our problem with a webservice client.

   

  We had to write a webservice client application, which talks with a server on SOAP protocol. The programing platform is naturally Java, thatâ019s why our choice for the SOAP communication was Axis 1.4 (Eclipse built-in).  The application server is Jboss 4.2.

   

  Our WSDL file:

   

  <?xml version="1.0" encoding="utf-8"?>

  <definitions

      targetNamespace="http://www.huawei.com/IMS/BMU"

      xmlns="http://schemas.xmlsoap.org/wsdl/"

      xmlns:tns="http://www.huawei.com/IMS/BMU"

      xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"

      xmlns:ns1="http://wombat.org" 

   

      <!--========================================-->

      <!--============  TYPES ====================-->

      <!--========================================-->

      <types>

          <xsd:schema targetNamespace="http://www.huawei.com/IMS/BMU">

              <xsd:element name="ADD_HDAINF">

                  <xsd:complexType>

                      <xsd:sequence>

                          <xsd:element name="MEID" type="xsd:unsignedShort"/>

                          <xsd:element name="USERNAME" type="xsd:string"/>

                          <xsd:element name="PASSWORD" type="xsd:string"/>

                          <xsd:element name="IMPI" type="xsd:string"/>

                          <xsd:element name="HUSERNAME" type="xsd:string"/>

                          <xsd:element name="PWD" type="xsd:string"/>

                      </xsd:sequence>

                  </xsd:complexType>

              </xsd:element>

              <xsd:element name="ADD_HDAINFResponse">

                  <xsd:complexType>

                      <xsd:sequence>

                           <xsd:element name="Result" type="tns:ResultType"/> 

                      </xsd:sequence>

                  </xsd:complexType>

              </xsd:element>

         </xsd:schema>

      </types>

   

      <!--========================================-->

      <!--============  MESSAGES =================-->

      <!--========================================-->

        <message name="ADD_HDAINFSoapIn">

              <part name="parameters" element="tns:ADD_HDAINF"/>

        </message>

        <message name="ADD_HDAINFSoapOut">

              <part name="parameters" element="tns:ADD_HDAINFResponse"/>

        </message>

   

      <!--========================================-->

      <!--============  PORTTYPE =================-->

      <!--========================================-->

      

      <portType name="ATSV100R100C02B050">

        <operation name="ADD_HDAINF">

              <input message="tns:ADD_HDAINFSoapIn"/>

              <output message="tns:ADD_HDAINFSoapOut"/>

              <fault message="tns:OperationFault" name="OperationFault"/>

          </operation>

      </portType>

   

      <!--========================================-->

      <!--============  BINDDING =================-->

      <!--========================================-->

      <binding name="ATSV100R100C02B050Binding" type="tns:ATSV100R100C02B050">

          <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>

          <operation name="ADD_HDAINF">

              <soap:operation soapAction="ATSV100R100C02B050#ADD_HDAINF"/>

              <input><soap:body use="literal"/></input>

              <output><soap:body use="literal"/></output>

              <fault name="OperationFault"><soap:fault name="OperationFault" use="literal"/></fault>

          </operation>

      </binding>

   

      <!--========================================-->

      <!--============  SERVICE ==================-->

      <!--========================================-->

      <service name="ATSV100R100C02B050">

          <port name="ATSV100R100C02B050Port" binding="tns:ATSV100R100C02B050Binding">

              <soap:address location="http://localhost:5002/axis/SoapGateway"/>

          </port>

      </service>

  </definitions>

   

  The problem is:

   

  When we send the following SOAP request:

   

  <?xmlversion="1.0" encoding="UTF-8"?>

  <soapenv:Envelope xmlns: soapenv="http://schemas.xmlsoap.org/soap/envelope/"xmlns:xsd="http://www.w3.org /2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">

        <soapenv:Body>

              <ADD_HDAINF xmlns="http://www.huawei.com/IMS/BMU">

                    <MEID xmlns="">82</MEID>

                    <USERNAME xmlns="">SPAuser</USERNAME>

                    <PASSWORD xmlns="">SPA123</PASSWORD>

                    <IMPI xmlns="">13405523</IMPI>

                    <HUSERNAME xmlns="">13405523</HUSERNAME>

                    <PWD xmlns="">13405523</PWD>

              </ADD_HDAINF>

        </soapenv:Body>

  </soapenv:Envelope>

   

  We get the following response:

   

  <?xmlversion='1.0' encoding='utf-8' ?>.

  <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">

        <SOAP-ENV:Body>

              <ns1:ADD_HDAINFResponse xmlns:ns1="http://www.huawei.com/IMS/BMU">

                    <ns1:Result>

                          <ns1:ResultCode>0</ns1:ResultCode>

                          <ns1:ResultDesc>Operation succeeded.</ns1:ResultDesc>

                    </ns1:Result>

              </ns1:ADD_HDAINFResponse>

        </SOAP-ENV:Body>

  </SOAP-ENV:Envelope >

   

  Which seems to be correct, but we get an error:

   

  org.xml.sax.SAXException: Invalid element in com.huawei.www.IMS.BMU.ResultType - ResultCode

        at org.apache.axis.encoding.ser.BeanDeserializer.onStartChild(BeanDeserializer.java:258)

        at org.apache.axis.encoding.DeserializationContext.startElement(DeserializationContext.java:1035)

        at org.apache.axis.message.SAX2EventRecorder.replay(SAX2EventRecorder.java:165)

        at org.apache.axis.message.MessageElement.publishToHandler(MessageElement.java:1141)

        at org.apache.axis.message.RPCElement.deserialize(RPCElement.java:236)

        at org.apache.axis.message.RPCElement.getParams(RPCElement.java:384)

        at org.apache.axis.client.Call.invoke(Call.java:2467)

        at org.apache.axis.client.Call.invoke(Call.java:2366)

        at org.apache.axis.client.Call.invoke(Call.java:1812)

        at com.huawei.www.IMS.BMU.ATSV100R100C02B050BindingStub.ADD_HDAINF(ATSV100R100C02B050BindingStub.java:1084)

        at com.huawei.www.IMS.BMU.ATSV100R100C02B050Proxy.ADD_HDAINF(ATSV100R100C02B050Proxy.java:50)

        at org.apache.jsp.sampleATSV100R100C02B050Proxy.Result_jsp._jspService(Result_jsp.java:188)

        at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)

        at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)

        at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:373)

        at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:336)

        at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265)

        at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)

        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)

        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)

        at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)

        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)

        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)

        at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:230)

        at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)

        at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:179)

        at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:84)

        at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)

        at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)

        at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:157)

        at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)

        at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:262)

        at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)

        at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)

        at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:446)

        at java.lang.Thread.run(Unknown Source)

   

   

  This is of course an XML parser error, so we tried to figure out which syntax is applicable for the Axis. After some tests we realized that the following answer is expected from the server by Axis:

      


  <?xml version='1.0' encoding='utf-8' ?>

  <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">

        <SOAP-ENV:Body>

              <ns1:ADD_HDAINFResponse xmlns:ns1="http://www.huawei.com/IMS/BMU">

                    <Result xmlns="">

                          <ResultCode>0</ResultCode>

                          <ResultDesc>Operation succeeded.</ResultDesc>

                    </Result>

              </ns1:ADD_HDAINFResponse>

        </SOAP-ENV:Body>

  </SOAP-ENV:Envelope >     

   

    The result is very interesting, because the parser can not handle the Result and its tags in the proper namespace.

   

  Have you any idea to solve this strange problem?

   

  Many thanks,

  Adam

___________________________
VÁSÁROLNA? SEGÍTÜNK! Igényeljen hitelkártyát online és élvezze Ön is a vásárlás szabadságát!


Re: Axis 1.4 namespace problem

Posted by Anne Thomas Manes <at...@gmail.com>.
Your schema indicates that the Result element should not be namespace
qualified. If you want the Result element to be namespace qualified,
you must declare it as a global element, or you must override the
default setting within the element declaration by adding the attribute
form="qualified", e.g.,

            <xsd:element name="ADD_HDAINFResponse">

                <xsd:complexType>

                    <xsd:sequence>

                         <xsd:element name="Result" form="qualified"
type="tns:ResultType"/>

                    </xsd:sequence>

                </xsd:complexType>

            </xsd:element>


Alternatively, if you want all local elements to be namespace
qualified, you can add this attribute to the schema declaration:
elementFormDefault="qualified".

Note that if you make this change, you would need to modify your input
message and qualify all your local elements.

Anne


2008/6/30 Gajdi Ádám <ma...@freemail.hu>:
>
> Hello,
>
>
>
> I would like to request a little help from you in our problem with a
> webservice client.
>
>
>
> We had to write a webservice client application, which talks with a server
> on SOAP protocol. The programing platform is naturally Java, thatâ019s why
> our choice for the SOAP communication was Axis 1.4 (Eclipse built-in).  The
> application server is Jboss 4.2.
>
>
>
> Our WSDL file:
>
>
>
> <?xml version="1.0" encoding="utf-8"?>
>
> <definitions
>
>     targetNamespace="http://www.huawei.com/IMS/BMU"
>
>     xmlns="http://schemas.xmlsoap.org/wsdl/"
>
>     xmlns:tns="http://www.huawei.com/IMS/BMU"
>
>     xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
>
>     xmlns:ns1="http://wombat.org"
>
>
>
>     <!--========================================-->
>
>     <!--============  TYPES ====================-->
>
>     <!--========================================-->
>
>     <types>
>
>         <xsd:schema targetNamespace="http://www.huawei.com/IMS/BMU">
>
>             <xsd:element name="ADD_HDAINF">
>
>                 <xsd:complexType>
>
>                     <xsd:sequence>
>
>                         <xsd:element name="MEID" type="xsd:unsignedShort"/>
>
>                         <xsd:element name="USERNAME" type="xsd:string"/>
>
>                         <xsd:element name="PASSWORD" type="xsd:string"/>
>
>                         <xsd:element name="IMPI" type="xsd:string"/>
>
>                         <xsd:element name="HUSERNAME" type="xsd:string"/>
>
>                         <xsd:element name="PWD" type="xsd:string"/>
>
>                     </xsd:sequence>
>
>                 </xsd:complexType>
>
>             </xsd:element>
>
>             <xsd:element name="ADD_HDAINFResponse">
>
>                 <xsd:complexType>
>
>                     <xsd:sequence>
>
>                          <xsd:element name="Result" type="tns:ResultType"/>
>
>                     </xsd:sequence>
>
>                 </xsd:complexType>
>
>             </xsd:element>
>
>        </xsd:schema>
>
>     </types>
>
>
>
>     <!--========================================-->
>
>     <!--============  MESSAGES =================-->
>
>     <!--========================================-->
>
>       <message name="ADD_HDAINFSoapIn">
>
>             <part name="parameters" element="tns:ADD_HDAINF"/>
>
>       </message>
>
>       <message name="ADD_HDAINFSoapOut">
>
>             <part name="parameters" element="tns:ADD_HDAINFResponse"/>
>
>       </message>
>
>
>
>     <!--========================================-->
>
>     <!--============  PORTTYPE =================-->
>
>     <!--========================================-->
>
>
>
>     <portType name="ATSV100R100C02B050">
>
>       <operation name="ADD_HDAINF">
>
>             <input message="tns:ADD_HDAINFSoapIn"/>
>
>             <output message="tns:ADD_HDAINFSoapOut"/>
>
>             <fault message="tns:OperationFault" name="OperationFault"/>
>
>         </operation>
>
>     </portType>
>
>
>
>     <!--========================================-->
>
>     <!--============  BINDDING =================-->
>
>     <!--========================================-->
>
>     <binding name="ATSV100R100C02B050Binding" type="tns:ATSV100R100C02B050">
>
>         <soap:binding style="document"
> transport="http://schemas.xmlsoap.org/soap/http"/>
>
>         <operation name="ADD_HDAINF">
>
>             <soap:operation soapAction="ATSV100R100C02B050#ADD_HDAINF"/>
>
>             <input><soap:body use="literal"/></input>
>
>             <output><soap:body use="literal"/></output>
>
>             <fault name="OperationFault"><soap:fault name="OperationFault"
> use="literal"/></fault>
>
>         </operation>
>
>     </binding>
>
>
>
>     <!--========================================-->
>
>     <!--============  SERVICE ==================-->
>
>     <!--========================================-->
>
>     <service name="ATSV100R100C02B050">
>
>         <port name="ATSV100R100C02B050Port"
> binding="tns:ATSV100R100C02B050Binding">
>
>             <soap:address
> location="http://localhost:5002/axis/SoapGateway"/>
>
>         </port>
>
>     </service>
>
> </definitions>
>
>
>
> The problem is:
>
>
>
> When we send the following SOAP request:
>
>
>
> <?xmlversion="1.0" encoding="UTF-8"?>
>
> <soapenv:Envelope xmlns:
> soapenv="http://schemas.xmlsoap.org/soap/envelope/"xmlns:xsd="http://www.w3.org
> /2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
>
>       <soapenv:Body>
>
>             <ADD_HDAINF xmlns="http://www.huawei.com/IMS/BMU">
>
>                   <MEID xmlns="">82</MEID>
>
>                   <USERNAME xmlns="">SPAuser</USERNAME>
>
>                   <PASSWORD xmlns="">SPA123</PASSWORD>
>
>                   <IMPI xmlns="">13405523</IMPI>
>
>                   <HUSERNAME xmlns="">13405523</HUSERNAME>
>
>                   <PWD xmlns="">13405523</PWD>
>
>             </ADD_HDAINF>
>
>       </soapenv:Body>
>
> </soapenv:Envelope>
>
>
>
> We get the following response:
>
>
>
> <?xmlversion='1.0' encoding='utf-8' ?>.
>
> <SOAP-ENV:Envelope
> xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
> xmlns:xsd="http://www.w3.org/2001/XMLSchema"
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
>
>       <SOAP-ENV:Body>
>
>             <ns1:ADD_HDAINFResponse
> xmlns:ns1="http://www.huawei.com/IMS/BMU">
>
>                   <ns1:Result>
>
>                         <ns1:ResultCode>0</ns1:ResultCode>
>
>                         <ns1:ResultDesc>Operation
> succeeded.</ns1:ResultDesc>
>
>                   </ns1:Result>
>
>             </ns1:ADD_HDAINFResponse>
>
>       </SOAP-ENV:Body>
>
> </SOAP-ENV:Envelope >
>
>
>
> Which seems to be correct, but we get an error:
>
>
>
> org.xml.sax.SAXException: Invalid element in
> com.huawei.www.IMS.BMU.ResultType - ResultCode
>
>       at
> org.apache.axis.encoding.ser.BeanDeserializer.onStartChild(BeanDeserializer.java:258)
>
>       at
> org.apache.axis.encoding.DeserializationContext.startElement(DeserializationContext.java:1035)
>
>       at
> org.apache.axis.message.SAX2EventRecorder.replay(SAX2EventRecorder.java:165)
>
>       at
> org.apache.axis.message.MessageElement.publishToHandler(MessageElement.java:1141)
>
>       at org.apache.axis.message.RPCElement.deserialize(RPCElement.java:236)
>
>       at org.apache.axis.message.RPCElement.getParams(RPCElement.java:384)
>
>       at org.apache.axis.client.Call.invoke(Call.java:2467)
>
>       at org.apache.axis.client.Call.invoke(Call.java:2366)
>
>       at org.apache.axis.client.Call.invoke(Call.java:1812)
>
>       at
> com.huawei.www.IMS.BMU.ATSV100R100C02B050BindingStub.ADD_HDAINF(ATSV100R100C02B050BindingStub.java:1084)
>
>       at
> com.huawei.www.IMS.BMU.ATSV100R100C02B050Proxy.ADD_HDAINF(ATSV100R100C02B050Proxy.java:50)
>
>       at
> org.apache.jsp.sampleATSV100R100C02B050Proxy.Result_jsp._jspService(Result_jsp.java:188)
>
>       at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
>
>       at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
>
>       at
> org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:373)
>
>       at
> org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:336)
>
>       at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265)
>
>       at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
>
>       at
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
>
>       at
> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
>
>       at
> org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
>
>       at
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
>
>       at
> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
>
>       at
> org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:230)
>
>       at
> org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
>
>       at
> org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:179)
>
>       at
> org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:84)
>
>       at
> org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
>
>       at
> org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
>
>       at
> org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:157)
>
>       at
> org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
>
>       at
> org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:262)
>
>       at
> org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
>
>       at
> org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
>
>       at
> org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:446)
>
>       at java.lang.Thread.run(Unknown Source)
>
>
>
>
>
> This is of course an XML parser error, so we tried to figure out which
> syntax is applicable for the Axis. After some tests we realized that the
> following answer is expected from the server by Axis:
>
>
>
> <?xml version='1.0' encoding='utf-8' ?>
>
> <SOAP-ENV:Envelope
> xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
> xmlns:xsd="http://www.w3.org/2001/XMLSchema"
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
>
>       <SOAP-ENV:Body>
>
>             <ns1:ADD_HDAINFResponse
> xmlns:ns1="http://www.huawei.com/IMS/BMU">
>
>                   <Result xmlns="">
>
>                         <ResultCode>0</ResultCode>
>
>                         <ResultDesc>Operation succeeded.</ResultDesc>
>
>                   </Result>
>
>             </ns1:ADD_HDAINFResponse>
>
>       </SOAP-ENV:Body>
>
> </SOAP-ENV:Envelope >
>
>
>
> The result is very interesting, because the parser can not handle the Result
> and its tags in the proper namespace.
>
>
>
> Have you any idea to solve this strange problem?
>
>
>
> Many thanks,
>
> Adam
>
> ________________________________________________________
> VÁSÁROLNA? SEGÍTÜNK! Igényeljen hitelkártyát online és élvezze Ön is a
> vásárlás szabadságát!

---------------------------------------------------------------------
To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-user-help@ws.apache.org