<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<body link="#355491" alink="#4262a1" vlink="#355491" style="background: #e2e2e2; margin: 0; padding: 20px;">

<div>
        <table cellpadding="0" bgcolor="#FFFFFF" border="0" cellspacing="0" style="border: 1px solid #dadada; margin-bottom: 30px; width: 100%; -moz-border-radius: 6px; -webkit-border-radius: 6px;">
                <tbody>
                        <tr>

                                <td>

                                        <table border="0" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF" style="border: solid 2px #ccc; background: #dadada; width: 100%; -moz-border-radius: 6px; -webkit-border-radius: 6px;">
                                                <tbody>
                                                        <tr>
                                                                <td bgcolor="#000000" valign="middle" height="58px" style="border-bottom: 1px solid #ccc; padding: 20px; -moz-border-radius-topleft: 3px; -moz-border-radius-topright: 3px; -webkit-border-top-right-radius: 5px; -webkit-border-top-left-radius: 5px;">
                                                                        <h1 style="color: #333333; font: bold 22px Arial, Helvetica, sans-serif; margin: 0; display: block !important;">
                                                                        <!-- To have a header image/logo replace the name below with your img tag -->
                                                                        <!-- Email clients will render the images when the message is read so any image -->
                                                                        <!-- must be made available on a public server, so that all recipients can load the image. -->
                                                                        <a href="http://community.jboss.org/index.jspa" style="text-decoration: none; color: #E1E1E1">JBoss Community</a></h1>
                                                                </td>

                                                        </tr>
                                                        <tr>
                                                                <td bgcolor="#FFFFFF" style="font: normal 12px Arial, Helvetica, sans-serif; color:#333333; padding: 20px;  -moz-border-radius-bottomleft: 4px; -moz-border-radius-bottomright: 4px; -webkit-border-bottom-right-radius: 5px; -webkit-border-bottom-left-radius: 5px;"><h3 style="margin: 10px 0 5px; font-size: 17px; font-weight: normal;">
    JBoss Newbie Question
</h3>
<span style="margin-bottom: 10px;">
    created by <a href="http://community.jboss.org/people/developer.gubler">developer.gubler</a> in <i>Beginner's Corner</i> - <a href="http://community.jboss.org/message/614526#614526">View the full discussion</a>
</span>
<hr style="margin: 20px 0; border: none; background-color: #dadada; height: 1px;">

