[jboss-user] [JBossWS] - error 'prefix xsz is not bound to a namespace" on xsi:type="

barny451 do-not-reply at jboss.com
Mon Feb 18 10:33:07 EST 2008


Using JBoss 4.2.0GA with Eclipse Europa (3.3) on WinXP Pro.

I' working on a demo webservice which has an AddPayee operation, invoked as in this SOAP request from SoapUI:

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsda="http://localhost:8080/SecondBank/OnlineBanking/xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsz="http://www.w3.org/2001/XMLSchema">
   <soapenv:Header/>
   <soapenv:Body>
      <xsda:AddPayee>
         <xsda:payee>
            <xsda:name>?</xsda:name>
            <xsda:address1>?</xsda:address1>
            <!--Optional:-->
            <xsda:address2>?</xsda:address2>
            <!--Optional:-->
            <xsda:address3>?</xsda:address3>
            <xsda:city>?</xsda:city>
            <xsda:state>?</xsda:state>
            <xsda:zip>?</xsda:zip>
            <xsda:phoneAreaCode xsi:type="xsz:int">0</xsda:phoneAreaCode>
            <xsda:phonePrefix>0</xsda:phonePrefix>
            <xsda:phoneSuffix>0</xsda:phoneSuffix>
            <xsda:accountToPay>?</xsda:accountToPay>
            <xsda:nameOnBill>?</xsda:nameOnBill>
            <xsda:alias>?</xsda:alias>
         </xsda:payee>
         <xsda:token>?</xsda:token>
      </xsda:AddPayee>
   </soapenv:Body>
</soapenv:Envelope>

This request always gives a soap error:

<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
   <SOAP-ENV:Header/>
   <SOAP-ENV:Body>
      <SOAP-ENV:Fault>
         SOAP-ENV:Server
         prefix xsz is not bound to a namespace
      </SOAP-ENV:Fault>
   </SOAP-ENV:Body>
</SOAP-ENV:Envelope>

But if I remove the xsi:type="xsz:int" attribute from the xsda:phoneAreaCode tag I don't get the error.  Any idea why?

Here's the essential wsdl content of the service (I've removed irrelevant operations/types):

<wsdl:definitions name="OnlineBanking" targetNamespace="http://localhost:8080/SecondBank/OnlineBanking" xmlns="http://schemas.xmlsoap.org/wsdl/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:tns="http://localhost:8080/SecondBank/OnlineBanking" xmlns:xsd1="http://localhost:8080/SecondBank/OnlineBanking/xsd" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:con="http://eviware.com/soapui/config">
   <!--Types-->
   <wsdl:types>
      <xsd:schema targetNamespace="http://localhost:8080/SecondBank/OnlineBanking/xsd" elementFormDefault="qualified" xmlns="http://www.w3.org/2001/XMLSchema">
         <xsd:complexType name="Payee">
            <xsd:sequence>
               <xsd:element minOccurs="1" maxOccurs="1" name="name" type="xsd:string"/>
               <xsd:element minOccurs="1" maxOccurs="1" name="address1" type="xsd:string"/>
               <xsd:element minOccurs="0" maxOccurs="1" name="address2" type="xsd:string"/>
               <xsd:element minOccurs="0" maxOccurs="1" name="address3" type="xsd:string"/>
               <xsd:element minOccurs="1" maxOccurs="1" name="city" type="xsd:string"/>
               <xsd:element minOccurs="1" maxOccurs="1" name="state" type="xsd:string"/>
               <xsd:element minOccurs="1" maxOccurs="1" name="zip" type="xsd:string"/>
               <xsd:element minOccurs="1" maxOccurs="1" name="phoneAreaCode" type="xsd:int"/>
               <xsd:element minOccurs="1" maxOccurs="1" name="phonePrefix" type="xsd:int"/>
               <xsd:element minOccurs="1" maxOccurs="1" name="phoneSuffix" type="xsd:int"/>
               <xsd:element minOccurs="1" maxOccurs="1" name="accountToPay" type="xsd:string"/>
               <xsd:element minOccurs="1" maxOccurs="1" name="nameOnBill" type="xsd:string"/>
               <xsd:element minOccurs="1" maxOccurs="1" name="alias" type="xsd:string"/>
            </xsd:sequence>
         </xsd:complexType>
      </xsd:schema>
   </wsdl:types>
   <!--Messages-->
   <wsdl:message name="AddPayee">
      <wsdl:part name="parameters" element="xsd1:AddPayee"/>
   </wsdl:message>
   <wsdl:message name="AddPayeeResponse">
      <wsdl:part name="parameters" element="xsd1:AddPayeeResponse"/>
   </wsdl:message>
   <!--Port type-->
   <wsdl:portType name="OnlineBankingPortType">
      <wsdl:operation name="AddPayee">
         <wsdl:input message="tns:AddPayee"/>
         <wsdl:output message="tns:AddPayeeResponse"/>
      </wsdl:operation>
   </wsdl:portType>
   <!--Binding-->
   <wsdl:binding name="OnlineBankingPortBinding" type="tns:OnlineBankingPortType">
      <soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="document"/>
      <wsdl:operation name="AddPayee">
         <soap:operation soapAction="http://localhost:8080/SecondBank/OnlineBanking/AddPayee" style="document"/>
         <wsdl:input>
            <soap:body use="literal"/>
         </wsdl:input>
         <wsdl:output>
            <soap:body use="literal"/>
         </wsdl:output>
      </wsdl:operation>
   </wsdl:binding>
   <!--Service-->
   <wsdl:service name="OnlineBankingService">
      <wsdl:port name="OnlineBankingPort" binding="tns:OnlineBankingPortBinding">
         <soap:address location="http://localhost:8080/SecondBank/services"/>
      </wsdl:port>
   </wsdl:service>
</wsdl:definitions>

I'm trying to debug a problem where the app I'm using is automatically applying xsi:type attributes to every parameter of the operation.  There's no problem with parameters defined as xsd:string having xsi:type="xsz:string", just with values which are defined as xsd:int which have xsi:type="xsz:int" in the SOAP request.

Regards
Barny


View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4130142#4130142

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4130142



More information about the jboss-user mailing list