?? testhelloworld.java
字號:
package com.foshanshop.AppTest;
import java.net.URL;
import javax.xml.namespace.QName;
import javax.xml.rpc.Service;
import org.jboss.ws.jaxrpc.ServiceFactoryImpl;
import com.foshanshop.client.HelloWorld;
public class TestHelloWorld {
public static void main(String[] args) {
try {
URL helloWsdlUrl = new URL("http://localhost:8080/Services/HelloWorldService?wsdl");
String nameSpaceUri = "http://com.foshanshop.ws";
URL mappingURL = new TestHelloWorld().getClass().getClassLoader().getResource("META-INF/jaxrpc-mapping.xml");
ServiceFactoryImpl factory = new ServiceFactoryImpl();
Service service = factory.createService(helloWsdlUrl, new QName(nameSpaceUri, "HelloWorldService"), mappingURL);
HelloWorld port = (HelloWorld) service.getPort(HelloWorld.class);
String out = port.sayHello("佛山人");
System.out.println("結(jié)果:"+out);
} catch (Exception e) {
e.printStackTrace();
}
}
}
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -