Skip to content

Commit

Permalink
feat(*) 新增-*.wsdl文件
Browse files Browse the repository at this point in the history
修复-打包时从远程url无法读取到*.wsdl文件报错问题
  • Loading branch information
Zhengjiaao committed Mar 4, 2022
1 parent cbb9a74 commit 4520df9
Show file tree
Hide file tree
Showing 5 changed files with 169 additions and 33 deletions.
10 changes: 5 additions & 5 deletions starter-web-services/starter-web-services-client/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>com.zja</groupId>
<artifactId>spring-boot-starter-test-root</artifactId>
<artifactId>starter-web-services</artifactId>
<version>2.0-SNAPSHOT</version>
</parent>

Expand Down Expand Up @@ -75,13 +75,13 @@
<sourceRoot>${project.basedir}/src/main/java</sourceRoot>
<wsdlOptions>
<!-- 指定wsdl文件 -->
<wsdlOption>
<wsdl>http://localhost:8080/webservice/api?wsdl</wsdl>
</wsdlOption>
<!--<wsdlOption>
<wsdl>http://localhost:8080/webservice/api?wsdl</wsdl>
</wsdlOption>-->
<wsdlOption>
<wsdl>src/main/resources/wsdl/author.wsdl</wsdl>
<wsdlLocation>classpath:wsdl/author.wsdl</wsdlLocation>
</wsdlOption>-->
</wsdlOption>
</wsdlOptions>
</configuration>
<goals>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,18 +1,16 @@

package com.zja.webservices.service.wsdl;

import lombok.Data;

import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlType;


