当前位置: 首页 > news >正文

网站建设 体会西安的电子商城网站建设

网站建设 体会,西安的电子商城网站建设,ciid室内设计网,网站地图写法maven与spring1.简介 在本教程中#xff0c;我们将学习使用JAX-WS#xff0c;Spring和Maven实施合同优先的SOAP服务应用程序。 这是使用合同优先还是代码优先方法的更多设计决定。 在开发基于SOAP的Web服务应用程序时使用应用合同优先的方法最显着的好处是#xff0c;可以在… maven与spring 1.简介 在本教程中我们将学习使用JAX-WSSpring和Maven实施合同优先的SOAP服务应用程序。 这是使用合同优先还是代码优先方法的更多设计决定。 在开发基于SOAP的Web服务应用程序时使用应用合同优先的方法最显着的好处是可以在对合同进行必要的更改后立即与消费者/客户共享合同因此客户应用程序和Web服务操作实施可以由不同团队同时独立完成从而节省了大量时间。 2.实施 上面的场景是这样的场景客户端/消费者应用程序将通过服务端点与我们的示例基于SOAP的JAX-WS Web服务示例进行交互。 首先从实现开始首先在Eclipse中创建一个Maven项目并确保我们继续使用与下面所示内容相似的目录结构。 首先是查看我们的pom依赖关系它应该类似于 pom.xml dependencies!-- Spring dependencies --dependencygroupIdorg.springframework/groupIdartifactIdspring-core/artifactIdversion4.2.1.RELEASE/version/dependencydependencygroupIdorg.springframework/groupIdartifactIdspring-web/artifactIdversion4.2.1.RELEASE/version/dependency!-- JAX-WS dependencies --dependencygroupIdorg.jvnet.jax-ws-commons.spring/groupIdartifactIdjaxws-spring/artifactIdversion1.9/version/dependencydependencygroupIdcom.sun.xml.ws/groupIdartifactIdjaxws-rt/artifactIdversion2.2.8/version/dependency /dependencies buildfinalNameSOAPWebServiceExample/finalNamepluginsplugingroupIdorg.codehaus.mojo/groupIdartifactIdjaxws-maven-plugin/artifactIdversion1.12/versionconfigurationwsdlDirectory${basedir}/src/main/resources/wsdl/wsdlDirectorypackageNamecom.jcombat.ws/packageNamekeeptrue/keepsourceDestDir${basedir}/target/generated/src/main/java/sourceDestDir/configurationexecutionsexecutionidwsdl_import/idgoalsgoalwsimport/goal/goals/execution/executions/plugin/plugins /build 请注意我们将使用的wsimport工具以便稍后从WSDL文件生成存根文件。 现在让我们检查一下web.xml文件。 web.xml ?xml version1.0 encodingISO-8859-1? web-app xmlns:xsihttp://www.w3.org/2001/XMLSchema-instancexmlnshttp://java.sun.com/xml/ns/javaeexsi:schemaLocationhttp://java.sun.com/xml/ns/javaeehttp://java.sun.com/xml/ns/javaee/web-app_2_5.xsdidWebApp_ID version2.5display-nameSOAPWebServiceExample/display-namelistenerlistener-classorg.springframework.web.context.ContextLoaderListener/listener-class/listenerservletservlet-namecustomer/servlet-nameservlet-classcom.sun.xml.ws.transport.http.servlet.WSSpringServlet/servlet-classload-on-startup1/load-on-startup/servletservlet-mappingservlet-namecustomer/servlet-nameurl-pattern/customer/url-pattern/servlet-mapping/web-app 接下来我们为我们的Web服务创建一个模式文件 。 将其命名为customerService.xsd 这将基本上为我们将要创建的WSDL文件或Web服务合同定义构造块。 customerService.xsd ?xml version1.0 encodingUTF-8? schema xmlnshttp://www.w3.org/2001/XMLSchema targetNamespacehttp://ws.jcombat.com/xmlns:tnshttp://ws.jcombat.com/ elementFormDefaultqualifiedelement nameCustomerServiceRequest typetns:CustomerServiceRequestType/elementcomplexType nameCustomerServiceRequestTypesequenceelement namecustomerId typeint/element/sequence/complexTypecomplexType nameCustomerServiceResponseTypesequenceelement namecustomer typetns:Customer maxOccursunboundedminOccurs0/element/sequence/complexTypeelement nameCustomerServiceResponse typetns:CustomerServiceResponseType/elementcomplexType nameCustomersequenceelement nameid typeint maxOccurs1 minOccurs1/elementelement namename typestring maxOccurs1 minOccurs1/element/sequence/complexType /schema 使用我们刚创建的XML模式创建一个有效的WSDL文件。 customerService.wsdl ?xml version1.0 encodingUTF-8? wsdl:definitionsxmlns:wsuhttp://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsdxmlns:wsphttp://www.w3.org/ns/ws-policy xmlns:wsp1_2http://schemas.xmlsoap.org/ws/2004/09/policyxmlns:wsamhttp://www.w3.org/2007/05/addressing/metadata xmlns:soaphttp://schemas.xmlsoap.org/wsdl/soap/xmlns:tnshttp://ws.jcombat.com/ xmlns:xsdhttp://www.w3.org/2001/XMLSchemaxmlns:wsdlhttp://schemas.xmlsoap.org/wsdl/ targetNamespacehttp://ws.jcombat.com/namecustomerServicewsdl:typesxsd:schema targetNamespacehttp://ws.jcombat.com/xsd:import namespacehttp://ws.jcombat.com/schemaLocation../schema/customerService.xsd //xsd:schema/wsdl:typeswsdl:message nameCustomerServiceRequestwsdl:part nameCustomerServiceRequest elementtns:CustomerServiceRequest //wsdl:messagewsdl:message nameCustomerServiceResponsewsdl:part nameCustomerServiceResponse elementtns:CustomerServiceResponse //wsdl:messagewsdl:portType nameCustomerServicePortTypewsdl:operation namegetCustomerwsdl:input nameCustomerServiceRequest messagetns:CustomerServiceRequest /wsdl:output nameCustomerServiceResponse messagetns:CustomerServiceResponse //wsdl:operation/wsdl:portTypewsdl:binding nameCustomerEndpointPortBinding typetns:CustomerServicePortTypesoap:binding styledocumenttransporthttp://schemas.xmlsoap.org/soap/http /wsdl:operation namegetCustomersoap:operation styledocument soapActiongetCustomer /wsdl:input nameCustomerServiceRequestsoap:body useliteral //wsdl:inputwsdl:output nameCustomerServiceResponsesoap:body useliteral //wsdl:output/wsdl:operation/wsdl:bindingwsdl:service namecustomerServicewsdl:port nameCustomerEndpointPort bindingtns:CustomerEndpointPortBindingsoap:address locationhttp://localhost:8080/SOAPWebServiceExample/customer //wsdl:port/wsdl:service /wsdl:definitions 接下来是从WSDL文件生成存根文件。 为此请在系统的命令提示符下运行以下命令。 mvn clean install 在/ target目录中签出生成的存根文件。 现在在名为CustomerServiceImpl的类中创建生成的服务接口CustomerServicePortType的实现。 CustomerServiceImpl.java package com.jcombat.service;import javax.jws.WebService;import com.jcombat.ws.Customer; import com.jcombat.ws.CustomerServicePortType; import com.jcombat.ws.CustomerServiceRequestType; import com.jcombat.ws.CustomerServiceResponseType;WebService(endpointInterfacecom.jcombat.ws.CustomerServicePortType) public class CustomerServiceImpl implements CustomerServicePortType {public CustomerServiceResponseType getCustomer(CustomerServiceRequestType customerServiceRequest) {final CustomerServiceResponseType response new CustomerServiceResponseType();Customer customer new Customer();customer.setId(123);customer.setName(Ramesh);response.getCustomer().add(customer);return response;}} 必须将WebService批注应用于端点接口实现类才能将其标记为Web服务端点。 WebService批注告诉服务器运行时环境将该类的所有公共方法公开为Web服务方法。 我们已经完成了该应用程序。 最终检查是当点击以下端点URI时是否可以看到显示的WSDL内容我们已将其指定的位置指向WSDL文件的底部。 http// localhost8080 / SOAPWebServiceExample / customerwsdl 下面是我们在浏览器中看到的内容。 是的我们成功做到了。 3.运行应用程序 使用WSDL URIhttp// localhost8080 / SOAPWebServiceExample / customerwsdl在SOAP UI中设置SOAP项目。 下面是当我们在SOAP UI中实际命中服务时看到的内容。 4.下载源代码 下载源代码 翻译自: https://www.javacodegeeks.com/2016/02/contract-first-soap-service-spring-maven.htmlmaven与spring
http://www.zqtcl.cn/news/750373/

