浏览 1783 次
精华帖 (0) :: 良好帖 (0) :: 新手帖 (0) :: 隐藏帖 (0)
|
|
---|---|
作者 | 正文 |
发表时间:2008-03-19
服务程序代码就省略了,下面是配置. 启动TOMCAT后服务正常启动JSP 也可以正常运行. 调用http://localhost:8080/EMSTest/DictionaryType的地址时候服务器找不到SERVER ,大家看看是什么原因造成的,是TOMCAT版本有问题吗? 警告: Can't find the the request for http://localhost:8080/EMSTest/DictionaryType's Observer web.xml <servlet> <servlet-name>CXFServlet</servlet-name> <display-name>CXF Servlet</display-name> <servlet-class> org.apache.cxf.transport.servlet.CXFServlet </servlet-class> <load-on-startup>1</load-on-startup> </servlet> <servlet-mapping> <servlet-name>CXFServlet</servlet-name> <url-pattern>/*</url-pattern> </servlet-mapping> service.xml <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http://www.springframework.org/dtd/spring-beans.dtd" > <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:jaxws="http://cxf.apache.org/jaxws" xsi:schemaLocation=" http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd http://cxf.apache.org/jaxws http://cxf.apache.org/schemas/jaxws.xsd"> <import resource="classpath:META-INF/cxf/cxf.xml" /> <import resource="classpath:META-INF/cxf/cxf-extension-soap.xml" /> <import resource="classpath:META-INF/cxf/cxf-servlet.xml" /> <bean id="dictionary" class="com.gdcn.bpaf.service.impl.DictionaryTypeServiceImpl" /> <jaxws:endpoint id="dictionaryType" implementor="#dictionary" address="/DictionaryType" /> <bean id="catalog" class="com.gdcn.bpaf.service.impl.SysCatalogServiceImpl" /> <jaxws:endpoint id="sysCatalog" implementor="#catalog" address="/SysCatalog" /> <bean id="serialNo" class="com.gdcn.bpaf.service.impl.SysSerialNoServiceImpl" /> <jaxws:endpoint id="sysSerialNo" implementor="#serialNo" address="/SysSerialNo" /> </beans> client.xml <?xml version="1.0" encoding="UTF-8"?> <!-- Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. --> <!-- START SNIPPET: beans --> <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:jaxws="http://cxf.apache.org/jaxws" xsi:schemaLocation=" http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd http://cxf.apache.org/jaxws http://cxf.apache.org/schema/jaxws.xsd"> <bean id="client" class="com.gdcn.bpaf.service.IDictionaryTypeService" factory-bean="clientFactory" factory-method="create"/> <bean id="clientFactory" class="org.apache.cxf.jaxws.JaxWsProxyFactoryBean"> <property name="serviceClass" value="com.gdcn.bpaf.service.IDictionaryTypeService"/> <property name="address" value="http://localhost:8080/EMSTest/DictionaryType"/> </bean> </beans> <!-- END SNIPPET: beans --> 客户端调用代码,SWT的桌面客户端调用 public class testUI { protected Shell shell; /** * Launch the application * @param args */ public static void main(String[] args) { try { testUI window = new testUI(); window.open(); } catch (Exception e) { e.printStackTrace(); } } /** * Open the window * @throws Exception */ public void open() throws Exception { final Display display = Display.getDefault(); createContents(); shell.open(); shell.layout(); while (!shell.isDisposed()) { if (!display.readAndDispatch()) display.sleep(); } } /** * Create contents of the window * @throws Exception */ protected void createContents() throws Exception { shell = new Shell(); shell.setSize(500, 375); shell.setText("SWT Application"); final Label label = new Label(shell, SWT.NONE); label.setText(testServiceMethod()); label.setBounds(132, 98, 213, 73); // } public String testServiceMethod() throws Exception { // START SNIPPET: client ClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext(new String[] {"com/ems/test/client-beans.xml"}); com.gdcn.bpaf.service.IDictionaryTypeService client = (IDictionaryTypeService)context.getBean("client"); com.gdcn.bpaf.model.BPAFDictionaryType response = client.getDictionaryTypeByCode("test"); System.out.println("Response: " + response.getDictionary_name()); return response.getDictionary_name(); // END SNIPPET: client }} 声明:ITeye文章版权属于作者,受法律保护。没有作者书面许可不得转载。
推荐链接
|
|
返回顶楼 | |