/**
* <p>userDTO complex type的 Java 类。
*
*
* <p>以下模式片段指定包含在此类中的预期内容。
*
*
* <pre>
* &lt;complexType name="userDTO"&gt;
* &lt;complexContent&gt;
Expand All @@ -26,10 +24,9 @@
* &lt;/complexContent&gt;
* &lt;/complexType&gt;
* </pre>
*
*
*
*
*/
@Data
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "userDTO", propOrder = {
"age",
Expand All @@ -44,71 +41,71 @@ public class UserDTO {

/**
* 获取age属性的值。
*
*
* @return
* possible object is
* {@link Integer }
*
*
*/
public Integer getAge() {
return age;
}

/**
* 设置age属性的值。
*
*
* @param value
* allowed object is
* {@link Integer }
*
*
*/
public void setAge(Integer value) {
this.age = value;
}

/**
* 获取id属性的值。
*
*
* @return
* possible object is
* {@link Long }
*
*
*/
public Long getId() {
return id;
}

/**
* 设置id属性的值。
*
*
* @param value
* allowed object is
* {@link Long }
*
*
*/
public void setId(Long value) {
this.id = value;
}

/**
* 获取name属性的值。
*
*
* @return
* possible object is
* {@link String }
*
*
*/
public String getName() {
return name;
}

/**
* 设置name属性的值。
*
*
* @param value
* allowed object is
* {@link String }
*
*
*/
public void setName(String value) {
this.name = value;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

/**
* This class was generated by Apache CXF 3.4.5
* 2021-10-29T15:42:49.608+08:00
* 2022-03-04T14:47:53.863+08:00
* Generated source version: 3.4.5
*
*/
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package com.zja.webservices.service.wsdl;

import java.net.MalformedURLException;
import java.net.URL;
import javax.xml.namespace.QName;
import javax.xml.ws.WebEndpoint;
Expand All @@ -10,12 +9,12 @@

/**
* This class was generated by Apache CXF 3.4.5
* 2021-10-29T15:42:49.636+08:00
* 2022-03-04T14:47:53.893+08:00
* Generated source version: 3.4.5
*
*/
@WebServiceClient(name = "UserService",
wsdlLocation = "http://localhost:8080/webservice/api?wsdl",
wsdlLocation = "classpath:wsdl/author.wsdl",
targetNamespace = "http://service.webservices.zja.com/wsdl")
public class UserService_Service extends Service {

Expand All @@ -24,13 +23,11 @@ public class UserService_Service extends Service {
public final static QName SERVICE = new QName("http://service.webservices.zja.com/wsdl", "UserService");
public final static QName UserportName = new QName("http://service.webservices.zja.com/wsdl", "UserportName");
static {
URL url = null;
try {
url = new URL("http://localhost:8080/webservice/api?wsdl");
} catch (MalformedURLException e) {
URL url = UserService_Service.class.getClassLoader().getResource("wsdl/author.wsdl");
if (url == null) {
java.util.logging.Logger.getLogger(UserService_Service.class.getName())
.log(java.util.logging.Level.INFO,
"Can not initialize the default wsdl from {0}", "http://localhost:8080/webservice/api?wsdl");
"Can not initialize the default wsdl from {0}", "classpath:wsdl/author.wsdl");
}
WSDL_LOCATION = url;
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,142 @@
<?xml version='1.0' encoding='UTF-8'?><wsdl:definitions xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:tns="http://service.webservices.zja.com/wsdl" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:ns1="http://schemas.xmlsoap.org/soap/http" name="UserService" targetNamespace="http://service.webservices.zja.com/wsdl">
<wsdl:types>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:tns="http://service.webservices.zja.com/wsdl" elementFormDefault="unqualified" targetNamespace="http://service.webservices.zja.com/wsdl" version="1.0">

<xs:element name="getName" type="tns:getName"/>

<xs:element name="getNameResponse" type="tns:getNameResponse"/>

<xs:element name="getUser" type="tns:getUser"/>

<xs:element name="getUserResponse" type="tns:getUserResponse"/>

<xs:element name="oKongOperationName" type="tns:oKongOperationName"/>

<xs:element name="oKongOperationNameResponse" type="tns:oKongOperationNameResponse"/>

<xs:complexType name="getName">
<xs:sequence>
<xs:element minOccurs="0" name="arg0" type="xs:string"/>
</xs:sequence>
</xs:complexType>

<xs:complexType name="getNameResponse">
<xs:sequence>
<xs:element minOccurs="0" name="return" type="xs:string"/>
</xs:sequence>
</xs:complexType>

<xs:complexType name="oKongOperationName">
<xs:sequence>
<xs:element minOccurs="0" name="paramName" type="xs:string"/>
</xs:sequence>
</xs:complexType>

<xs:complexType name="oKongOperationNameResponse">
<xs:sequence>
<xs:element minOccurs="0" name="return" type="xs:string"/>
</xs:sequence>
</xs:complexType>

<xs:complexType name="getUser">
<xs:sequence>
<xs:element minOccurs="0" name="arg0" type="xs:long"/>
</xs:sequence>
</xs:complexType>

<xs:complexType name="getUserResponse">
<xs:sequence>
<xs:element minOccurs="0" name="return" type="tns:userDTO"/>
</xs:sequence>
</xs:complexType>

<xs:complexType name="userDTO">
<xs:sequence>
<xs:element minOccurs="0" name="age" type="xs:int"/>
<xs:element minOccurs="0" name="id" type="xs:long"/>
<xs:element minOccurs="0" name="name" type="xs:string"/>
</xs:sequence>
</xs:complexType>

</xs:schema>
</wsdl:types>
<wsdl:message name="oKongOperationName">
<wsdl:part element="tns:oKongOperationName" name="parameters">
</wsdl:part>
</wsdl:message>
<wsdl:message name="getName">
<wsdl:part element="tns:getName" name="parameters">
</wsdl:part>
</wsdl:message>
<wsdl:message name="getUserResponse">
<wsdl:part element="tns:getUserResponse" name="parameters">
</wsdl:part>
</wsdl:message>
<wsdl:message name="oKongOperationNameResponse">
<wsdl:part element="tns:oKongOperationNameResponse" name="parameters">
</wsdl:part>
</wsdl:message>
<wsdl:message name="getNameResponse">
<wsdl:part element="tns:getNameResponse" name="parameters">
</wsdl:part>
</wsdl:message>
<wsdl:message name="getUser">
<wsdl:part element="tns:getUser" name="parameters">
</wsdl:part>
</wsdl:message>
<wsdl:portType name="UserService">
<wsdl:operation name="getName">
<wsdl:input message="tns:getName" name="getName">
</wsdl:input>
<wsdl:output message="tns:getNameResponse" name="getNameResponse">
</wsdl:output>
</wsdl:operation>
<wsdl:operation name="oKongOperationName">
<wsdl:input message="tns:oKongOperationName" name="oKongOperationName">
</wsdl:input>
<wsdl:output message="tns:oKongOperationNameResponse" name="oKongOperationNameResponse">
</wsdl:output>
</wsdl:operation>
<wsdl:operation name="getUser">
<wsdl:input message="tns:getUser" name="getUser">
</wsdl:input>
<wsdl:output message="tns:getUserResponse" name="getUserResponse">
</wsdl:output>
</wsdl:operation>
</wsdl:portType>
<wsdl:binding name="UserServiceSoapBinding" type="tns:UserService">
<soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
<wsdl:operation name="getName">
<soap:operation soapAction="" style="document"/>
<wsdl:input name="getName">
<soap:body use="literal"/>
</wsdl:input>
<wsdl:output name="getNameResponse">
<soap:body use="literal"/>
</wsdl:output>
</wsdl:operation>
<wsdl:operation name="oKongOperationName">
<soap:operation soapAction="oKongAction" style="document"/>
<wsdl:input name="oKongOperationName">
<soap:body use="literal"/>
</wsdl:input>
<wsdl:output name="oKongOperationNameResponse">
<soap:body use="literal"/>
</wsdl:output>
</wsdl:operation>
<wsdl:operation name="getUser">
<soap:operation soapAction="" style="document"/>
<wsdl:input name="getUser">
<soap:body use="literal"/>
</wsdl:input>
<wsdl:output name="getUserResponse">
<soap:body use="literal"/>
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
<wsdl:service name="UserService">
<wsdl:port binding="tns:UserServiceSoapBinding" name="UserportName">
<soap:address location="http://localhost:8080/webservice/api"/>
</wsdl:port>
</wsdl:service>
</wsdl:definitions>

0 comments on commit 4520df9

Please sign in to comment.