JBoss Community

JBoss Newbie Question

created by developer.gubler in JBoss Web Services Development - View the full discussion

I am new to JBoss and web services.  I am having difficulty deploying a sample web service on JBoss.  The sample web service has a JAXB response.  The environment I am working with:

 

JBoss 5.1.0

JBossWS Native 3.4.0

 

What I have done:

   1.  Created a XSD for the response

 

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

<schema xmlns="http://www.w3.org/2001/XMLSchema"

        xmlns:xsd="http://www.w3.org/2001/XMLSchema"

        xmlns:jxb="http://java.sun.com/xml/ns/jaxb"

        jxb:version="2.0"

        xmlns:tns="http://www.dstsystems.com/GreetingResponse"

        targetNamespace="http://www.dstsystems.com/GreetingResponse"

        elementFormDefault="qualified">

 

    <xsd:element name="GreetingResponse">

        <xsd:complexType>

            <xsd:sequence>

                <xsd:element minOccurs="0" name="language" type="xsd:string" />

                <xsd:element minOccurs="0" name="person" type="xsd:string" />

            </xsd:sequence>

        </xsd:complexType>

    </xsd:element>

 

</schema>

 

   2.  Run XJC to create the JAXB classes

   3.  Created my SEI

package tutorial.hanbo.webservice;

 

import java.io.StringReader;

 

import javax.jws.WebMethod;

import javax.jws.WebService;

import javax.xml.bind.JAXBContext;

 

@WebService

public class Greeting

{

    @WebMethod

    public GreetingResponse greetClient(String userName)

    {

        GreetingResponse response = null;

 

        try

        {

            JAXBContext ctxResponse = JAXBContext.newInstance( "tutorial.hanbo.webservice" );

            response = (GreetingResponse)ctxResponse.createUnmarshaller().unmarshal( new StringReader( "<GreetingResponse><language>English</language><person>" + userName + "</person></GreetingResponse>" ) );

        }

        catch ( Exception e )

        {

            e.printStackTrace();

        }

 

        return response;

    }

}

 

   4.  Created a WAR file

   5.  Deployed my application

 

Everything works fine until I try to deploy it.  When I try to deploy it, I get the following error messages:

 

12:54:15,312 ERROR [JBossXSErrorHandler] JBossWS_webservice.hanbo.tutorial_3255632659267054358.xsd[domain:http://www.w3.org/TR/xml-s

chema-1]::[key=src-resolve]::Message=src-resolve: Cannot resolve the name 'ns1:language' to a(n) 'element declaration' component.

12:54:15,312 ERROR [JBossXSErrorHandler] JBossWS_webservice.hanbo.tutorial_3255632659267054358.xsd[domain:http://www.w3.org/TR/xml-s

chema-1]::[key=src-resolve]::Message=src-resolve: Cannot resolve the name 'ns1:person' to a(n) 'element declaration' component.

12:54:15,328 INFO  [WSDLFilePublisher] WSDL published to: file:/C:/JBoss/jboss-5.1.0.GA/server/default/data/wsdl/WS-Example.war/Gree

tingService5953674029938406316.wsdl

 

Does the above error messages indicate that the Abstract Contract (i.e. wsdl + schema) is being generated incorrectly or am I doing something incorrectly?

 

Thanks,

dg

Newbie JBoss User

Reply to this message by going to Community

Start a new discussion in JBoss Web Services Development at Community