<!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/614529#614529">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.  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:</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>JBoss 5.1.0</p><p>JBossWS Native 3.4.0</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>What I have done:</p><p style="text-align: start;">   1.  Created a XSD for the response</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p><?xml version="1.0" encoding="UTF-8"?></p><p><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>        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>        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>        jxb:version="2.0"</p><p>        xmlns:tns="<a class="jive-link-external-small" href="http://www.dstsystems.com/GreetingResponse" target="_blank">http://www.dstsystems.com/GreetingResponse</a>"</p><p>        targetNamespace="<a class="jive-link-external-small" href="http://www.dstsystems.com/GreetingResponse" target="_blank">http://www.dstsystems.com/GreetingResponse</a>"</p><p>        elementFormDefault="qualified"></p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>    <xsd:element name="GreetingResponse"></p><p>        <xsd:complexType></p><p>            <xsd:sequence></p><p>                <xsd:element minOccurs="0" name="language" type="xsd:string" /></p><p>                <xsd:element minOccurs="0" name="person" type="xsd:string" /></p><p>            </xsd:sequence></p><p>        </xsd:complexType></p><p>    </xsd:element></p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p></schema></p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>   2.  Run XJC to create the JAXB classes</p><p style="text-align: start;">   3.  Created my SEI</p><p>package tutorial.hanbo.webservice;</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>import java.io.StringReader;</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </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;"> </p><p>@WebService</p><p>public class Greeting</p><p>{</p><p>    @WebMethod</p><p>    public GreetingResponse greetClient(String userName)</p><p>    {</p><p>        GreetingResponse response = null;</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>        try</p><p>        {</p><p>            JAXBContext ctxResponse = JAXBContext.newInstance( "tutorial.hanbo.webservice" );</p><p>            response = (GreetingResponse)ctxResponse.createUnmarshaller().unmarshal( new StringReader( "<GreetingResponse><language>English</language><person>" + userName + "</person></GreetingResponse>" ) );</p><p>        }</p><p>        catch ( Exception e )</p><p>        {</p><p>            e.printStackTrace();</p><p>        }</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>        return response;</p><p>    }</p><p>}</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p style="text-align: start;">   4.  Created a WAR file</p><p style="text-align: start;">   5.  Deployed my application</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p style="text-align: start;">Everything works fine until I try to deploy it.  When I try to deploy it, I get the following error messages:</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </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  [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;"> </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;"> </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/614529#614529">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>