[jboss-user] [Beginner's Corner] - JBoss Newbie Question
developer.gubler
do-not-reply at jboss.com
Mon Jul 11 15:02:06 EDT 2011
developer.gubler [http://community.jboss.org/people/developer.gubler] created the discussion
"JBoss Newbie Question"
To view the discussion, visit: http://community.jboss.org/message/614526#614526
--------------------------------------------------------------
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 http://www.w3.org/2001/XMLSchema"
xmlns:xsd=" http://www.w3.org/2001/XMLSchema http://www.w3.org/2001/XMLSchema"
xmlns:jxb=" http://java.sun.com/xml/ns/jaxb http://java.sun.com/xml/ns/jaxb"
jxb:version="2.0"
xmlns:tns=" http://www.dstsystems.com/GreetingResponse http://www.dstsystems.com/GreetingResponse"
targetNamespace=" http://www.dstsystems.com/GreetingResponse 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 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 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
[http://community.jboss.org/message/614526#614526]
Start a new discussion in Beginner's Corner at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2075]
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/jboss-user/attachments/20110711/4f3bbae8/attachment-0001.html
More information about the jboss-user
mailing list