Hi,
I have created a small WebService using Eclipse 3.4 and Glassfish v3 prelude.
After deploying the WebService I am unable to see the wsdl through Web Browser.I am not getting the reason for it.
Is it the problem with Glassfish or I have missed out something.I have included the code below:
Using wsgen tool i have created 'MyHelloService_schema1.xsd' and 'MyHelloService.wsdl' and placed it inside 'WEB-INF' folder.
I was trying to access wsdl through this URL:
http://localhost:8080/HelloWebService/MyHelloService?wsdl which gave me 404 error.
Please help me out in this.
//Service Class:
package com.hello.ws;
import javax.jws.WebMethod;
import javax.jws.WebService;
import javax.xml.ws.RequestWrapper;
import javax.xml.ws.ResponseWrapper;
@WebService(name="Hello",serviceName="MyHelloService",targetNamespace="http://myws.com/hello" )
public class Hello
{
@WebMethod(operationName="getName",action="urn:get")
@RequestWrapper(className="com.hello.ws.GetNameRequest",localName="getNameRequest",targetNamespace="http://myws.com/hello")
@ResponseWrapper(className="com.hello.ws.GetNameResponse",localName="getNameResponse",targetNamespace="http://myws.com/hello")
public String getHello(String name)
{
System.out.println("The name is :"+name);
return "Hello " + name + "!";
}
}
//WSDL:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<!-- Generated by JAX-WS RI at
http://jax-ws.dev.java.net. RI's version is JAX-WS RI 2.1.6 in JDK 6. -->
<definitions targetNamespace="http://myws.com/hello" name="MyHelloService" xmlns="http://schemas.xmlsoap.org/wsdl/" xmlns:tns="http://myws.com/hello" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/">
<types>
<xsd:schema>
<xsd:import namespace="http://myws.com/hello" schemaLocation="MyHelloService_schema1.xsd"/>
</xsd:schema>
</types>
<message name="getName">
<part name="parameters" element="tns:getNameRequest"/>
</message>
<message name="getNameResponse">
<part name="parameters" element="tns:getNameResponse"/>
</message>
<portType name="Hello">
<operation name="getName">
<input message="tns:getName"/>
<output message="tns:getNameResponse"/>
</operation>
</portType>
<binding name="HelloPortBinding" type="tns:Hello">
<soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="document"/>
<operation name="getName">
<soap:operation soapAction="urn:get"/>
<input>
<soap:body use="literal"/>
</input>
<output>
<soap:body use="literal"/>
</output>
</operation>
</binding>
<service name="MyHelloService">
<port name="HelloPort" binding="tns:HelloPortBinding">
<soap:address location="http://localhost:8080/HelloWebService/MyHelloService"/>
</port>
</service>
</definitions>
Thanks ,
Ankita.