English 中文(简体)
用Apache CXF开发的网络服务添加一个超文本页
原标题:Adding a HTML Page to a webservice developed using Apache CXF

I have created a Apache CXF Webservices . It is working fine . It was deployed successfuly as a war file into Tomcat .

网上服务课以罚款。

一、试图与他人接触时的手段

http://localhost:8080/SpringEx/HelloWorld?wsdl   

罚款

but when i tried to add a html page or a jsp page into its folder and tried to access

rel=“nofollow”>http:// localhost:80/Spring/ Test.html

它给我留下了一个错误。

纽约总部

测试.html是一个简单的网页。

<HTML>
<BODY>
<FORM METHOD=POST >
What s your name? <INPUT TYPE=TEXT NAME=username SIZE=20><BR>
What s your e-mail address? <INPUT TYPE=TEXT NAME=email SIZE=20><BR>
What s your age? <INPUT TYPE=TEXT NAME=age SIZE=4>
<P><INPUT TYPE=SUBMIT>
</FORM>
</BODY>
</HTML>
问题回答

我假定,你的网络服务在Apache CXF servlet上运行,内容是:Spring,其定义是网络应用密码.xml。 与此类似:

<servlet>
    <servlet-name>HelloWorld</servlet-name>
    <description>Apache CXF Endpoint</description>
    <servlet-class>org.apache.cxf.transport.servlet.CXFServlet</servlet-class>
    <load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
    <servlet-name>HelloWorld</servlet-name>
    <url-pattern>/SpringEx/*</url-pattern>
</servlet-mapping>

你之所以出现这一错误是因为<代码>。 阿帕奇·CXF servlet被描绘成仅听从这一背景: SpringEx,并只适用于您的<代码>中界定的服务(或不是春天),取决于你如何配置你的终点。 它不向您提供任何<代码>超文本<>/代码>或<代码>。

这样做肯定不好,无法提供网络服务,然后在网上结束。 但无论如何。 如果您的<代码>CXF servlet被打上了地图,因为我在上面仅向你表明,你只是将<代码>JSP的网页放在WEB-INF上,并且不界定仅适用于网络服务的<编码>URL。

与此类似:

http://localhost:8080/Test.html

如果把你的网络服务CXF服务器描绘成像:

<servlet-mapping>
    <servlet-name>HelloWorld</servlet-name>
    <url-pattern>/*</url-pattern>
</servlet-mapping>

SpringEx是申请国名,因此,你们需要做这样的事情:

<servlet-mapping>
    <servlet-name>HelloWorld</servlet-name>
    <url-pattern>/services/*</url-pattern>
</servlet-mapping>

Now your web service will be accessible through:

http://localhost:8080/SpringEx/services/HelloWorld?wsdl

http://www.un.org/spanish/ecosoc 通过:

http://localhost:8080/SpringEx/Test.html




相关问题
IIS 6.0 hangs when serving a web-service

I am having issues with one of our web-services. It works fine on my development machine (win XP) whether I host it as a separate application or using cassini from Visual studio. Once I deploy on the ...

ASP.net web services

I am using a web service which sets the Thread.CurrentPrincipal object while logging in and soon later when another webmethod of the same web service accesses Thread.CurrentPrincipal, its different/...

Unity Container Disposing and XML Web Service

I am registering some wrapers over un-managed objects in container. How can I dispose of them at the end of the container s lifetime? Please bear in mind I have an XML Web service.

SharePoint : web service permission error

I have a sharepoint site, and I am calling a standard sharepoint web service. I create the web service request like this : wsDws.Url = this.SiteAddress + @"/_vti_bin/Dws.asmx"; When I use ...

热门标签