<div class="jive-rendered-content"><p>I am new to JBoss and web services.&#160; I am having difficulty deploying a sample web service on JBoss.&#160; The sample web service has a JAXB response.&#160; The environment I am working with:</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>JBoss 5.1.0</p><p>JBossWS Native 3.4.0</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>What I have done:</p><p style="text-align: start;">&#160;&#160; 1.&#160; Created a XSD for the response</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>&lt;?xml version="1.0" encoding="UTF-8"?&gt;</p><p>&lt;schema xmlns="<a class="jive-link-external-small" href="http://www.w3.org/2001/XMLSchema" target="_blank">http://www.w3.org/2001/XMLSchema</a>"</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160; xmlns:xsd="<a class="jive-link-external-small" href="http://www.w3.org/2001/XMLSchema" target="_blank">http://www.w3.org/2001/XMLSchema</a>"</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160; xmlns:jxb="<a class="jive-link-external-small" href="http://java.sun.com/xml/ns/jaxb" target="_blank">http://java.sun.com/xml/ns/jaxb</a>"</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160; jxb:version="2.0"</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160; xmlns:tns="<a class="jive-link-external-small" href="http://www.dstsystems.com/GreetingResponse" target="_blank">http://www.dstsystems.com/GreetingResponse</a>"</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160; targetNamespace="<a class="jive-link-external-small" href="http://www.dstsystems.com/GreetingResponse" target="_blank">http://www.dstsystems.com/GreetingResponse</a>"</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160; elementFormDefault="qualified"&gt;</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>&#160;&#160;&#160; &lt;xsd:element name="GreetingResponse"&gt;</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;xsd:complexType&gt;</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;xsd:sequence&gt;</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;xsd:element minOccurs="0" name="language" type="xsd:string" /&gt;</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;xsd:element minOccurs="0" name="person" type="xsd:string" /&gt;</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;/xsd:sequence&gt;</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;/xsd:complexType&gt;</p><p>&#160;&#160;&#160; &lt;/xsd:element&gt;</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>&lt;/schema&gt;</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>&#160;&#160; 2.&#160; Run XJC to create the JAXB classes</p><p style="text-align: start;">&#160;&#160; 3.&#160; Created my SEI</p><p>package tutorial.hanbo.webservice;</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>import java.io.StringReader;</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>import javax.jws.WebMethod;</p><p>import javax.jws.WebService;</p><p>import javax.xml.bind.JAXBContext;</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>@WebService</p><p>public class Greeting</p><p>{</p><p>&#160;&#160;&#160; @WebMethod</p><p>&#160;&#160;&#160; public GreetingResponse greetClient(String userName)</p><p>&#160;&#160;&#160; {</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160; GreetingResponse response = null;</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160; try</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160; {</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; JAXBContext ctxResponse = JAXBContext.newInstance( "tutorial.hanbo.webservice" );</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; response = (GreetingResponse)ctxResponse.createUnmarshaller().unmarshal( new StringReader( "&lt;GreetingResponse&gt;&lt;language&gt;English&lt;/language&gt;&lt;person&gt;" + userName + "&lt;/person&gt;&lt;/GreetingResponse&gt;" ) );</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160; }</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160; catch ( Exception e )</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160; {</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; e.printStackTrace();</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160; }</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160; return response;</p><p>&#160;&#160;&#160; }</p><p>}</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p style="text-align: start;">&#160;&#160; 4.&#160; Created a WAR file</p><p style="text-align: start;">&#160;&#160; 5.&#160; Deployed my application</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p style="text-align: start;">Everything works fine until I try to deploy it.&#160; When I try to deploy it, I get the following error messages:</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>12:54:15,312 ERROR [JBossXSErrorHandler] JBossWS_webservice.hanbo.tutorial_3255632659267054358.xsd[domain:<a class="jive-link-external-small" href="http://www.w3.org/TR/xml-s" target="_blank">http://www.w3.org/TR/xml-s</a></p><p>chema-1]::[key=src-resolve]::Message=src-resolve: Cannot resolve the name 'ns1:language' to a(n) 'element declaration' component.</p><p>12:54:15,312 ERROR [JBossXSErrorHandler] JBossWS_webservice.hanbo.tutorial_3255632659267054358.xsd[domain:<a class="jive-link-external-small" href="http://www.w3.org/TR/xml-s" target="_blank">http://www.w3.org/TR/xml-s</a></p><p>chema-1]::[key=src-resolve]::Message=src-resolve: Cannot resolve the name 'ns1:person' to a(n) 'element declaration' component.</p><p>12:54:15,328 INFO&#160; [WSDLFilePublisher] WSDL published to: file:/C:/JBoss/jboss-5.1.0.GA/server/default/data/wsdl/WS-Example.war/Gree</p><p>tingService5953674029938406316.wsdl</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>Does the above error messages indicate that the Abstract Contract (i.e. wsdl + schema) is being generated incorrectly or am I doing something incorrectly?</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>Thanks,</p><p>dg</p><p>Newbie JBoss User</p></div>

<div style="background-color: #f4f4f4; padding: 10px; margin-top: 20px;">
    <p style="margin: 0;">Reply to this message by <a href="http://community.jboss.org/message/614526#614526">going to Community</a></p>
        <p style="margin: 0;">Start a new discussion in Beginner's Corner at <a href="http://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2075">Community</a></p>
</div></td>
                        </tr>
                    </tbody>
                </table>


                </td>
            </tr>
        </tbody>
    </table>

</div>

</body>
</html>