相关文章:

  • 邯郸网站建设渠道免费做全网解析电影网站赚钱
  • 中铁中基建设集团网站东莞网络优化哪家公司好
  • wordpress免费建站合肥关键词网站排名
  • 中铁建设集团门户网登录网站自己可以建设环保公益网站吗
  • 国内电子商务网站有哪些网站升级中html
  • 影响网站加载速度顺德做网站那家好
  • 如何备份网站的百度怎样建立网站
  • 如何建立网站视频教程湖北seo关键词排名优化软件
  • 南宁网站建设推荐q479185700顶上新公司网站建设流程
  • 石家庄城乡建设局网站四川网络营销
  • 网站更换名称需要重新备案吗赣州章贡区二手房出售信息
  • 浙江恒元建设网站wordpress 主题 英文
  • 甘肃网站建设推广做暧昧免费视频大全网站
  • 科技公司网站系统个人网站模板大全
  • 建网站源码建站详解做加油机公司网站
  • 北海做网站有哪家网站布局策划案
  • 做app网站的软件有哪些内容吗本地网站建设公司
  • 做服装团购有哪些网站有哪些网页端二维码在哪里
  • 石材网站建设方案科室建设网站
  • 梧州住房和建设局网站网站目录文件
  • 有没有做生鲜配送的网站wordpress调用摘要
  • 建设社团网站的可行性分析沈阳网站建设企业
  • 青岛知名网站建设公司优化大师有必要花钱吗
  • pc网站做app京东海淀区
  • 效果好的网站建设公萝岗企业网站建设
  • wordpress个人展示网站6新西兰网站后缀
  • 为什么自己做的网站别人打不开三门峡市湖滨区建设局网站
  • 长春网长春网站建设络推广工程建设国家标准网站
  • 微网站开发 mui框架网站备案幕布拍照是什么
  • 北京天通苑 做网站西安百度网站建设