5 Replies Latest reply on May 31, 2011 4:53 PM by Mikheil Kapanadze

    NullPointerException in JBossXSEntityResolver.getXMLInputSource still happening in 5.1.0

    Andre Zelenkovas Newbie

      Hi

       

      I thought this was a fixed problem in JBoss 5.1.0, but I still got this when trying to consume a SOAP service provided by a .NET server. The exception occurs in the client service constructor. I used wsconsume to create the stub. I noticed the WSDL has a <s:import/> clause, but I removed that and still got the problem.

       

      Any ideas would be greatly appreciated.

       

      Here is the exception.

       

      java.lang.NullPointerException
              at org.jboss.ws.metadata.wsdl.xmlschema.JBossXSEntityResolver.getXMLInputSource(JBossXSEntityResolver.java:170)
              at org.jboss.ws.metadata.wsdl.xmlschema.JBossXSEntityResolver.resolveEntity(JBossXSEntityResolver.java:136)
              at org.apache.xerces.impl.XMLEntityManager.resolveEntity(Unknown Source)
              at org.apache.xerces.impl.xs.XMLSchemaLoader.resolveDocument(Unknown Source)
              at org.apache.xerces.impl.xs.traversers.XSDHandler.resolveSchema(Unknown Source)
              at org.apache.xerces.impl.xs.traversers.XSDHandler.constructTrees(Unknown Source)
              at org.apache.xerces.impl.xs.traversers.XSDHandler.parseSchema(Unknown Source)
              at org.apache.xerces.impl.xs.XMLSchemaLoader.loadSchema(Unknown Source)
              at org.apache.xerces.impl.xs.XMLSchemaLoader.loadGrammar(Unknown Source)
              at org.jboss.ws.tools.JavaToXSD.parseSchema(JavaToXSD.java:181)
              at org.jboss.ws.tools.wsdl.WSDL11Reader.processTypes(WSDL11Reader.java:451)
              at org.jboss.ws.tools.wsdl.WSDL11Reader.processDefinition(WSDL11Reader.java:180)
              at org.jboss.ws.tools.wsdl.WSDLDefinitionsFactory.parse(WSDLDefinitionsFactory.java:129)
              at org.jboss.ws.metadata.umdm.ServiceMetaData.getWsdlDefinitions(ServiceMetaData.java:293)
              at org.jboss.ws.metadata.builder.jaxws.JAXWSClientMetaDataBuilder.buildMetaData(JAXWSClientMetaDataBuilder.java:84)
              at org.jboss.ws.core.jaxws.spi.ServiceDelegateImpl.<init>(ServiceDelegateImpl.java:138)
              at org.jboss.ws.core.jaxws.spi.ProviderImpl.createServiceDelegate(ProviderImpl.java:63)
              at javax.xml.ws.Service.<init>(Service.java:79)
              at com.navteq.atg.lpup.targeting.cms.ws.client.Nmap.<init>(Nmap.java:41)
              at com.navteq.atg.lpup.targeting.cms.ws.client.CMSDataServiceClient.obtainServicePort(CMSDataServiceClient.java:73)
              at com.navteq.atg.lpup.targeting.cms.ws.client.CMSDataServiceClient.fetchConfigurationFromCMS(CMSDataServiceClient.java:24)
              at com.navteq.atg.lpup.targeting.cache.ws.CacheRefreshService.refreshConfiguration(CacheRefreshService.java:29)
              at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
              at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
              at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
              at java.lang.reflect.Method.invoke(Method.java:597)
              at org.jboss.wsf.container.jboss50.invocation.InvocationHandlerJSE.invoke(InvocationHandlerJSE.java:108)
              at org.jboss.ws.core.server.ServiceEndpointInvoker.invoke(ServiceEndpointInvoker.java:222)
              at org.jboss.wsf.stack.jbws.RequestHandlerImpl.processRequest(RequestHandlerImpl.java:474)
              at org.jboss.wsf.stack.jbws.RequestHandlerImpl.handleRequest(RequestHandlerImpl.java:295)
              at org.jboss.wsf.stack.jbws.RequestHandlerImpl.doPost(RequestHandlerImpl.java:205)
              at org.jboss.wsf.stack.jbws.RequestHandlerImpl.handleHttpRequest(RequestHandlerImpl.java:131)
              at org.jboss.wsf.common.servlet.AbstractEndpointServlet.service(AbstractEndpointServlet.java:85)
              at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
              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:235)
              at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
              at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:190)
              at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:92)
              at org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.process(SecurityContextEstablishmentValve.java:126)
              at org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.invoke(SecurityContextEstablishmentValve.java:70)
              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:158)
              at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
              at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:330)
              at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:829)
              at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:598)
              at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
              at java.lang.Thread.run(Thread.java:619)

       

      Here is the WSDL:

       

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

      <wsdl:definitions xmlns:s="http://www.w3.org/2001/XMLSchema" xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/" xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/" xmlns:tns="http://navteq.com/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tm="http://microsoft.com/wsdl/mime/textMatching/" xmlns:http="http://schemas.xmlsoap.org/wsdl/http/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" targetNamespace="http://navteq.com/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">

        <wsdl:types>

          <s:schema elementFormDefault="qualified" targetNamespace="http://navteq.com/">

            <s:import />

            <s:element name="GetNmapTargetingXml">

              <s:complexType />

            </s:element>

            <s:element name="GetNmapTargetingXmlResponse">

              <s:complexType>

       

                <s:sequence>

                  <s:element minOccurs="0" maxOccurs="1" ref="GetNmapTargetingXmlResult" />

                </s:sequence>

              </s:complexType>

            </s:element>

            <s:element name="GetAdvertisementNmapTargetingXmlMapping">

              <s:complexType />

            </s:element>

            <s:element name="GetAdvertisementNmapTargetingXmlMappingResponse">

       

              <s:complexType>

                <s:sequence>

                  <s:element minOccurs="0" maxOccurs="1" ref="GetAdvertisementNmapTargetingXmlMappingResult" />

                </s:sequence>

              </s:complexType>

            </s:element>

          </s:schema>

          <s:schema elementFormDefault="qualified">

            <s:element name="GetNmapTargetingXmlResult">

       

              <s:complexType>

                <s:sequence>

                  <s:element minOccurs="0" maxOccurs="unbounded" name="element">

                    <s:complexType>

                      <s:sequence>

                        <s:element minOccurs="0" maxOccurs="unbounded" name="allowedValue">

                          <s:complexType>

                            <s:attribute name="description" type="s:string" />

                            <s:attribute name="value" type="s:string" />

       

                          </s:complexType>

                        </s:element>

                      </s:sequence>

                      <s:attribute name="description" type="s:string" />

                      <s:attribute name="name" type="s:string" />

                      <s:attribute default="true" name="allowManyValuesInQuery" type="s:boolean" />

                      <s:attribute default="false" name="allowManyValuesInRequest" type="s:boolean" />

                    </s:complexType>

                  </s:element>

       

                </s:sequence>

              </s:complexType>

            </s:element>

            <s:element name="GetAdvertisementNmapTargetingXmlMappingResult">

              <s:complexType>

                <s:sequence>

                  <s:element minOccurs="0" maxOccurs="unbounded" name="advertisement">

                    <s:complexType>

                      <s:sequence>

       

                        <s:element minOccurs="1" maxOccurs="1" form="unqualified" name="id" type="s:long" />

                        <s:element minOccurs="0" maxOccurs="1" name="targetProfileList" type="ArrayOfTargetProfile" />

                      </s:sequence>

                    </s:complexType>

                  </s:element>

                </s:sequence>

              </s:complexType>

            </s:element>

            <s:complexType name="ArrayOfTargetProfile">

       

              <s:sequence>

                <s:element minOccurs="0" maxOccurs="unbounded" name="targetProfile">

                  <s:complexType>

                    <s:sequence>

                      <s:element minOccurs="1" maxOccurs="1" form="unqualified" name="required" type="s:boolean" />

                      <s:element minOccurs="0" maxOccurs="1" form="unqualified" name="name" type="s:string" />

                      <s:element minOccurs="0" maxOccurs="unbounded" form="unqualified" name="value" type="s:string" />

                    </s:sequence>

                  </s:complexType>

       

                </s:element>

              </s:sequence>

            </s:complexType>

            <s:element name="targeting">

              <s:complexType>

                <s:sequence>

                  <s:element minOccurs="0" maxOccurs="unbounded" name="element">

                    <s:complexType>

                      <s:sequence>

       

                        <s:element minOccurs="0" maxOccurs="unbounded" name="allowedValue">

                          <s:complexType>

                            <s:attribute name="description" type="s:string" />

                            <s:attribute name="value" type="s:string" />

                          </s:complexType>

                        </s:element>

                      </s:sequence>

                      <s:attribute name="description" type="s:string" />

                      <s:attribute name="name" type="s:string" />

       

                      <s:attribute default="true" name="allowManyValuesInQuery" type="s:boolean" />

                      <s:attribute default="false" name="allowManyValuesInRequest" type="s:boolean" />

                    </s:complexType>

                  </s:element>

                </s:sequence>

              </s:complexType>

            </s:element>

            <s:element name="advertisementList">

              <s:complexType>

       

                <s:sequence>

                  <s:element minOccurs="0" maxOccurs="unbounded" name="advertisement">

                    <s:complexType>

                      <s:sequence>

                        <s:element minOccurs="1" maxOccurs="1" form="unqualified" name="id" type="s:long" />

                        <s:element minOccurs="0" maxOccurs="1" name="targetProfileList" type="ArrayOfTargetProfile" />

                      </s:sequence>

                    </s:complexType>

                  </s:element>

       

                </s:sequence>

              </s:complexType>

            </s:element>

          </s:schema>

        </wsdl:types>

        <wsdl:message name="GetNmapTargetingXmlSoapIn">

          <wsdl:part name="parameters" element="tns:GetNmapTargetingXml" />

        </wsdl:message>

        <wsdl:message name="GetNmapTargetingXmlSoapOut">

       

          <wsdl:part name="parameters" element="tns:GetNmapTargetingXmlResponse" />

        </wsdl:message>

        <wsdl:message name="GetAdvertisementNmapTargetingXmlMappingSoapIn">

          <wsdl:part name="parameters" element="tns:GetAdvertisementNmapTargetingXmlMapping" />

        </wsdl:message>

        <wsdl:message name="GetAdvertisementNmapTargetingXmlMappingSoapOut">

          <wsdl:part name="parameters" element="tns:GetAdvertisementNmapTargetingXmlMappingResponse" />

        </wsdl:message>

        <wsdl:message name="GetNmapTargetingXmlHttpGetIn" />

       

        <wsdl:message name="GetNmapTargetingXmlHttpGetOut">

          <wsdl:part name="Body" element="targeting" />

        </wsdl:message>

        <wsdl:message name="GetAdvertisementNmapTargetingXmlMappingHttpGetIn" />

        <wsdl:message name="GetAdvertisementNmapTargetingXmlMappingHttpGetOut">

          <wsdl:part name="Body" element="advertisementList" />

        </wsdl:message>

        <wsdl:message name="GetNmapTargetingXmlHttpPostIn" />

        <wsdl:message name="GetNmapTargetingXmlHttpPostOut">

       

          <wsdl:part name="Body" element="targeting" />

        </wsdl:message>

        <wsdl:message name="GetAdvertisementNmapTargetingXmlMappingHttpPostIn" />

        <wsdl:message name="GetAdvertisementNmapTargetingXmlMappingHttpPostOut">

          <wsdl:part name="Body" element="advertisementList" />

        </wsdl:message>

        <wsdl:portType name="NmapSoap">

          <wsdl:operation name="GetNmapTargetingXml">

            <wsdl:input message="tns:GetNmapTargetingXmlSoapIn" />

       

            <wsdl:output message="tns:GetNmapTargetingXmlSoapOut" />

          </wsdl:operation>

          <wsdl:operation name="GetAdvertisementNmapTargetingXmlMapping">

            <wsdl:input message="tns:GetAdvertisementNmapTargetingXmlMappingSoapIn" />

            <wsdl:output message="tns:GetAdvertisementNmapTargetingXmlMappingSoapOut" />

          </wsdl:operation>

        </wsdl:portType>

        <wsdl:portType name="NmapHttpGet">

          <wsdl:operation name="GetNmapTargetingXml">

       

            <wsdl:input message="tns:GetNmapTargetingXmlHttpGetIn" />

            <wsdl:output message="tns:GetNmapTargetingXmlHttpGetOut" />

          </wsdl:operation>

          <wsdl:operation name="GetAdvertisementNmapTargetingXmlMapping">

            <wsdl:input message="tns:GetAdvertisementNmapTargetingXmlMappingHttpGetIn" />

            <wsdl:output message="tns:GetAdvertisementNmapTargetingXmlMappingHttpGetOut" />

          </wsdl:operation>

        </wsdl:portType>

        <wsdl:portType name="NmapHttpPost">

       

          <wsdl:operation name="GetNmapTargetingXml">

            <wsdl:input message="tns:GetNmapTargetingXmlHttpPostIn" />

            <wsdl:output message="tns:GetNmapTargetingXmlHttpPostOut" />

          </wsdl:operation>

          <wsdl:operation name="GetAdvertisementNmapTargetingXmlMapping">

            <wsdl:input message="tns:GetAdvertisementNmapTargetingXmlMappingHttpPostIn" />

            <wsdl:output message="tns:GetAdvertisementNmapTargetingXmlMappingHttpPostOut" />

          </wsdl:operation>

        </wsdl:portType>

       

        <wsdl:binding name="NmapSoap" type="tns:NmapSoap">

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

          <wsdl:operation name="GetNmapTargetingXml">

            <soap:operation soapAction="http://navteq.com/GetNmapTargetingXml" style="document" />

            <wsdl:input>

              <soap:body use="literal" />

            </wsdl:input>

            <wsdl:output>

              <soap:body use="literal" />

       

            </wsdl:output>

          </wsdl:operation>

          <wsdl:operation name="GetAdvertisementNmapTargetingXmlMapping">

            <soap:operation soapAction="http://navteq.com/GetAdvertisementNmapTargetingXmlMapping" style="document" />

            <wsdl:input>

              <soap:body use="literal" />

            </wsdl:input>

            <wsdl:output>

              <soap:body use="literal" />

       

            </wsdl:output>

          </wsdl:operation>

        </wsdl:binding>

        <wsdl:binding name="NmapSoap12" type="tns:NmapSoap">

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

          <wsdl:operation name="GetNmapTargetingXml">

            <soap12:operation soapAction="http://navteq.com/GetNmapTargetingXml" style="document" />

            <wsdl:input>

              <soap12:body use="literal" />

       

            </wsdl:input>

            <wsdl:output>

              <soap12:body use="literal" />

            </wsdl:output>

          </wsdl:operation>

          <wsdl:operation name="GetAdvertisementNmapTargetingXmlMapping">

            <soap12:operation soapAction="http://navteq.com/GetAdvertisementNmapTargetingXmlMapping" style="document" />

            <wsdl:input>

              <soap12:body use="literal" />

       

            </wsdl:input>

            <wsdl:output>

              <soap12:body use="literal" />

            </wsdl:output>

          </wsdl:operation>

        </wsdl:binding>

        <wsdl:binding name="NmapHttpGet" type="tns:NmapHttpGet">

          <http:binding verb="GET" />

          <wsdl:operation name="GetNmapTargetingXml">

       

            <http:operation location="/GetNmapTargetingXml" />

            <wsdl:input>

              <http:urlEncoded />

            </wsdl:input>

            <wsdl:output>

              <mime:mimeXml part="Body" />

            </wsdl:output>

          </wsdl:operation>

          <wsdl:operation name="GetAdvertisementNmapTargetingXmlMapping">

       

            <http:operation location="/GetAdvertisementNmapTargetingXmlMapping" />

            <wsdl:input>

              <http:urlEncoded />

            </wsdl:input>

            <wsdl:output>

              <mime:mimeXml part="Body" />

            </wsdl:output>

          </wsdl:operation>

        </wsdl:binding>

       

        <wsdl:binding name="NmapHttpPost" type="tns:NmapHttpPost">

          <http:binding verb="POST" />

          <wsdl:operation name="GetNmapTargetingXml">

            <http:operation location="/GetNmapTargetingXml" />

            <wsdl:input>

              <mime:content type="application/x-www-form-urlencoded" />

            </wsdl:input>

            <wsdl:output>

              <mime:mimeXml part="Body" />

       

            </wsdl:output>

          </wsdl:operation>

          <wsdl:operation name="GetAdvertisementNmapTargetingXmlMapping">

            <http:operation location="/GetAdvertisementNmapTargetingXmlMapping" />

            <wsdl:input>

              <mime:content type="application/x-www-form-urlencoded" />

            </wsdl:input>

            <wsdl:output>

              <mime:mimeXml part="Body" />

       

            </wsdl:output>

          </wsdl:operation>

        </wsdl:binding>

        <wsdl:service name="Nmap">

          <wsdl:port name="NmapSoap" binding="tns:NmapSoap">

            <soap:address location="http://intlbabe4.ilapqa.local/nmapcms/nmap.asmx" />

          </wsdl:port>

          <wsdl:port name="NmapSoap12" binding="tns:NmapSoap12">

            <soap12:address location="http://intlbabe4.ilapqa.local/nmapcms/nmap.asmx" />

       

          </wsdl:port>

          <wsdl:port name="NmapHttpGet" binding="tns:NmapHttpGet">

            <http:address location="http://intlbabe4.ilapqa.local/nmapcms/nmap.asmx" />

          </wsdl:port>

          <wsdl:port name="NmapHttpPost" binding="tns:NmapHttpPost">

            <http:address location="http://intlbabe4.ilapqa.local/nmapcms/nmap.asmx" />

          </wsdl:port>

        </wsdl:service>

      </wsdl:definitions>

       

       

      Thanks

      Andre

        • 1. Re: NullPointerException in JBossXSEntityResolver.getXMLInputSource still happening in 5.1.0
          Jim Ma Apprentice

          The wsdl with <s:import /> is definitely invalid . But even if the <s:import>  is removed, it is still invalid. The referenced element/type is missing. So it is the fault of .NET server or the service deployed in .NET server.

          • 2. Re: NullPointerException in JBossXSEntityResolver.getXMLInputSource still happening in 5.1.0
            Andre Zelenkovas Newbie

            Thanks a million for pointing that out!

             

            Is it fair to say that the minimum requirement for a WSDL contract to be properly consumed by JBossWS is for the WSDL to be valid, and, if the WSDL is invalid, the behaviour is undetermined? I'm asking this because we changed the WSDL to simply return a string, and the new WSDL is still invalid, but it works now. However, we can't expect it to work going forward if the WSDL is changed. Incidentally, the original WSDL is consumed with no problems by the JAX-WS reference implementation in standalone mode.

             

            Here's the new WSDL:

             

            <?xml version="1.0" encoding="utf-8"?>
            <wsdl:definitions xmlns:s="http://www.w3.org/2001/XMLSchema" xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/" xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/" xmlns:tns="http://navteq.com/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tm="http://microsoft.com/wsdl/mime/textMatching/" xmlns:http="http://schemas.xmlsoap.org/wsdl/http/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" targetNamespace="http://navteq.com/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">
              <wsdl:types>
                <s:schema elementFormDefault="qualified" targetNamespace="http://navteq.com/">
                  <s:element name="GetNmapTargetingXml">
                    <s:complexType />
                  </s:element>
                  <s:element name="GetNmapTargetingXmlResponse">
                    <s:complexType>
                      <s:sequence>

             

                        <s:element minOccurs="0" maxOccurs="1" name="GetNmapTargetingXmlResult" type="s:string" />
                      </s:sequence>
                    </s:complexType>
                  </s:element>
                  <s:element name="GetAdvertisementNmapTargetingXmlMapping">
                    <s:complexType />
                  </s:element>
                  <s:element name="GetAdvertisementNmapTargetingXmlMappingResponse">
                    <s:complexType>

             

                      <s:sequence>
                        <s:element minOccurs="0" maxOccurs="1" name="GetAdvertisementNmapTargetingXmlMappingResult" type="s:string" />
                      </s:sequence>
                    </s:complexType>
                  </s:element>
                  <s:element name="string" nillable="true" type="s:string" />
                </s:schema>
              </wsdl:types>
              <wsdl:message name="GetNmapTargetingXmlSoapIn">

             

                <wsdl:part name="parameters" element="tns:GetNmapTargetingXml" />
              </wsdl:message>
              <wsdl:message name="GetNmapTargetingXmlSoapOut">
                <wsdl:part name="parameters" element="tns:GetNmapTargetingXmlResponse" />
              </wsdl:message>
              <wsdl:message name="GetAdvertisementNmapTargetingXmlMappingSoapIn">
                <wsdl:part name="parameters" element="tns:GetAdvertisementNmapTargetingXmlMapping" />
              </wsdl:message>
              <wsdl:message name="GetAdvertisementNmapTargetingXmlMappingSoapOut">

             

                <wsdl:part name="parameters" element="tns:GetAdvertisementNmapTargetingXmlMappingResponse" />
              </wsdl:message>
              <wsdl:message name="GetNmapTargetingXmlHttpGetIn" />
              <wsdl:message name="GetNmapTargetingXmlHttpGetOut">
                <wsdl:part name="Body" element="tns:string" />
              </wsdl:message>
              <wsdl:message name="GetAdvertisementNmapTargetingXmlMappingHttpGetIn" />
              <wsdl:message name="GetAdvertisementNmapTargetingXmlMappingHttpGetOut">
                <wsdl:part name="Body" element="tns:string" />

             

              </wsdl:message>
              <wsdl:message name="GetNmapTargetingXmlHttpPostIn" />
              <wsdl:message name="GetNmapTargetingXmlHttpPostOut">
                <wsdl:part name="Body" element="tns:string" />
              </wsdl:message>
              <wsdl:message name="GetAdvertisementNmapTargetingXmlMappingHttpPostIn" />
              <wsdl:message name="GetAdvertisementNmapTargetingXmlMappingHttpPostOut">
                <wsdl:part name="Body" element="tns:string" />

              </wsdl:message>

             

              <wsdl:portType name="NmapSoap">
                <wsdl:operation name="GetNmapTargetingXml">
                  <wsdl:input message="tns:GetNmapTargetingXmlSoapIn" />
                  <wsdl:output message="tns:GetNmapTargetingXmlSoapOut" />
                </wsdl:operation>
                <wsdl:operation name="GetAdvertisementNmapTargetingXmlMapping">
                  <wsdl:input message="tns:GetAdvertisementNmapTargetingXmlMappingSoapIn" />
                  <wsdl:output message="tns:GetAdvertisementNmapTargetingXmlMappingSoapOut" />
                </wsdl:operation>

             

              </wsdl:portType>
              <wsdl:portType name="NmapHttpGet">
                <wsdl:operation name="GetNmapTargetingXml">
                  <wsdl:input message="tns:GetNmapTargetingXmlHttpGetIn" />
                  <wsdl:output message="tns:GetNmapTargetingXmlHttpGetOut" />
                </wsdl:operation>
                <wsdl:operation name="GetAdvertisementNmapTargetingXmlMapping">
                  <wsdl:input message="tns:GetAdvertisementNmapTargetingXmlMappingHttpGetIn" />
                  <wsdl:output message="tns:GetAdvertisementNmapTargetingXmlMappingHttpGetOut" />

             

                </wsdl:operation>
              </wsdl:portType>
              <wsdl:portType name="NmapHttpPost">
                <wsdl:operation name="GetNmapTargetingXml">
                  <wsdl:input message="tns:GetNmapTargetingXmlHttpPostIn" />
                  <wsdl:output message="tns:GetNmapTargetingXmlHttpPostOut" />
                </wsdl:operation>
                <wsdl:operation name="GetAdvertisementNmapTargetingXmlMapping">
                  <wsdl:input message="tns:GetAdvertisementNmapTargetingXmlMappingHttpPostIn" />

             

                  <wsdl:output message="tns:GetAdvertisementNmapTargetingXmlMappingHttpPostOut" />
                </wsdl:operation>
              </wsdl:portType>
              <wsdl:binding name="NmapSoap" type="tns:NmapSoap">
                <soap:binding transport="http://schemas.xmlsoap.org/soap/http" />
                <wsdl:operation name="GetNmapTargetingXml">
                  <soap:operation soapAction="http://navteq.com/GetNmapTargetingXml" style="document" />
                  <wsdl:input>
                    <soap:body use="literal" />

             

                  </wsdl:input>
                  <wsdl:output>
                    <soap:body use="literal" />
                  </wsdl:output>
                </wsdl:operation>
                <wsdl:operation name="GetAdvertisementNmapTargetingXmlMapping">
                  <soap:operation soapAction="http://navteq.com/GetAdvertisementNmapTargetingXmlMapping" style="document" />
                  <wsdl:input>
                    <soap:body use="literal" />

             

                  </wsdl:input>
                  <wsdl:output>
                    <soap:body use="literal" />
                  </wsdl:output>
                </wsdl:operation>
              </wsdl:binding>
              <wsdl:binding name="NmapSoap12" type="tns:NmapSoap">
                <soap12:binding transport="http://schemas.xmlsoap.org/soap/http" />
                <wsdl:operation name="GetNmapTargetingXml">

             

                  <soap12:operation soapAction="http://navteq.com/GetNmapTargetingXml" style="document" />
                  <wsdl:input>
                    <soap12:body use="literal" />
                  </wsdl:input>
                  <wsdl:output>
                    <soap12:body use="literal" />
                  </wsdl:output>
                </wsdl:operation>
                <wsdl:operation name="GetAdvertisementNmapTargetingXmlMapping">

             

                  <soap12:operation soapAction="http://navteq.com/GetAdvertisementNmapTargetingXmlMapping" style="document" />
                  <wsdl:input>
                    <soap12:body use="literal" />
                  </wsdl:input>
                  <wsdl:output>
                    <soap12:body use="literal" />
                  </wsdl:output>
                </wsdl:operation>
              </wsdl:binding>

             

              <wsdl:binding name="NmapHttpGet" type="tns:NmapHttpGet">
                <http:binding verb="GET" />
                <wsdl:operation name="GetNmapTargetingXml">
                  <http:operation location="/GetNmapTargetingXml" />
                  <wsdl:input>
                    <http:urlEncoded />
                  </wsdl:input>
                  <wsdl:output>
                    <mime:mimeXml part="Body" />

             

                  </wsdl:output>
                </wsdl:operation>
                <wsdl:operation name="GetAdvertisementNmapTargetingXmlMapping">
                  <http:operation location="/GetAdvertisementNmapTargetingXmlMapping" />
                  <wsdl:input>
                    <http:urlEncoded />
                  </wsdl:input>
                  <wsdl:output>
                    <mime:mimeXml part="Body" />

             

                  </wsdl:output>
                </wsdl:operation>
              </wsdl:binding>
              <wsdl:binding name="NmapHttpPost" type="tns:NmapHttpPost">
                <http:binding verb="POST" />
                <wsdl:operation name="GetNmapTargetingXml">
                  <http:operation location="/GetNmapTargetingXml" />
                  <wsdl:input>
                    <mime:content type="application/x-www-form-urlencoded" />

             

                  </wsdl:input>
                  <wsdl:output>
                    <mime:mimeXml part="Body" />
                  </wsdl:output>
                </wsdl:operation>
                <wsdl:operation name="GetAdvertisementNmapTargetingXmlMapping">
                  <http:operation location="/GetAdvertisementNmapTargetingXmlMapping" />
                  <wsdl:input>
                    <mime:content type="application/x-www-form-urlencoded" />

             

                  </wsdl:input>
                  <wsdl:output>
                    <mime:mimeXml part="Body" />
                  </wsdl:output>
                </wsdl:operation>
              </wsdl:binding>
              <wsdl:service name="Nmap">
                <wsdl:port name="NmapSoap" binding="tns:NmapSoap">
                  <soap:address location="http://intlbabe4.ilapqa.local/nmapcms/nmap.asmx" />

             

                </wsdl:port>
                <wsdl:port name="NmapSoap12" binding="tns:NmapSoap12">
                  <soap12:address location="http://intlbabe4.ilapqa.local/nmapcms/nmap.asmx" />
                </wsdl:port>
                <wsdl:port name="NmapHttpGet" binding="tns:NmapHttpGet">
                  <http:address location="http://intlbabe4.ilapqa.local/nmapcms/nmap.asmx" />
                </wsdl:port>
                <wsdl:port name="NmapHttpPost" binding="tns:NmapHttpPost">
                  <http:address location="http://intlbabe4.ilapqa.local/nmapcms/nmap.asmx" />

             

                </wsdl:port>
              </wsdl:service>
            </wsdl:definitions>

            • 3. Re: NullPointerException in JBossXSEntityResolver.getXMLInputSource still happening in 5.1.0
              Jim Ma Apprentice
              Is it fair to say that the minimum requirement for a WSDL contract to be  properly consumed by JBossWS is for the WSDL to be valid, and, if the  WSDL is invalid, the behaviour is undetermined? I'm asking this because  we changed the WSDL to simply return a string, and the new WSDL is still  invalid, but it works now.

              Yes. Exactly. Wsimport tool will treat the input wsdl as the valid one . Even the wsimport can generate code for the invalid wsdl without error, it still can not make sure it can be published/consume webservice service successfully. We need to make some enhancement in our documentation here to tell user the wsimport tool only accepts the valid wsdl , and suggest user uses eclipse WTP tool or other tool to validate wsdl before running the wsimport tool .

               

              However, we can't expect it to work going  forward if the WSDL is changed. Incidentally, the original WSDL is  consumed with no problems by the JAX-WS reference implementation in  standalone mode.

              Is this original wsdl consumed by JBoss5.1.0 without problems too ?

              • 4. Re: NullPointerException in JBossXSEntityResolver.getXMLInputSource still happening in 5.1.0
                Andre Zelenkovas Newbie

                No, the original WSDL threw that exception in JBoss, but it worked fine on a standalone JAX-WS client using the reference implementation. I guess it isn't really JBoss's fault that it doesn't work since the WSDL is invalid, but I would really appreciate a better error message instead of a NullPointerException. I guess wsconsume could simply stop the client generation if the WSDL is invalid, or the JBossXS runtime could give me a message that the schema doesn't make sense etc.

                 

                Andre

                • 5. Re: NullPointerException in JBossXSEntityResolver.getXMLInputSource still happening in 5.1.0
                  Mikheil Kapanadze Newbie

                  I had this error today, but on older JBoss (4.2.3). WSDL was a bit complex but not wrong (it was auto-generated from EJB, deployed on JBoss 5.1.0 - both wsimport and wsconsume were OK with it.

                   

                  I'll describe how I have fixed it for myself. Maybe it will be helpful for anyone.

                   

                  I had to create web service client and add to some application, deployed on 4.2.3. I've generated classes using wsimport and created the client. After that, I got the above mentioned error.

                   

                  As everyone knows, when you generate JAX-WS classes, wsimport uses absolute path of the filename in the ***Service.java. It looks like this:

                   

                  @WebServiceClient(name = "MyService", targetNamespace = "http://www.example.com/NS/my-NS", wsdlLocation = "file:/D:/path/to/wsdl/Service.wsdl")

                   

                  and the same path exists after few lines, in static initialization block.

                   

                  When you deploy the application on the server, in most cases the pathname will be incorrect. To avoid this, I often place my .wsdl files in the package and create service class using MyService(URL wsdlLocation, QName serviceName) constructor but today it caused NPE for me.

                   

                  I have tried to make above mentioned static initialization block and @WebServiceClient annotation little bit usable. Here are steps:

                  1. Choose name of your package where wsimport will place generated classes. Say, com.mikheil.demo.ws.client
                  2. Put your WSDL in classpath, inside the SAME package. Let's suppose it's name is MyService.wsdl
                  3. When executing wsimport, pass -wsdllocation MyService.wsdl to it

                   

                  I use Maven and plugin parameter there is wsdlLocation

                   

                  So, here is how my service looks like:

                   

                   

                  @WebServiceClient(name = "MyService", targetNamespace = "http://www.example.com/NS/my-NS", wsdlLocation = "MyService.wsdl")

                  public class MyService

                      extends Service

                  {

                   

                      private final static URL MYSERVICE_WSDL_LOCATION;

                      private final static Logger logger = Logger.getLogger(com.mikheil.demo.ws.client.MyService.class.getName());

                   

                      static {

                          URL url = null;

                          try {

                              URL baseUrl;

                              baseUrl = com.mikheil.demo.ws.client.MyService.class.getResource(".");

                              url = new URL(baseUrl, "MyService.wsdl");

                          } catch (MalformedURLException e) {

                              logger.warning("Failed to create URL for the wsdl Location: 'MyService.wsdl', retrying as a local file");

                              logger.warning(e.getMessage());

                          }

                          URL MYSERVICE_WSDL_LOCATION; = url;

                      }

                   

                  // Some constructors, etc

                   

                   

                  }

                   

                  Obviously, now it's possible to create web service client using default constructor.

                   

                  ...And, NullPointerException disappeared too!